Revert "UBUNTU: ubuntu: AUFS -- track changes to the arguements to fop fsync()"
authorAndy Whitcroft <apw@canonical.com>
Sun, 7 Nov 2010 02:07:16 +0000 (02:07 +0000)
committerLeann Ogasawara <leann.ogasawara@canonical.com>
Mon, 28 Mar 2011 13:50:25 +0000 (06:50 -0700)
This reverts commit d4e9501eeeee43450c1675a1cd2724371db736e5.

Signed-off-by: Andy Whitcroft <apw@canonical.com>

ubuntu/aufs/dir.c
ubuntu/aufs/f_op.c

index 0c0b275..6ff01bc 100644 (file)
@@ -259,7 +259,6 @@ static int aufs_flush_dir(struct file *file, fl_owner_t id)
 
 /* ---------------------------------------------------------------------- */
 
-#if 0
 static int au_do_fsync_dir_no_file(struct dentry *dentry, int datasync)
 {
        int err;
@@ -304,7 +303,6 @@ static int au_do_fsync_dir_no_file(struct dentry *dentry, int datasync)
 
        return err;
 }
-#endif
 
 static int au_do_fsync_dir(struct file *file, int datasync)
 {
@@ -344,17 +342,11 @@ static int au_do_fsync_dir(struct file *file, int datasync)
 /*
  * @file may be NULL
  */
-static int aufs_fsync_dir(struct file *file, int datasync)
+static int aufs_fsync_dir(struct file *file, struct dentry *dentry,
+                         int datasync)
 {
        int err;
        struct super_block *sb;
-       struct dentry *dentry;
-
-       if (!file) {
-               WARN_ON(1);
-               return -ENOTSUPP;
-       }
-       dentry = file->f_dentry;
 
        IMustLock(dentry->d_inode);
 
@@ -363,12 +355,10 @@ static int aufs_fsync_dir(struct file *file, int datasync)
        si_noflush_read_lock(sb);
        if (file)
                err = au_do_fsync_dir(file, datasync);
-/*
        else {
                di_write_lock_child(dentry);
                err = au_do_fsync_dir_no_file(dentry, datasync);
        }
-*/
        au_cpup_attr_timesizes(dentry->d_inode);
        di_write_unlock(dentry);
        if (file)
index 81ccb83..18eaa81 100644 (file)
@@ -682,14 +682,14 @@ static int aufs_mmap(struct file *file, struct vm_area_struct *vma)
 
 /* ---------------------------------------------------------------------- */
 
-static int aufs_fsync_nondir(struct file *file, int datasync)
+static int aufs_fsync_nondir(struct file *file, struct dentry *dentry,
+                            int datasync)
 {
        int err;
        struct au_pin pin;
        struct inode *inode;
        struct file *h_file;
        struct super_block *sb;
-       struct dentry *dentry = file->f_dentry;
 
        inode = dentry->d_inode;
        IMustLock(file->f_mapping->host);
@@ -728,7 +728,7 @@ static int aufs_fsync_nondir(struct file *file, int datasync)
                h_d = h_file->f_dentry;
                h_mtx = &h_d->d_inode->i_mutex;
                mutex_lock_nested(h_mtx, AuLsc_I_CHILD);
-               err = h_file->f_op->fsync(h_file, datasync);
+               err = h_file->f_op->fsync(h_file, h_d, datasync);
                if (!err)
                        vfsub_update_h_iattr(&h_file->f_path, /*did*/NULL);
                /*ignore*/