tree becd1efe5e2c0951706333673808542804c508ed
parent b680716ed28baf549f777fb125fc23ba975985c5
author Robert Love <[EMAIL PROTECTED]> Mon, 25 Jul 2005 23:08:37 -0400
committer Linus Torvalds <[EMAIL PROTECTED]> Wed, 27 Jul 2005 03:31:57 -0700
[PATCH] inotify: use fget_light
As an optimization, use fget_light() and fput_light() where possible.
Signed-off-by: Robert Love <[EMAIL PROTECTED]>
Signed-off-by: John McCutchan <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
fs/inotify.c | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/fs/inotify.c b/fs/inotify.c
--- a/fs/inotify.c
+++ b/fs/inotify.c
@@ -923,10 +923,10 @@ asmlinkage long sys_inotify_add_watch(in
struct inotify_device *dev;
struct nameidata nd;
struct file *filp;
- int ret;
+ int ret, fput_needed;
- filp = fget(fd);
- if (!filp)
+ filp = fget_light(fd, &fput_needed);
+ if (unlikely(!filp))
return -EBADF;
ret = find_inode(path, &nd);
@@ -973,7 +973,7 @@ out:
up(&dev->sem);
up(&inode->inotify_sem);
fput_and_out:
- fput(filp);
+ fput_light(filp, fput_needed);
return ret;
}
@@ -981,14 +981,14 @@ asmlinkage long sys_inotify_rm_watch(int
{
struct file *filp;
struct inotify_device *dev;
- int ret;
+ int ret, fput_needed;
- filp = fget(fd);
- if (!filp)
+ filp = fget_light(fd, &fput_needed);
+ if (unlikely(!filp))
return -EBADF;
dev = filp->private_data;
ret = inotify_ignore(dev, wd);
- fput(filp);
+ fput_light(filp, fput_needed);
return ret;
}
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html