Commit 6d8af64c authored by Al Viro's avatar Al Viro

switch mqueue to ->evict_inode()

... and since the inodes are never hashed, we can use default ->drop_inode()
just fine.
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 72edc4d0
...@@ -158,7 +158,7 @@ static struct inode *mqueue_get_inode(struct super_block *sb, ...@@ -158,7 +158,7 @@ static struct inode *mqueue_get_inode(struct super_block *sb,
u->mq_bytes + mq_bytes > u->mq_bytes + mq_bytes >
task_rlimit(p, RLIMIT_MSGQUEUE)) { task_rlimit(p, RLIMIT_MSGQUEUE)) {
spin_unlock(&mq_lock); spin_unlock(&mq_lock);
/* mqueue_delete_inode() releases info->messages */ /* mqueue_evict_inode() releases info->messages */
goto out_inode; goto out_inode;
} }
u->mq_bytes += mq_bytes; u->mq_bytes += mq_bytes;
...@@ -241,7 +241,7 @@ static void mqueue_destroy_inode(struct inode *inode) ...@@ -241,7 +241,7 @@ static void mqueue_destroy_inode(struct inode *inode)
kmem_cache_free(mqueue_inode_cachep, MQUEUE_I(inode)); kmem_cache_free(mqueue_inode_cachep, MQUEUE_I(inode));
} }
static void mqueue_delete_inode(struct inode *inode) static void mqueue_evict_inode(struct inode *inode)
{ {
struct mqueue_inode_info *info; struct mqueue_inode_info *info;
struct user_struct *user; struct user_struct *user;
...@@ -249,10 +249,11 @@ static void mqueue_delete_inode(struct inode *inode) ...@@ -249,10 +249,11 @@ static void mqueue_delete_inode(struct inode *inode)
int i; int i;
struct ipc_namespace *ipc_ns; struct ipc_namespace *ipc_ns;
if (S_ISDIR(inode->i_mode)) { end_writeback(inode);
clear_inode(inode);
if (S_ISDIR(inode->i_mode))
return; return;
}
ipc_ns = get_ns_from_inode(inode); ipc_ns = get_ns_from_inode(inode);
info = MQUEUE_I(inode); info = MQUEUE_I(inode);
spin_lock(&info->lock); spin_lock(&info->lock);
...@@ -261,8 +262,6 @@ static void mqueue_delete_inode(struct inode *inode) ...@@ -261,8 +262,6 @@ static void mqueue_delete_inode(struct inode *inode)
kfree(info->messages); kfree(info->messages);
spin_unlock(&info->lock); spin_unlock(&info->lock);
clear_inode(inode);
/* Total amount of bytes accounted for the mqueue */ /* Total amount of bytes accounted for the mqueue */
mq_bytes = info->attr.mq_maxmsg * (sizeof(struct msg_msg *) mq_bytes = info->attr.mq_maxmsg * (sizeof(struct msg_msg *)
+ info->attr.mq_msgsize); + info->attr.mq_msgsize);
...@@ -1225,9 +1224,8 @@ static const struct file_operations mqueue_file_operations = { ...@@ -1225,9 +1224,8 @@ static const struct file_operations mqueue_file_operations = {
static const struct super_operations mqueue_super_ops = { static const struct super_operations mqueue_super_ops = {
.alloc_inode = mqueue_alloc_inode, .alloc_inode = mqueue_alloc_inode,
.destroy_inode = mqueue_destroy_inode, .destroy_inode = mqueue_destroy_inode,
.evict_inode = mqueue_evict_inode,
.statfs = simple_statfs, .statfs = simple_statfs,
.delete_inode = mqueue_delete_inode,
.drop_inode = generic_delete_inode,
}; };
static struct file_system_type mqueue_fs_type = { static struct file_system_type mqueue_fs_type = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment