diff options
| author | Al Viro <viro@zeniv.linux.org.uk> | 2024-02-26 01:46:35 -0500 |
|---|---|---|
| committer | Al Viro <viro@zeniv.linux.org.uk> | 2025-11-16 01:35:02 -0500 |
| commit | 1e508e05dd087b182143d9f55809e7feca662fb7 (patch) | |
| tree | 7e80ea9bf367a3a1d32641c8cca772fe9ac36c89 /ipc | |
| parent | 50889f533f69eeccbde48886a283726bb66d405c (diff) | |
convert mqueue
All modifications via normal VFS codepaths; just take care of making
persistent in in mqueue_create_attr() and discardable in mqueue_unlink()
and it doesn't need kill_litter_super() at all.
mqueue_unlink() side is best handled by having it call simple_unlink()
rather than duplicating its guts...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'ipc')
| -rw-r--r-- | ipc/mqueue.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/ipc/mqueue.c b/ipc/mqueue.c index 093551fe66a7..5737130137bf 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c @@ -599,8 +599,7 @@ static int mqueue_create_attr(struct dentry *dentry, umode_t mode, void *arg) dir->i_size += DIRENT_SIZE; simple_inode_init_ts(dir); - d_instantiate(dentry, inode); - dget(dentry); + d_make_persistent(dentry, inode); return 0; out_unlock: spin_unlock(&mq_lock); @@ -617,13 +616,8 @@ static int mqueue_create(struct mnt_idmap *idmap, struct inode *dir, static int mqueue_unlink(struct inode *dir, struct dentry *dentry) { - struct inode *inode = d_inode(dentry); - - simple_inode_init_ts(dir); dir->i_size -= DIRENT_SIZE; - drop_nlink(inode); - dput(dentry); - return 0; + return simple_unlink(dir, dentry); } /* @@ -1638,7 +1632,7 @@ static const struct fs_context_operations mqueue_fs_context_ops = { static struct file_system_type mqueue_fs_type = { .name = "mqueue", .init_fs_context = mqueue_init_fs_context, - .kill_sb = kill_litter_super, + .kill_sb = kill_anon_super, .fs_flags = FS_USERNS_MOUNT, }; |