1 --- a/fs/mini_fo/main.c
2 +++ b/fs/mini_fo/main.c
4 * of the new inode's fields
7 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
9 * original: inode = iget(sb, hidden_inode->i_ino);
12 err = -EACCES; /* should be impossible??? */
16 + inode = mini_fo_iget(sb, iunique(sb, 25));
17 + if (IS_ERR(inode)) {
18 + err = PTR_ERR(inode);
24 * interpose the inode if not already interposed
26 hidden_root = ERR_PTR(err);
29 - hidden_root = nd.dentry;
30 - stopd(sb)->base_dir_dentry = nd.dentry;
31 - stopd(sb)->hidden_mnt = nd.mnt;
32 + hidden_root = nd_get_dentry(&nd);
33 + stopd(sb)->base_dir_dentry = nd_get_dentry(&nd);
34 + stopd(sb)->hidden_mnt = nd_get_mnt(&nd);
36 } else if(!strncmp("sto=", options, 4)) {
37 /* parse the storage dir */
39 hidden_root2 = ERR_PTR(err);
42 - hidden_root2 = nd2.dentry;
43 - stopd(sb)->storage_dir_dentry = nd2.dentry;
44 - stopd(sb)->hidden_mnt2 = nd2.mnt;
45 + hidden_root2 = nd_get_dentry(&nd2);
46 + stopd(sb)->storage_dir_dentry = nd_get_dentry(&nd2);
47 + stopd(sb)->hidden_mnt2 = nd_get_mnt(&nd2);
48 stohs2(sb) = hidden_root2->d_sb;
50 /* validate storage dir, this is done in
51 --- a/fs/mini_fo/mini_fo.h
52 +++ b/fs/mini_fo/mini_fo.h
54 extern int mini_fo_cp_cont(dentry_t *tgt_dentry, struct vfsmount *tgt_mnt,
55 dentry_t *src_dentry, struct vfsmount *src_mnt);
57 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25)
58 +extern struct inode *mini_fo_iget(struct super_block *sb, unsigned long ino);
61 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
62 extern int mini_fo_create(inode_t *dir, dentry_t *dentry, int mode, struct nameidata *nd);
65 #endif /* if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) */
66 #endif /* __KERNEL__ */
69 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25)
70 +static inline dentry_t *nd_get_dentry(struct nameidata *nd)
72 + return (nd->path.dentry);
75 +static inline struct vfsmount *nd_get_mnt(struct nameidata *nd)
77 + return (nd->path.mnt);
80 +static inline dentry_t *nd_get_dentry(struct nameidata *nd)
82 + return (nd->dentry);
85 +static inline struct vfsmount *nd_get_mnt(struct nameidata *nd)
92 * Definitions for user and kernel code
94 --- a/fs/mini_fo/super.c
95 +++ b/fs/mini_fo/super.c
100 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25)
102 +mini_fo_iget(struct super_block *sb, unsigned long ino)
104 + struct inode *inode;
106 + inode = iget_locked(sb, ino);
108 + return ERR_PTR(-ENOMEM);
110 + if (!(inode->i_state & I_NEW))
113 + mini_fo_read_inode(inode);
115 + unlock_new_inode(inode);
118 +#endif /* if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25) */
120 struct super_operations mini_fo_sops =
122 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
123 read_inode: mini_fo_read_inode,
125 #if defined(FIST_DEBUG) || defined(FIST_FILTER_SCA)
126 write_inode: mini_fo_write_inode,
127 #endif /* defined(FIST_DEBUG) || defined(FIST_FILTER_SCA) */
128 --- a/fs/mini_fo/aux.c
129 +++ b/fs/mini_fo/aux.c
130 @@ -164,11 +164,11 @@
131 err = vfs_path_lookup(mnt->mnt_root, mnt, bpath+1, 0, &nd);
134 - if (err || !nd.dentry || !nd.dentry->d_inode) {
135 + if (err || !nd_get_dentry(&nd) || !nd_get_dentry(&nd)->d_inode) {
136 printk(KERN_CRIT "mini_fo: bpath_walk: path_walk failed.\n");
140 + return nd_get_dentry(&nd);