UBUNTU: ubuntu: AUFS -- track changes to the arguements to fop fsync()
authorAndy Whitcroft <apw@canonical.com>
Thu, 3 Jun 2010 07:40:41 +0000 (08:40 +0100)
committerLeann Ogasawara <leann.ogasawara@canonical.com>
Mon, 28 Mar 2011 13:48:45 +0000 (06:48 -0700)
The file operation fsync dropped an unused struct dentry parameter,
apply this change to aufs2:

  commit 7ea8085910ef3dd4f3cad6845aaa2b580d39b115
  Author: Christoph Hellwig <hch@lst.de>
  Date:   Wed May 26 17:53:25 2010 +0200

    drop unused dentry argument to ->fsync

WARNING: this currently removes support for syncing some forms of aufs
directory as we are now required to have a filp to sync against and aufs
does not always have them.  I have added a WARN_ON to try and track the
triggers for this mode if any.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Leann Ogasawara <leann.ogasawara@canonical.com>

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

index 6ff01bc..0c0b275 100644 (file)
@@ -259,6 +259,7 @@ 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;
@@ -303,6 +304,7 @@ 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)
 {
@@ -342,11 +344,17 @@ static int au_do_fsync_dir(struct file *file, int datasync)
 /*
  * @file may be NULL
  */
-static int aufs_fsync_dir(struct file *file, struct dentry *dentry,
-                         int datasync)
+static int aufs_fsync_dir(struct file *file, 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);
 
@@ -355,10 +363,12 @@ static int aufs_fsync_dir(struct file *file, struct dentry *dentry,
        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 18eaa81..81ccb83 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, struct dentry *dentry,
-                            int datasync)
+static int aufs_fsync_nondir(struct file *file, 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, struct dentry *dentry,
                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, h_d, datasync);
+               err = h_file->f_op->fsync(h_file, datasync);
                if (!err)
                        vfsub_update_h_iattr(&h_file->f_path, /*did*/NULL);
                /*ignore*/