1 Index: linux-2.6.25.4/fs/mini_fo/main.c
2 ===================================================================
3 --- linux-2.6.25.4.orig/fs/mini_fo/main.c
4 +++ linux-2.6.25.4/fs/mini_fo/main.c
5 @@ -79,6 +79,7 @@ mini_fo_tri_interpose(dentry_t *hidden_d
6 * of the new inode's fields
9 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
11 * original: inode = iget(sb, hidden_inode->i_ino);
13 @@ -87,6 +88,13 @@ mini_fo_tri_interpose(dentry_t *hidden_d
14 err = -EACCES; /* should be impossible??? */
18 + inode = mini_fo_iget(sb, iunique(sb, 25));
19 + if (IS_ERR(inode)) {
20 + err = PTR_ERR(inode);
26 * interpose the inode if not already interposed
27 @@ -184,9 +192,9 @@ mini_fo_parse_options(super_block_t *sb,
28 hidden_root = ERR_PTR(err);
31 - hidden_root = nd.dentry;
32 - stopd(sb)->base_dir_dentry = nd.dentry;
33 - stopd(sb)->hidden_mnt = nd.mnt;
34 + hidden_root = nd_get_dentry(&nd);
35 + stopd(sb)->base_dir_dentry = nd_get_dentry(&nd);
36 + stopd(sb)->hidden_mnt = nd_get_mnt(&nd);
38 } else if(!strncmp("sto=", options, 4)) {
39 /* parse the storage dir */
40 @@ -204,9 +212,9 @@ mini_fo_parse_options(super_block_t *sb,
41 hidden_root2 = ERR_PTR(err);
44 - hidden_root2 = nd2.dentry;
45 - stopd(sb)->storage_dir_dentry = nd2.dentry;
46 - stopd(sb)->hidden_mnt2 = nd2.mnt;
47 + hidden_root2 = nd_get_dentry(&nd2);
48 + stopd(sb)->storage_dir_dentry = nd_get_dentry(&nd2);
49 + stopd(sb)->hidden_mnt2 = nd_get_mnt(&nd2);
50 stohs2(sb) = hidden_root2->d_sb;
52 /* validate storage dir, this is done in
53 Index: linux-2.6.25.4/fs/mini_fo/mini_fo.h
54 ===================================================================
55 --- linux-2.6.25.4.orig/fs/mini_fo/mini_fo.h
56 +++ linux-2.6.25.4/fs/mini_fo/mini_fo.h
57 @@ -302,6 +302,10 @@ extern int mini_fo_tri_interpose(dentry_
58 extern int mini_fo_cp_cont(dentry_t *tgt_dentry, struct vfsmount *tgt_mnt,
59 dentry_t *src_dentry, struct vfsmount *src_mnt);
61 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25)
62 +extern struct inode *mini_fo_iget(struct super_block *sb, unsigned long ino);
65 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
66 extern int mini_fo_create(inode_t *dir, dentry_t *dentry, int mode, struct nameidata *nd);
68 @@ -501,6 +505,29 @@ static inline void double_unlock(struct
69 #endif /* if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) */
70 #endif /* __KERNEL__ */
73 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25)
74 +static inline dentry_t *nd_get_dentry(struct nameidata *nd)
76 + return (nd->path.dentry);
79 +static inline struct vfsmount *nd_get_mnt(struct nameidata *nd)
81 + return (nd->path.mnt);
84 +static inline dentry_t *nd_get_dentry(struct nameidata *nd)
86 + return (nd->dentry);
89 +static inline struct vfsmount *nd_get_mnt(struct nameidata *nd)
96 * Definitions for user and kernel code
98 Index: linux-2.6.25.4/fs/mini_fo/super.c
99 ===================================================================
100 --- linux-2.6.25.4.orig/fs/mini_fo/super.c
101 +++ linux-2.6.25.4/fs/mini_fo/super.c
102 @@ -262,10 +262,31 @@ mini_fo_umount_begin(super_block_t *sb)
106 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25)
108 +mini_fo_iget(struct super_block *sb, unsigned long ino)
110 + struct inode *inode;
112 + inode = iget_locked(sb, ino);
114 + return ERR_PTR(-ENOMEM);
116 + if (!(inode->i_state & I_NEW))
119 + mini_fo_read_inode(inode);
121 + unlock_new_inode(inode);
124 +#endif /* if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25) */
126 struct super_operations mini_fo_sops =
128 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
129 read_inode: mini_fo_read_inode,
131 #if defined(FIST_DEBUG) || defined(FIST_FILTER_SCA)
132 write_inode: mini_fo_write_inode,
133 #endif /* defined(FIST_DEBUG) || defined(FIST_FILTER_SCA) */
134 Index: linux-2.6.25.4/fs/mini_fo/aux.c
135 ===================================================================
136 --- linux-2.6.25.4.orig/fs/mini_fo/aux.c
137 +++ linux-2.6.25.4/fs/mini_fo/aux.c
138 @@ -164,11 +164,11 @@ dentry_t *bpath_walk(super_block_t *sb,
139 err = vfs_path_lookup(mnt->mnt_root, mnt, bpath+1, 0, &nd);
142 - if (err || !nd.dentry || !nd.dentry->d_inode) {
143 + if (err || !nd_get_dentry(&nd) || !nd_get_dentry(&nd)->d_inode) {
144 printk(KERN_CRIT "mini_fo: bpath_walk: path_walk failed.\n");
148 + return nd_get_dentry(&nd);