aboutsummaryrefslogtreecommitdiffstats
path: root/fs/sysfs/sysfs.h
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-06-13 14:45:17 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-07-11 19:09:07 -0400
commit8312a8d7c1d19d31027bd4ca127ce671962c23d4 (patch)
treeee28a44611ac2192b265f5f85a74f7da98d2fdef /fs/sysfs/sysfs.h
parentfc9f54b9982e14e6dbe023425c87ffbfd6992c45 (diff)
sysfs: use iget_locked() instead of new_inode()
After dentry is reclaimed, sysfs always used to allocate new dentry and inode if the file is accessed again. This causes problem with operations which only pin the inode. For example, if inotify watch is added to a sysfs file and the dentry for the file is reclaimed, the next update event creates new dentry and new inode making the inotify watch miss all the events from there on. This patch fixes it by using iget_locked() instead of new_inode(). sysfs_new_inode() is renamed to sysfs_get_inode() and inode is initialized iff the inode is newly allocated. sysfs_instantiate() is responsible for unlocking new inodes. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs/sysfs/sysfs.h')
-rw-r--r--fs/sysfs/sysfs.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/sysfs/sysfs.h b/fs/sysfs/sysfs.h
index 143fdbe56c14..627bf3940dfa 100644
--- a/fs/sysfs/sysfs.h
+++ b/fs/sysfs/sysfs.h
@@ -58,7 +58,7 @@ extern struct kmem_cache *sysfs_dir_cachep;
58 58
59extern void sysfs_delete_inode(struct inode *inode); 59extern void sysfs_delete_inode(struct inode *inode);
60extern void sysfs_init_inode(struct sysfs_dirent *sd, struct inode *inode); 60extern void sysfs_init_inode(struct sysfs_dirent *sd, struct inode *inode);
61extern struct inode * sysfs_new_inode(struct sysfs_dirent *sd); 61extern struct inode * sysfs_get_inode(struct sysfs_dirent *sd);
62extern void sysfs_instantiate(struct dentry *dentry, struct inode *inode); 62extern void sysfs_instantiate(struct dentry *dentry, struct inode *inode);
63 63
64extern void release_sysfs_dirent(struct sysfs_dirent * sd); 64extern void release_sysfs_dirent(struct sysfs_dirent * sd);