From: Erez Zadok Date: Sun, 18 Nov 2007 23:45:46 +0000 (-0500) Subject: patch unionfs-port-odf-to-2-6-24-rc2.patch X-Git-Url: https://git.fsl.cs.stonybrook.edu/?a=commitdiff_plain;h=461fa30e22dfdf90ff019bd925f17586f47c85dc;p=unionfs-odf.git patch unionfs-port-odf-to-2-6-24-rc2.patch --- diff --git a/fs/exportfs/expfs.c b/fs/exportfs/expfs.c index 109ab5e44e..9e861b2f19 100644 --- a/fs/exportfs/expfs.c +++ b/fs/exportfs/expfs.c @@ -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. diff --git a/fs/unionfs/export.c b/fs/unionfs/export.c index 44493e93e6..0e1db379ad 100644 --- a/fs/unionfs/export.c +++ b/fs/unionfs/export.c @@ -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); diff --git a/fs/unionfs/union.h b/fs/unionfs/union.h index f6bf4a3f15..a2f12b9fd4 100644 --- a/fs/unionfs/union.h +++ b/fs/unionfs/union.h @@ -46,6 +46,7 @@ #include #include #include +#include #include diff --git a/include/linux/exportfs.h b/include/linux/exportfs.h index 51d2141388..33010f4eac 100644 --- a/include/linux/exportfs.h +++ b/include/linux/exportfs.h @@ -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.