login
Header Space

 
 

Re: [PATCH 2/4] XFS: add op_flags field and helpers to xfs_da_args

Previous thread: [PATCH 1/4] XFS: Name operation vector for hash and compare by Barry Naujok on Tuesday, May 13, 2008 - 3:57 am. (2 messages)

Next thread: [PATCH 3/4] XFS: Return case-insensitive match for dentry cache by Barry Naujok on Tuesday, May 13, 2008 - 3:57 am. (13 messages)
To: <xfs@...>
Cc: <linux-fsdevel@...>
Date: Tuesday, May 13, 2008 - 3:57 am

The end of the xfs_da_args structure has 4 unsigned char fields for 
true/false information on directory and attr operations using the
xfs_da_args structure.

The following converts these 4 into a op_flags field that uses the
first 4 bits for these fields and allows expansion for future 
operation information (eg. case-insensitive lookup request).

There is also a bit of EOL whitespace cleanup too.

Signed-off-by: Barry Naujok &lt;bnaujok@sgi.com&gt;

---
 fs/xfs/xfs_attr.c       |   11 ++++------
 fs/xfs/xfs_attr_leaf.c  |   52 ++++++++++++++++++++++++------------------------
 fs/xfs/xfs_da_btree.c   |    2 -
 fs/xfs/xfs_da_btree.h   |   33 ++++++++++++++++++++++++++----
 fs/xfs/xfs_dir2.c       |   12 +++++------
 fs/xfs/xfs_dir2_block.c |   10 ++++-----
 fs/xfs/xfs_dir2_leaf.c  |    6 ++---
 fs/xfs/xfs_dir2_node.c  |   15 +++++++------
 fs/xfs/xfs_dir2_sf.c    |    8 +++----
 fs/xfs/xfs_dir2_trace.c |   19 +++++++++--------
 fs/xfs/xfsidbg.c        |   13 ++++++------
 11 files changed, 105 insertions(+), 76 deletions(-)

Index: kern_ci/fs/xfs/xfs_attr.c
===================================================================
--- kern_ci.orig/fs/xfs/xfs_attr.c
+++ kern_ci/fs/xfs/xfs_attr.c
@@ -241,8 +241,7 @@ xfs_attr_set_int(xfs_inode_t *dp, struct
 	args.firstblock = &amp;firstblock;
 	args.flist = &amp;flist;
 	args.whichfork = XFS_ATTR_FORK;
-	args.addname = 1;
-	args.oknoent = 1;
+	args.op_flags = XFS_DA_OP_ADDNAME | XFS_DA_OP_OKNOENT;
 
 	/*
 	 * Determine space new attribute will use, and if it would be
@@ -974,7 +973,7 @@ xfs_attr_leaf_addname(xfs_da_args_t *arg
 			xfs_da_brelse(args-&gt;trans, bp);
 			return(retval);
 		}
-		args-&gt;rename = 1;			/* an atomic rename */
+		args-&gt;op_flags |= XFS_DA_OP_RENAME;	/* an atomic rename */
 		args-&gt;blkno2 = args-&gt;blkno;		/* set 2nd entry info*/
 		args-&gt;index2 = args-&gt;index;
 		args-&gt;rmtblkno2 = args-&gt;rmtblkno;
@@ -1054,7 +1053,7 @@ xfs_attr_leaf_addname(xfs_da_args_t *arg
 	 * so that one dis...
To: Barry Naujok <bnaujok@...>
Cc: <xfs@...>, <linux-fsdevel@...>
Date: Tuesday, May 13, 2008 - 4:34 am

Looks generally good to me.  A few stylistic comments:

 - I don't think the xfs_da_is*_op wrappers help readability, we'd
   be better off without those.
 - op_flags seems like a rather odd name to me, what about
   lookup_flags instead?


And the hinks below are an awfull lot of random reformatting that don't
belong into this patch.  As they're sensible what about just commiting
--
To: Christoph Hellwig <hch@...>
Cc: <xfs@...>, <linux-fsdevel@...>
Date: Wednesday, May 14, 2008 - 2:12 am

On Tue, 13 May 2008 18:34:58 +1000, Christoph Hellwig &lt;hch@infradead.org&gt;  





--
Previous thread: [PATCH 1/4] XFS: Name operation vector for hash and compare by Barry Naujok on Tuesday, May 13, 2008 - 3:57 am. (2 messages)

Next thread: [PATCH 3/4] XFS: Return case-insensitive match for dentry cache by Barry Naujok on Tuesday, May 13, 2008 - 3:57 am. (13 messages)
speck-geostationary