diff options
Diffstat (limited to 'target/linux/generic-2.6/patches-2.6.31/210-mini_fo_2.6.25_fixes.patch')
-rw-r--r-- | target/linux/generic-2.6/patches-2.6.31/210-mini_fo_2.6.25_fixes.patch | 143 |
1 files changed, 143 insertions, 0 deletions
diff --git a/target/linux/generic-2.6/patches-2.6.31/210-mini_fo_2.6.25_fixes.patch b/target/linux/generic-2.6/patches-2.6.31/210-mini_fo_2.6.25_fixes.patch new file mode 100644 index 0000000000..d71e3b6faa --- /dev/null +++ b/target/linux/generic-2.6/patches-2.6.31/210-mini_fo_2.6.25_fixes.patch @@ -0,0 +1,143 @@ +--- a/fs/mini_fo/main.c ++++ b/fs/mini_fo/main.c +@@ -79,6 +79,7 @@ mini_fo_tri_interpose(dentry_t *hidden_d + * of the new inode's fields + */ + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25) + /* + * original: inode = iget(sb, hidden_inode->i_ino); + */ +@@ -87,6 +88,13 @@ mini_fo_tri_interpose(dentry_t *hidden_d + err = -EACCES; /* should be impossible??? */ + goto out; + } ++#else ++ inode = mini_fo_iget(sb, iunique(sb, 25)); ++ if (IS_ERR(inode)) { ++ err = PTR_ERR(inode); ++ goto out; ++ } ++#endif + + /* + * interpose the inode if not already interposed +@@ -184,9 +192,9 @@ mini_fo_parse_options(super_block_t *sb, + hidden_root = ERR_PTR(err); + goto out; + } +- hidden_root = nd.dentry; +- stopd(sb)->base_dir_dentry = nd.dentry; +- stopd(sb)->hidden_mnt = nd.mnt; ++ hidden_root = nd_get_dentry(&nd); ++ stopd(sb)->base_dir_dentry = nd_get_dentry(&nd); ++ stopd(sb)->hidden_mnt = nd_get_mnt(&nd); + + } else if(!strncmp("sto=", options, 4)) { + /* parse the storage dir */ +@@ -204,9 +212,9 @@ mini_fo_parse_options(super_block_t *sb, + hidden_root2 = ERR_PTR(err); + goto out; + } +- hidden_root2 = nd2.dentry; +- stopd(sb)->storage_dir_dentry = nd2.dentry; +- stopd(sb)->hidden_mnt2 = nd2.mnt; ++ hidden_root2 = nd_get_dentry(&nd2); ++ stopd(sb)->storage_dir_dentry = nd_get_dentry(&nd2); ++ stopd(sb)->hidden_mnt2 = nd_get_mnt(&nd2); + stohs2(sb) = hidden_root2->d_sb; + + /* validate storage dir, this is done in +--- a/fs/mini_fo/mini_fo.h ++++ b/fs/mini_fo/mini_fo.h +@@ -302,6 +302,10 @@ extern int mini_fo_tri_interpose(dentry_ + extern int mini_fo_cp_cont(dentry_t *tgt_dentry, struct vfsmount *tgt_mnt, + dentry_t *src_dentry, struct vfsmount *src_mnt); + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25) ++extern struct inode *mini_fo_iget(struct super_block *sb, unsigned long ino); ++#endif ++ + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) + extern int mini_fo_create(inode_t *dir, dentry_t *dentry, int mode, struct nameidata *nd); + +@@ -501,6 +505,29 @@ static inline void double_unlock(struct + #endif /* if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) */ + #endif /* __KERNEL__ */ + ++ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25) ++static inline dentry_t *nd_get_dentry(struct nameidata *nd) ++{ ++ return (nd->path.dentry); ++} ++ ++static inline struct vfsmount *nd_get_mnt(struct nameidata *nd) ++{ ++ return (nd->path.mnt); ++} ++#else ++static inline dentry_t *nd_get_dentry(struct nameidata *nd) ++{ ++ return (nd->dentry); ++} ++ ++static inline struct vfsmount *nd_get_mnt(struct nameidata *nd) ++{ ++ return (nd->mnt); ++} ++#endif ++ + /* + * Definitions for user and kernel code + */ +--- a/fs/mini_fo/super.c ++++ b/fs/mini_fo/super.c +@@ -262,10 +262,31 @@ mini_fo_umount_begin(super_block_t *sb) + } + #endif + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25) ++struct inode * ++mini_fo_iget(struct super_block *sb, unsigned long ino) ++{ ++ struct inode *inode; ++ ++ inode = iget_locked(sb, ino); ++ if (!inode) ++ return ERR_PTR(-ENOMEM); ++ ++ if (!(inode->i_state & I_NEW)) ++ return inode; ++ ++ mini_fo_read_inode(inode); ++ ++ unlock_new_inode(inode); ++ return inode; ++} ++#endif /* if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25) */ + + struct super_operations mini_fo_sops = + { ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25) + read_inode: mini_fo_read_inode, ++#endif + #if defined(FIST_DEBUG) || defined(FIST_FILTER_SCA) + write_inode: mini_fo_write_inode, + #endif /* defined(FIST_DEBUG) || defined(FIST_FILTER_SCA) */ +--- a/fs/mini_fo/aux.c ++++ b/fs/mini_fo/aux.c +@@ -164,11 +164,11 @@ dentry_t *bpath_walk(super_block_t *sb, + err = vfs_path_lookup(mnt->mnt_root, mnt, bpath+1, 0, &nd); + + /* validate */ +- if (err || !nd.dentry || !nd.dentry->d_inode) { ++ if (err || !nd_get_dentry(&nd) || !nd_get_dentry(&nd)->d_inode) { + printk(KERN_CRIT "mini_fo: bpath_walk: path_walk failed.\n"); + return NULL; + } +- return nd.dentry; ++ return nd_get_dentry(&nd); + } + + |