diff options
author | Barry Naujok <bnaujok@sgi.com> | 2008-05-21 02:42:05 -0400 |
---|---|---|
committer | Niv Sardi <xaiki@debian.org> | 2008-07-28 02:58:37 -0400 |
commit | 6a178100abf01282eb697ab62b6086b2886dfc00 (patch) | |
tree | 5830f1257fc9662c0f9dcd107eda5377de716a4c /fs/xfs/xfs_attr.c | |
parent | 5163f95a08cbf058ae16452c2242c5600fedc32e (diff) |
[XFS] Add op_flags field and helpers to xfs_da_args
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).
SGI-PV: 981520
SGI-Modid: xfs-linux-melb:xfs-kern:31206a
Signed-off-by: Barry Naujok <bnaujok@sgi.com>
Signed-off-by: Christoph Hellwig <hch@infradead.org>
Diffstat (limited to 'fs/xfs/xfs_attr.c')
-rw-r--r-- | fs/xfs/xfs_attr.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/xfs/xfs_attr.c b/fs/xfs/xfs_attr.c index 5e5dbe62b194..557dad611de0 100644 --- a/fs/xfs/xfs_attr.c +++ b/fs/xfs/xfs_attr.c | |||
@@ -241,8 +241,7 @@ xfs_attr_set_int(xfs_inode_t *dp, struct xfs_name *name, | |||
241 | args.firstblock = &firstblock; | 241 | args.firstblock = &firstblock; |
242 | args.flist = &flist; | 242 | args.flist = &flist; |
243 | args.whichfork = XFS_ATTR_FORK; | 243 | args.whichfork = XFS_ATTR_FORK; |
244 | args.addname = 1; | 244 | args.op_flags = XFS_DA_OP_ADDNAME | XFS_DA_OP_OKNOENT; |
245 | args.oknoent = 1; | ||
246 | 245 | ||
247 | /* | 246 | /* |
248 | * Determine space new attribute will use, and if it would be | 247 | * Determine space new attribute will use, and if it would be |
@@ -974,7 +973,7 @@ xfs_attr_leaf_addname(xfs_da_args_t *args) | |||
974 | xfs_da_brelse(args->trans, bp); | 973 | xfs_da_brelse(args->trans, bp); |
975 | return(retval); | 974 | return(retval); |
976 | } | 975 | } |
977 | args->rename = 1; /* an atomic rename */ | 976 | args->op_flags |= XFS_DA_OP_RENAME; /* an atomic rename */ |
978 | args->blkno2 = args->blkno; /* set 2nd entry info*/ | 977 | args->blkno2 = args->blkno; /* set 2nd entry info*/ |
979 | args->index2 = args->index; | 978 | args->index2 = args->index; |
980 | args->rmtblkno2 = args->rmtblkno; | 979 | args->rmtblkno2 = args->rmtblkno; |
@@ -1054,7 +1053,7 @@ xfs_attr_leaf_addname(xfs_da_args_t *args) | |||
1054 | * so that one disappears and one appears atomically. Then we | 1053 | * so that one disappears and one appears atomically. Then we |
1055 | * must remove the "old" attribute/value pair. | 1054 | * must remove the "old" attribute/value pair. |
1056 | */ | 1055 | */ |
1057 | if (args->rename) { | 1056 | if (args->op_flags & XFS_DA_OP_RENAME) { |
1058 | /* | 1057 | /* |
1059 | * In a separate transaction, set the incomplete flag on the | 1058 | * In a separate transaction, set the incomplete flag on the |
1060 | * "old" attr and clear the incomplete flag on the "new" attr. | 1059 | * "old" attr and clear the incomplete flag on the "new" attr. |
@@ -1307,7 +1306,7 @@ restart: | |||
1307 | } else if (retval == EEXIST) { | 1306 | } else if (retval == EEXIST) { |
1308 | if (args->flags & ATTR_CREATE) | 1307 | if (args->flags & ATTR_CREATE) |
1309 | goto out; | 1308 | goto out; |
1310 | args->rename = 1; /* atomic rename op */ | 1309 | args->op_flags |= XFS_DA_OP_RENAME; /* atomic rename op */ |
1311 | args->blkno2 = args->blkno; /* set 2nd entry info*/ | 1310 | args->blkno2 = args->blkno; /* set 2nd entry info*/ |
1312 | args->index2 = args->index; | 1311 | args->index2 = args->index; |
1313 | args->rmtblkno2 = args->rmtblkno; | 1312 | args->rmtblkno2 = args->rmtblkno; |
@@ -1425,7 +1424,7 @@ restart: | |||
1425 | * so that one disappears and one appears atomically. Then we | 1424 | * so that one disappears and one appears atomically. Then we |
1426 | * must remove the "old" attribute/value pair. | 1425 | * must remove the "old" attribute/value pair. |
1427 | */ | 1426 | */ |
1428 | if (args->rename) { | 1427 | if (args->op_flags & XFS_DA_OP_RENAME) { |
1429 | /* | 1428 | /* |
1430 | * In a separate transaction, set the incomplete flag on the | 1429 | * In a separate transaction, set the incomplete flag on the |
1431 | * "old" attr and clear the incomplete flag on the "new" attr. | 1430 | * "old" attr and clear the incomplete flag on the "new" attr. |