diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-08-28 12:52:22 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-09-26 22:20:08 -0400 |
commit | 2903ff019b346ab8d36ebbf54853c3aaf6590608 (patch) | |
tree | 962d94054765bb37bc00e977c3036e65c5fd91fe /fs/notify/inotify/inotify_user.c | |
parent | a5b470ba06aa3f96999ede5feba178df6bdb134a (diff) |
switch simple cases of fget_light to fdget
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/notify/inotify/inotify_user.c')
-rw-r--r-- | fs/notify/inotify/inotify_user.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c index 8445fbc8985c..c311dda054a3 100644 --- a/fs/notify/inotify/inotify_user.c +++ b/fs/notify/inotify/inotify_user.c | |||
@@ -757,16 +757,16 @@ SYSCALL_DEFINE3(inotify_add_watch, int, fd, const char __user *, pathname, | |||
757 | struct fsnotify_group *group; | 757 | struct fsnotify_group *group; |
758 | struct inode *inode; | 758 | struct inode *inode; |
759 | struct path path; | 759 | struct path path; |
760 | struct file *filp; | 760 | struct fd f; |
761 | int ret, fput_needed; | 761 | int ret; |
762 | unsigned flags = 0; | 762 | unsigned flags = 0; |
763 | 763 | ||
764 | filp = fget_light(fd, &fput_needed); | 764 | f = fdget(fd); |
765 | if (unlikely(!filp)) | 765 | if (unlikely(!f.file)) |
766 | return -EBADF; | 766 | return -EBADF; |
767 | 767 | ||
768 | /* verify that this is indeed an inotify instance */ | 768 | /* verify that this is indeed an inotify instance */ |
769 | if (unlikely(filp->f_op != &inotify_fops)) { | 769 | if (unlikely(f.file->f_op != &inotify_fops)) { |
770 | ret = -EINVAL; | 770 | ret = -EINVAL; |
771 | goto fput_and_out; | 771 | goto fput_and_out; |
772 | } | 772 | } |
@@ -782,13 +782,13 @@ SYSCALL_DEFINE3(inotify_add_watch, int, fd, const char __user *, pathname, | |||
782 | 782 | ||
783 | /* inode held in place by reference to path; group by fget on fd */ | 783 | /* inode held in place by reference to path; group by fget on fd */ |
784 | inode = path.dentry->d_inode; | 784 | inode = path.dentry->d_inode; |
785 | group = filp->private_data; | 785 | group = f.file->private_data; |
786 | 786 | ||
787 | /* create/update an inode mark */ | 787 | /* create/update an inode mark */ |
788 | ret = inotify_update_watch(group, inode, mask); | 788 | ret = inotify_update_watch(group, inode, mask); |
789 | path_put(&path); | 789 | path_put(&path); |
790 | fput_and_out: | 790 | fput_and_out: |
791 | fput_light(filp, fput_needed); | 791 | fdput(f); |
792 | return ret; | 792 | return ret; |
793 | } | 793 | } |
794 | 794 | ||
@@ -796,19 +796,19 @@ SYSCALL_DEFINE2(inotify_rm_watch, int, fd, __s32, wd) | |||
796 | { | 796 | { |
797 | struct fsnotify_group *group; | 797 | struct fsnotify_group *group; |
798 | struct inotify_inode_mark *i_mark; | 798 | struct inotify_inode_mark *i_mark; |
799 | struct file *filp; | 799 | struct fd f; |
800 | int ret = 0, fput_needed; | 800 | int ret = 0; |
801 | 801 | ||
802 | filp = fget_light(fd, &fput_needed); | 802 | f = fdget(fd); |
803 | if (unlikely(!filp)) | 803 | if (unlikely(!f.file)) |
804 | return -EBADF; | 804 | return -EBADF; |
805 | 805 | ||
806 | /* verify that this is indeed an inotify instance */ | 806 | /* verify that this is indeed an inotify instance */ |
807 | ret = -EINVAL; | 807 | ret = -EINVAL; |
808 | if (unlikely(filp->f_op != &inotify_fops)) | 808 | if (unlikely(f.file->f_op != &inotify_fops)) |
809 | goto out; | 809 | goto out; |
810 | 810 | ||
811 | group = filp->private_data; | 811 | group = f.file->private_data; |
812 | 812 | ||
813 | ret = -EINVAL; | 813 | ret = -EINVAL; |
814 | i_mark = inotify_idr_find(group, wd); | 814 | i_mark = inotify_idr_find(group, wd); |
@@ -823,7 +823,7 @@ SYSCALL_DEFINE2(inotify_rm_watch, int, fd, __s32, wd) | |||
823 | fsnotify_put_mark(&i_mark->fsn_mark); | 823 | fsnotify_put_mark(&i_mark->fsn_mark); |
824 | 824 | ||
825 | out: | 825 | out: |
826 | fput_light(filp, fput_needed); | 826 | fdput(f); |
827 | return ret; | 827 | return ret; |
828 | } | 828 | } |
829 | 829 | ||