ALSA: Revert "ALSA: snd-usb-caiaq: Set default input mode of A4DJ"
[safe/jmp/linux-2.6] / fs / adfs / dir.c
index 7b075fc..23aa52f 100644 (file)
@@ -9,16 +9,7 @@
  *
  *  Common directory handling for ADFS
  */
-#include <linux/config.h>
-#include <linux/errno.h>
-#include <linux/fs.h>
-#include <linux/adfs_fs.h>
-#include <linux/time.h>
-#include <linux/stat.h>
-#include <linux/spinlock.h>
 #include <linux/smp_lock.h>
-#include <linux/buffer_head.h>         /* for file_fsync() */
-
 #include "adfs.h"
 
 /*
@@ -29,7 +20,7 @@ static DEFINE_RWLOCK(adfs_dir_lock);
 static int
 adfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
 {
-       struct inode *inode = filp->f_dentry->d_inode;
+       struct inode *inode = filp->f_path.dentry->d_inode;
        struct super_block *sb = inode->i_sb;
        struct adfs_dir_ops *ops = ADFS_SB(sb)->s_dir;
        struct object_info obj;
@@ -84,7 +75,7 @@ out:
 }
 
 int
-adfs_dir_update(struct super_block *sb, struct object_info *obj)
+adfs_dir_update(struct super_block *sb, struct object_info *obj, int wait)
 {
        int ret = -EINVAL;
 #ifdef CONFIG_ADFS_FS_RW
@@ -107,6 +98,12 @@ adfs_dir_update(struct super_block *sb, struct object_info *obj)
        ret = ops->update(&dir, obj);
        write_unlock(&adfs_dir_lock);
 
+       if (wait) {
+               int err = ops->sync(&dir);
+               if (!ret)
+                       ret = err;
+       }
+
        ops->free(&dir);
 out:
 #endif
@@ -198,8 +195,9 @@ out:
 
 const struct file_operations adfs_dir_operations = {
        .read           = generic_read_dir,
+       .llseek         = generic_file_llseek,
        .readdir        = adfs_readdir,
-       .fsync          = file_fsync,
+       .fsync          = simple_fsync,
 };
 
 static int
@@ -263,7 +261,7 @@ adfs_compare(struct dentry *parent, struct qstr *entry, struct qstr *name)
        return 0;
 }
 
-struct dentry_operations adfs_dentry_operations = {
+const struct dentry_operations adfs_dentry_operations = {
        .d_hash         = adfs_hash,
        .d_compare      = adfs_compare,
 };
@@ -296,7 +294,7 @@ adfs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
 /*
  * directories can handle most operations...
  */
-struct inode_operations adfs_dir_inode_operations = {
+const struct inode_operations adfs_dir_inode_operations = {
        .lookup         = adfs_lookup,
        .setattr        = adfs_notify_change,
 };