diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-01-23 17:07:38 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-02-22 23:31:31 -0500 |
commit | 496ad9aa8ef448058e36ca7a787c61f2e63f0f54 (patch) | |
tree | 8f4abde793cd7db5bb8fde6d27ebcacd0e54379a /ipc | |
parent | 57eccb830f1cc93d4b506ba306d8dfa685e0c88f (diff) |
new helper: file_inode(file)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'ipc')
-rw-r--r-- | ipc/mqueue.c | 16 | ||||
-rw-r--r-- | ipc/shm.c | 8 |
2 files changed, 12 insertions, 12 deletions
diff --git a/ipc/mqueue.c b/ipc/mqueue.c index 71a3ca18c873..963a8709f5fb 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c | |||
@@ -477,7 +477,7 @@ static int mqueue_unlink(struct inode *dir, struct dentry *dentry) | |||
477 | static ssize_t mqueue_read_file(struct file *filp, char __user *u_data, | 477 | static ssize_t mqueue_read_file(struct file *filp, char __user *u_data, |
478 | size_t count, loff_t *off) | 478 | size_t count, loff_t *off) |
479 | { | 479 | { |
480 | struct mqueue_inode_info *info = MQUEUE_I(filp->f_path.dentry->d_inode); | 480 | struct mqueue_inode_info *info = MQUEUE_I(file_inode(filp)); |
481 | char buffer[FILENT_SIZE]; | 481 | char buffer[FILENT_SIZE]; |
482 | ssize_t ret; | 482 | ssize_t ret; |
483 | 483 | ||
@@ -498,13 +498,13 @@ static ssize_t mqueue_read_file(struct file *filp, char __user *u_data, | |||
498 | if (ret <= 0) | 498 | if (ret <= 0) |
499 | return ret; | 499 | return ret; |
500 | 500 | ||
501 | filp->f_path.dentry->d_inode->i_atime = filp->f_path.dentry->d_inode->i_ctime = CURRENT_TIME; | 501 | file_inode(filp)->i_atime = file_inode(filp)->i_ctime = CURRENT_TIME; |
502 | return ret; | 502 | return ret; |
503 | } | 503 | } |
504 | 504 | ||
505 | static int mqueue_flush_file(struct file *filp, fl_owner_t id) | 505 | static int mqueue_flush_file(struct file *filp, fl_owner_t id) |
506 | { | 506 | { |
507 | struct mqueue_inode_info *info = MQUEUE_I(filp->f_path.dentry->d_inode); | 507 | struct mqueue_inode_info *info = MQUEUE_I(file_inode(filp)); |
508 | 508 | ||
509 | spin_lock(&info->lock); | 509 | spin_lock(&info->lock); |
510 | if (task_tgid(current) == info->notify_owner) | 510 | if (task_tgid(current) == info->notify_owner) |
@@ -516,7 +516,7 @@ static int mqueue_flush_file(struct file *filp, fl_owner_t id) | |||
516 | 516 | ||
517 | static unsigned int mqueue_poll_file(struct file *filp, struct poll_table_struct *poll_tab) | 517 | static unsigned int mqueue_poll_file(struct file *filp, struct poll_table_struct *poll_tab) |
518 | { | 518 | { |
519 | struct mqueue_inode_info *info = MQUEUE_I(filp->f_path.dentry->d_inode); | 519 | struct mqueue_inode_info *info = MQUEUE_I(file_inode(filp)); |
520 | int retval = 0; | 520 | int retval = 0; |
521 | 521 | ||
522 | poll_wait(filp, &info->wait_q, poll_tab); | 522 | poll_wait(filp, &info->wait_q, poll_tab); |
@@ -973,7 +973,7 @@ SYSCALL_DEFINE5(mq_timedsend, mqd_t, mqdes, const char __user *, u_msg_ptr, | |||
973 | goto out; | 973 | goto out; |
974 | } | 974 | } |
975 | 975 | ||
976 | inode = f.file->f_path.dentry->d_inode; | 976 | inode = file_inode(f.file); |
977 | if (unlikely(f.file->f_op != &mqueue_file_operations)) { | 977 | if (unlikely(f.file->f_op != &mqueue_file_operations)) { |
978 | ret = -EBADF; | 978 | ret = -EBADF; |
979 | goto out_fput; | 979 | goto out_fput; |
@@ -1089,7 +1089,7 @@ SYSCALL_DEFINE5(mq_timedreceive, mqd_t, mqdes, char __user *, u_msg_ptr, | |||
1089 | goto out; | 1089 | goto out; |
1090 | } | 1090 | } |
1091 | 1091 | ||
1092 | inode = f.file->f_path.dentry->d_inode; | 1092 | inode = file_inode(f.file); |
1093 | if (unlikely(f.file->f_op != &mqueue_file_operations)) { | 1093 | if (unlikely(f.file->f_op != &mqueue_file_operations)) { |
1094 | ret = -EBADF; | 1094 | ret = -EBADF; |
1095 | goto out_fput; | 1095 | goto out_fput; |
@@ -1249,7 +1249,7 @@ retry: | |||
1249 | goto out; | 1249 | goto out; |
1250 | } | 1250 | } |
1251 | 1251 | ||
1252 | inode = f.file->f_path.dentry->d_inode; | 1252 | inode = file_inode(f.file); |
1253 | if (unlikely(f.file->f_op != &mqueue_file_operations)) { | 1253 | if (unlikely(f.file->f_op != &mqueue_file_operations)) { |
1254 | ret = -EBADF; | 1254 | ret = -EBADF; |
1255 | goto out_fput; | 1255 | goto out_fput; |
@@ -1323,7 +1323,7 @@ SYSCALL_DEFINE3(mq_getsetattr, mqd_t, mqdes, | |||
1323 | goto out; | 1323 | goto out; |
1324 | } | 1324 | } |
1325 | 1325 | ||
1326 | inode = f.file->f_path.dentry->d_inode; | 1326 | inode = file_inode(f.file); |
1327 | if (unlikely(f.file->f_op != &mqueue_file_operations)) { | 1327 | if (unlikely(f.file->f_op != &mqueue_file_operations)) { |
1328 | ret = -EBADF; | 1328 | ret = -EBADF; |
1329 | goto out_fput; | 1329 | goto out_fput; |
@@ -193,7 +193,7 @@ static void shm_destroy(struct ipc_namespace *ns, struct shmid_kernel *shp) | |||
193 | if (!is_file_hugepages(shp->shm_file)) | 193 | if (!is_file_hugepages(shp->shm_file)) |
194 | shmem_lock(shp->shm_file, 0, shp->mlock_user); | 194 | shmem_lock(shp->shm_file, 0, shp->mlock_user); |
195 | else if (shp->mlock_user) | 195 | else if (shp->mlock_user) |
196 | user_shm_unlock(shp->shm_file->f_path.dentry->d_inode->i_size, | 196 | user_shm_unlock(file_inode(shp->shm_file)->i_size, |
197 | shp->mlock_user); | 197 | shp->mlock_user); |
198 | fput (shp->shm_file); | 198 | fput (shp->shm_file); |
199 | security_shm_free(shp); | 199 | security_shm_free(shp); |
@@ -529,7 +529,7 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params) | |||
529 | * shmid gets reported as "inode#" in /proc/pid/maps. | 529 | * shmid gets reported as "inode#" in /proc/pid/maps. |
530 | * proc-ps tools use this. Changing this will break them. | 530 | * proc-ps tools use this. Changing this will break them. |
531 | */ | 531 | */ |
532 | file->f_dentry->d_inode->i_ino = shp->shm_perm.id; | 532 | file_inode(file)->i_ino = shp->shm_perm.id; |
533 | 533 | ||
534 | ns->shm_tot += numpages; | 534 | ns->shm_tot += numpages; |
535 | error = shp->shm_perm.id; | 535 | error = shp->shm_perm.id; |
@@ -678,7 +678,7 @@ static void shm_add_rss_swap(struct shmid_kernel *shp, | |||
678 | { | 678 | { |
679 | struct inode *inode; | 679 | struct inode *inode; |
680 | 680 | ||
681 | inode = shp->shm_file->f_path.dentry->d_inode; | 681 | inode = file_inode(shp->shm_file); |
682 | 682 | ||
683 | if (is_file_hugepages(shp->shm_file)) { | 683 | if (is_file_hugepages(shp->shm_file)) { |
684 | struct address_space *mapping = inode->i_mapping; | 684 | struct address_space *mapping = inode->i_mapping; |
@@ -1173,7 +1173,7 @@ SYSCALL_DEFINE1(shmdt, char __user *, shmaddr) | |||
1173 | (vma->vm_start - addr)/PAGE_SIZE == vma->vm_pgoff) { | 1173 | (vma->vm_start - addr)/PAGE_SIZE == vma->vm_pgoff) { |
1174 | 1174 | ||
1175 | 1175 | ||
1176 | size = vma->vm_file->f_path.dentry->d_inode->i_size; | 1176 | size = file_inode(vma->vm_file)->i_size; |
1177 | do_munmap(mm, vma->vm_start, vma->vm_end - vma->vm_start); | 1177 | do_munmap(mm, vma->vm_start, vma->vm_end - vma->vm_start); |
1178 | /* | 1178 | /* |
1179 | * We discovered the size of the shm segment, so | 1179 | * We discovered the size of the shm segment, so |