diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2010-06-05 16:29:45 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2010-08-09 16:47:58 -0400 |
commit | 6d8af64c1c5ad4fd119b371ae70c114ee1f443b1 (patch) | |
tree | 662cf5b2d557c26b38d9cc41fafd34e0af6044bb /ipc/mqueue.c | |
parent | 72edc4d0873ba5165c0759264298bf5f55351c7a (diff) |
switch mqueue to ->evict_inode()
... and since the inodes are never hashed, we can use default ->drop_inode()
just fine.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'ipc/mqueue.c')
-rw-r--r-- | ipc/mqueue.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/ipc/mqueue.c b/ipc/mqueue.c index c93fd3faac2d..c60e519e2917 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c | |||
@@ -158,7 +158,7 @@ static struct inode *mqueue_get_inode(struct super_block *sb, | |||
158 | u->mq_bytes + mq_bytes > | 158 | u->mq_bytes + mq_bytes > |
159 | task_rlimit(p, RLIMIT_MSGQUEUE)) { | 159 | task_rlimit(p, RLIMIT_MSGQUEUE)) { |
160 | spin_unlock(&mq_lock); | 160 | spin_unlock(&mq_lock); |
161 | /* mqueue_delete_inode() releases info->messages */ | 161 | /* mqueue_evict_inode() releases info->messages */ |
162 | goto out_inode; | 162 | goto out_inode; |
163 | } | 163 | } |
164 | u->mq_bytes += mq_bytes; | 164 | u->mq_bytes += mq_bytes; |
@@ -241,7 +241,7 @@ static void mqueue_destroy_inode(struct inode *inode) | |||
241 | kmem_cache_free(mqueue_inode_cachep, MQUEUE_I(inode)); | 241 | kmem_cache_free(mqueue_inode_cachep, MQUEUE_I(inode)); |
242 | } | 242 | } |
243 | 243 | ||
244 | static void mqueue_delete_inode(struct inode *inode) | 244 | static void mqueue_evict_inode(struct inode *inode) |
245 | { | 245 | { |
246 | struct mqueue_inode_info *info; | 246 | struct mqueue_inode_info *info; |
247 | struct user_struct *user; | 247 | struct user_struct *user; |
@@ -249,10 +249,11 @@ static void mqueue_delete_inode(struct inode *inode) | |||
249 | int i; | 249 | int i; |
250 | struct ipc_namespace *ipc_ns; | 250 | struct ipc_namespace *ipc_ns; |
251 | 251 | ||
252 | if (S_ISDIR(inode->i_mode)) { | 252 | end_writeback(inode); |
253 | clear_inode(inode); | 253 | |
254 | if (S_ISDIR(inode->i_mode)) | ||
254 | return; | 255 | return; |
255 | } | 256 | |
256 | ipc_ns = get_ns_from_inode(inode); | 257 | ipc_ns = get_ns_from_inode(inode); |
257 | info = MQUEUE_I(inode); | 258 | info = MQUEUE_I(inode); |
258 | spin_lock(&info->lock); | 259 | spin_lock(&info->lock); |
@@ -261,8 +262,6 @@ static void mqueue_delete_inode(struct inode *inode) | |||
261 | kfree(info->messages); | 262 | kfree(info->messages); |
262 | spin_unlock(&info->lock); | 263 | spin_unlock(&info->lock); |
263 | 264 | ||
264 | clear_inode(inode); | ||
265 | |||
266 | /* Total amount of bytes accounted for the mqueue */ | 265 | /* Total amount of bytes accounted for the mqueue */ |
267 | mq_bytes = info->attr.mq_maxmsg * (sizeof(struct msg_msg *) | 266 | mq_bytes = info->attr.mq_maxmsg * (sizeof(struct msg_msg *) |
268 | + info->attr.mq_msgsize); | 267 | + info->attr.mq_msgsize); |
@@ -1225,9 +1224,8 @@ static const struct file_operations mqueue_file_operations = { | |||
1225 | static const struct super_operations mqueue_super_ops = { | 1224 | static const struct super_operations mqueue_super_ops = { |
1226 | .alloc_inode = mqueue_alloc_inode, | 1225 | .alloc_inode = mqueue_alloc_inode, |
1227 | .destroy_inode = mqueue_destroy_inode, | 1226 | .destroy_inode = mqueue_destroy_inode, |
1227 | .evict_inode = mqueue_evict_inode, | ||
1228 | .statfs = simple_statfs, | 1228 | .statfs = simple_statfs, |
1229 | .delete_inode = mqueue_delete_inode, | ||
1230 | .drop_inode = generic_delete_inode, | ||
1231 | }; | 1229 | }; |
1232 | 1230 | ||
1233 | static struct file_system_type mqueue_fs_type = { | 1231 | static struct file_system_type mqueue_fs_type = { |