]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - fs/sysfs/file.c
Merge with /shiny/git/linux-2.6/.git
[karo-tx-linux.git] / fs / sysfs / file.c
index 849aac115460812ff419898c45346b353da9bb5c..335288b9be0f1301c42838b98d760ca0c33c4344 100644 (file)
@@ -3,8 +3,9 @@
  */
 
 #include <linux/module.h>
-#include <linux/dnotify.h>
+#include <linux/fsnotify.h>
 #include <linux/kobject.h>
+#include <linux/namei.h>
 #include <asm/uaccess.h>
 #include <asm/semaphore.h>
 
@@ -13,7 +14,7 @@
 #define to_subsys(k) container_of(k,struct subsystem,kset.kobj)
 #define to_sattr(a) container_of(a,struct subsys_attribute,attr)
 
-/**
+/*
  * Subsystem file operations.
  * These operations allow subsystems to have files that can be 
  * read/written. 
@@ -191,8 +192,9 @@ fill_write_buffer(struct sysfs_buffer * buffer, const char __user * buf, size_t
 
 /**
  *     flush_write_buffer - push buffer to kobject.
- *     @file:          file pointer.
+ *     @dentry:        dentry to the attribute
  *     @buffer:        data buffer for file.
+ *     @count:         number of bytes
  *
  *     Get the correct pointers for the kobject and the attribute we're
  *     dealing with, then call the store() method for the attribute, 
@@ -389,9 +391,6 @@ int sysfs_create_file(struct kobject * kobj, const struct attribute * attr)
  * sysfs_update_file - update the modified timestamp on an object attribute.
  * @kobj: object we're acting for.
  * @attr: attribute descriptor.
- *
- * Also call dnotify for the dentry, which lots of userspace programs
- * use.
  */
 int sysfs_update_file(struct kobject * kobj, const struct attribute * attr)
 {
@@ -400,13 +399,13 @@ int sysfs_update_file(struct kobject * kobj, const struct attribute * attr)
        int res = -ENOENT;
 
        down(&dir->d_inode->i_sem);
-       victim = sysfs_get_dentry(dir, attr->name);
+       victim = lookup_one_len(attr->name, dir, strlen(attr->name));
        if (!IS_ERR(victim)) {
                /* make sure dentry is really there */
                if (victim->d_inode && 
                    (victim->d_parent->d_inode == dir->d_inode)) {
                        victim->d_inode->i_mtime = CURRENT_TIME;
-                       dnotify_parent(victim, DN_MODIFY);
+                       fsnotify_modify(victim);
 
                        /**
                         * Drop reference from initial sysfs_get_dentry().
@@ -443,7 +442,7 @@ int sysfs_chmod_file(struct kobject *kobj, struct attribute *attr, mode_t mode)
        int res = -ENOENT;
 
        down(&dir->d_inode->i_sem);
-       victim = sysfs_get_dentry(dir, attr->name);
+       victim = lookup_one_len(attr->name, dir, strlen(attr->name));
        if (!IS_ERR(victim)) {
                if (victim->d_inode &&
                    (victim->d_parent->d_inode == dir->d_inode)) {