[patch] inotify: more misc stuff

From: Robert Love
Date: Mon Oct 04 2004 - 14:00:15 EST


Really, really trivial bits.

Robert Love

Signed-Off-By: Robert Love <rml@xxxxxxxxxx>

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

diff -urN linux-inotify/drivers/char/inotify.c linux/drivers/char/inotify.c
--- linux-inotify/drivers/char/inotify.c 2004-10-04 14:23:58.282706352 -0400
+++ linux/drivers/char/inotify.c 2004-10-04 14:52:43.393449656 -0400
@@ -22,7 +22,6 @@
* use slab cache for inotify_inode_data structures
*/

-#include <linux/bitops.h>
#include <linux/bitmap.h>
#include <linux/module.h>
#include <linux/kernel.h>
@@ -33,11 +32,7 @@
#include <linux/namei.h>
#include <linux/poll.h>
#include <linux/miscdevice.h>
-#include <linux/device.h>
#include <linux/init.h>
-#include <linux/types.h>
-#include <linux/stddef.h>
-#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/writeback.h>
#include <linux/inotify.h>
@@ -353,7 +348,7 @@
* Caller must hold dev->lock.
*/
static void delete_watch(struct inotify_device *dev,
- struct inotify_watch *watch)
+ struct inotify_watch *watch)
{
inotify_dev_put_wd(dev, watch->wd);
iprintk(INOTIFY_DEBUG_ALLOC, "free'd watch %p\n", watch);
@@ -406,8 +401,13 @@
return 0;
}

+/*
+ * inotify_dev_add_watcher - add the given watcher to the given device instance
+ *
+ * Caller must hold dev->lock.
+ */
static int inotify_dev_add_watch(struct inotify_device *dev,
- struct inotify_watch *watch)
+ struct inotify_watch *watch)
{
if (!dev || !watch)
return -EINVAL;
@@ -428,7 +428,7 @@
* Caller must hold dev->lock because we call inotify_dev_queue_event().
*/
static int inotify_dev_rm_watch(struct inotify_device *dev,
- struct inotify_watch *watch)
+ struct inotify_watch *watch)
{
if (!watch)
return -EINVAL;
@@ -460,7 +460,7 @@
* Callers must hold dev->lock, because we call inode_find_dev().
*/
static int inode_add_watch(struct inode *inode,
- struct inotify_watch *watch)
+ struct inotify_watch *watch)
{
if (!inode || !watch || inode_find_dev(inode, watch->dev))
return -EINVAL;
@@ -483,7 +483,7 @@
}

static int inode_rm_watch(struct inode *inode,
- struct inotify_watch *watch)
+ struct inotify_watch *watch)
{
if (!inode || !watch || !inode->inotify_data)
return -EINVAL;
@@ -539,12 +539,12 @@
struct inotify_device *dev;
struct inode *inode;

- spin_lock(&watch->inode->i_lock);
- spin_lock(&watch->dev->lock);
-
inode = watch->inode;
dev = watch->dev;

+ spin_lock(&inode->i_lock);
+ spin_lock(&dev->lock);
+
if (event)
inotify_dev_queue_event(dev, watch, event, NULL);

@@ -588,7 +588,8 @@

spin_lock(&inode->i_lock);

- list_for_each_entry(watch, &inode->inotify_data->watches, i_list)
+ list_for_each_entry(watch, &inode->inotify_data->watches,
+ i_list)
list_add(&watch->u_list, umount);

spin_unlock(&inode->i_lock);