aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/patches-2.6.33/210-mini_fo_2.6.25_fixes.patch
blob: d71e3b6faa6644c2337588f4b344cc5677419841 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15pre { line-height: 125%; margin: 0; }
td.linenos pre { color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px; }
span.linenos { color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px; }
td.linenos pre.special { color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight { background: #ffffff; }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #333333 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #666666 } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #008800 } /* Keyword.Pseudo */
.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */
.highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */
.highlight .na { color: #336699 } /* Name.Attribute */
.highlight .nb { color: #003388 } /* Name.Builtin */
.highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */
.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
.highlight .nd { color: #555555 } /* Name.Decorator */
.highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */
.highlight .nl { color: #336699; font-style: italic } /* Name.Label */
.highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */
.highlight .py { color: #336699; font-weight: bold } /* Name.Property */
.highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #336699 } /* Name.Variable */
.highlight .ow { color: #008800 } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */
.highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */
.highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */
.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
.highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */
.highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */
.highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */
.highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */
.highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */
.highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */
.highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */
.highlight .se { color: #0044dd; b
--- 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);
 }