lkml.org 
[lkml]   [2004]   [Sep]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[patch] inotify: don't check private_data
From
Date
On Sun, 2004-09-26 at 22:02 -0400, John McCutchan wrote:

> Announcing the release of inotify 0.10.0.
> Attached is a patch to 2.6.8.1.

Hey, John.

Any reason we check file->private_data in inotify_release()?

I don't think there is. Following patch removes the check.

Robert Love

No need to check file->private_data

Signed-Off-By: Robert Love <rml@novell.com>

drivers/char/inotify.c | 14 ++++++--------
1 files changed, 6 insertions(+), 8 deletions(-)

diff -urN linux-inotify/drivers/char/inotify.c linux/drivers/char/inotify.c
--- linux-inotify/drivers/char/inotify.c 2004-09-27 16:28:27.989505320 -0400
+++ linux/drivers/char/inotify.c 2004-09-27 16:34:58.269173792 -0400
@@ -822,15 +822,13 @@

static int inotify_release(struct inode *inode, struct file *file)
{
- if (file->private_data) {
- struct inotify_device *dev;
+ struct inotify_device *dev;

- dev = file->private_data;
- del_timer_sync(&dev->timer);
- inotify_release_all_watchers(dev);
- inotify_release_all_events(dev);
- kfree(dev);
- }
+ dev = file->private_data;
+ del_timer_sync(&dev->timer);
+ inotify_release_all_watchers(dev);
+ inotify_release_all_events(dev);
+ kfree(dev);

printk(KERN_ALERT "inotify device released\n");
\
 
 \ /
  Last update: 2005-03-22 14:06    [W:0.152 / U:8.948 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site