patch unionfs-port-odf-to-2-6-24-rc2.patch
authorErez Zadok <ezk@cs.sunysb.edu>
Sun, 18 Nov 2007 23:45:46 +0000 (18:45 -0500)
committerRachita Kothiyal <rachita@dewey.fsl.cs.sunysb.edu>
Thu, 1 May 2008 23:03:19 +0000 (19:03 -0400)
fs/exportfs/expfs.c
fs/unionfs/export.c
fs/unionfs/union.h
include/linux/exportfs.h

index 109ab5e44eca3f6d5961f721b582d137779c6265..9e861b2f19384aed420009527e66293394857dad 100644 (file)
@@ -22,8 +22,8 @@ static int get_name(struct vfsmount *mnt, struct dentry *dentry, char *name,
                struct dentry *child);
 
 
-static int exportfs_get_name(struct vfsmount *mnt, struct dentry *dir,
-               char *name, struct dentry *child)
+int exportfs_get_name(struct vfsmount *mnt, struct dentry *dir,
+                     char *name, struct dentry *child)
 {
        const struct export_operations *nop = dir->d_sb->s_export_op;
 
@@ -32,6 +32,7 @@ static int exportfs_get_name(struct vfsmount *mnt, struct dentry *dir,
        else
                return get_name(mnt, dir, name, child);
 }
+EXPORT_SYMBOL_GPL(exportfs_get_name);
 
 /*
  * Check if the dentry or any of it's aliases is acceptable.
index 44493e93e69143bf3dbc996786a6f2da6105f353..0e1db379adb9fa54a5f31052af88158a550c78f2 100644 (file)
@@ -14,8 +14,6 @@
 
 #define is_anon(d) ((d)->d_flags & DCACHE_DISCONNECTED)
 
-extern struct export_operations export_op_default;
-
 static struct dentry *__get_parent(struct super_block *sb,
                                   struct dentry *odf_dentry)
 {
@@ -99,10 +97,23 @@ static struct dentry *__get_parent(struct super_block *sb,
                                res = odf_root->d_sb->s_export_op->get_name(
                                        UNIONFS_D(parent)->odf.dentry,
                                        name, d);
-                       else
-                               res = export_op_default.get_name(
+                       else {
+                               res = exportfs_get_name(
+                                       NULL, /* NULL mnt is wrong! */
                                        UNIONFS_D(parent)->odf.dentry,
                                        name, d);
+                               BUG();
+                               /*
+                                * FIXME: we're passing a null mnt above,
+                                * which is wrong.  We need to pass a real
+                                * mnt.  But first, we need to change struct
+                                * odf_dentry_info so that it'll record a
+                                * struct path instead of just a dentry.
+                                * That struct path will include both a
+                                * dentry and mnt, which have to be dget/put
+                                * and mntget/put properly. -ezk
+                                */
+                       }
                }
                else
                        strncpy(name, d->d_name.name, d->d_name.len);
index f6bf4a3f15ce893c3a7b83896bc15ca4cad0a8a5..a2f12b9fd4f2f13411480e3d12709a3f8c108123 100644 (file)
@@ -46,6 +46,7 @@
 #include <linux/poison.h>
 #include <linux/mman.h>
 #include <linux/backing-dev.h>
+#include <linux/exportfs.h>
 
 #include <asm/system.h>
 
index 51d214138814a509803e22db093c8a9f91108227..33010f4eac2b8ee5dd76e94cea6228d67fe53046 100644 (file)
@@ -117,6 +117,8 @@ extern int exportfs_encode_fh(struct dentry *dentry, struct fid *fid,
 extern struct dentry *exportfs_decode_fh(struct vfsmount *mnt, struct fid *fid,
        int fh_len, int fileid_type, int (*acceptable)(void *, struct dentry *),
        void *context);
+extern int exportfs_get_name(struct vfsmount *mnt, struct dentry *dir,
+                            char *name, struct dentry *child);
 
 /*
  * Generic helpers for filesystems.