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_leaf.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_leaf.c')
-rw-r--r-- | fs/xfs/xfs_attr_leaf.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/fs/xfs/xfs_attr_leaf.c b/fs/xfs/xfs_attr_leaf.c index a85e9caf0156..cb345e6e4850 100644 --- a/fs/xfs/xfs_attr_leaf.c +++ b/fs/xfs/xfs_attr_leaf.c | |||
@@ -369,9 +369,10 @@ xfs_attr_shortform_remove(xfs_da_args_t *args) | |||
369 | * Fix up the start offset of the attribute fork | 369 | * Fix up the start offset of the attribute fork |
370 | */ | 370 | */ |
371 | totsize -= size; | 371 | totsize -= size; |
372 | if (totsize == sizeof(xfs_attr_sf_hdr_t) && !args->addname && | 372 | if (totsize == sizeof(xfs_attr_sf_hdr_t) && |
373 | (mp->m_flags & XFS_MOUNT_ATTR2) && | 373 | !(args->op_flags & XFS_DA_OP_ADDNAME) && |
374 | (dp->i_d.di_format != XFS_DINODE_FMT_BTREE)) { | 374 | (mp->m_flags & XFS_MOUNT_ATTR2) && |
375 | (dp->i_d.di_format != XFS_DINODE_FMT_BTREE)) { | ||
375 | /* | 376 | /* |
376 | * Last attribute now removed, revert to original | 377 | * Last attribute now removed, revert to original |
377 | * inode format making all literal area available | 378 | * inode format making all literal area available |
@@ -389,9 +390,10 @@ xfs_attr_shortform_remove(xfs_da_args_t *args) | |||
389 | xfs_idata_realloc(dp, -size, XFS_ATTR_FORK); | 390 | xfs_idata_realloc(dp, -size, XFS_ATTR_FORK); |
390 | dp->i_d.di_forkoff = xfs_attr_shortform_bytesfit(dp, totsize); | 391 | dp->i_d.di_forkoff = xfs_attr_shortform_bytesfit(dp, totsize); |
391 | ASSERT(dp->i_d.di_forkoff); | 392 | ASSERT(dp->i_d.di_forkoff); |
392 | ASSERT(totsize > sizeof(xfs_attr_sf_hdr_t) || args->addname || | 393 | ASSERT(totsize > sizeof(xfs_attr_sf_hdr_t) || |
393 | !(mp->m_flags & XFS_MOUNT_ATTR2) || | 394 | (args->op_flags & XFS_DA_OP_ADDNAME) || |
394 | dp->i_d.di_format == XFS_DINODE_FMT_BTREE); | 395 | !(mp->m_flags & XFS_MOUNT_ATTR2) || |
396 | dp->i_d.di_format == XFS_DINODE_FMT_BTREE); | ||
395 | dp->i_afp->if_ext_max = | 397 | dp->i_afp->if_ext_max = |
396 | XFS_IFORK_ASIZE(dp) / (uint)sizeof(xfs_bmbt_rec_t); | 398 | XFS_IFORK_ASIZE(dp) / (uint)sizeof(xfs_bmbt_rec_t); |
397 | dp->i_df.if_ext_max = | 399 | dp->i_df.if_ext_max = |
@@ -531,7 +533,7 @@ xfs_attr_shortform_to_leaf(xfs_da_args_t *args) | |||
531 | nargs.total = args->total; | 533 | nargs.total = args->total; |
532 | nargs.whichfork = XFS_ATTR_FORK; | 534 | nargs.whichfork = XFS_ATTR_FORK; |
533 | nargs.trans = args->trans; | 535 | nargs.trans = args->trans; |
534 | nargs.oknoent = 1; | 536 | nargs.op_flags = XFS_DA_OP_OKNOENT; |
535 | 537 | ||
536 | sfe = &sf->list[0]; | 538 | sfe = &sf->list[0]; |
537 | for (i = 0; i < sf->hdr.count; i++) { | 539 | for (i = 0; i < sf->hdr.count; i++) { |
@@ -853,7 +855,7 @@ xfs_attr_leaf_to_shortform(xfs_dabuf_t *bp, xfs_da_args_t *args, int forkoff) | |||
853 | nargs.total = args->total; | 855 | nargs.total = args->total; |
854 | nargs.whichfork = XFS_ATTR_FORK; | 856 | nargs.whichfork = XFS_ATTR_FORK; |
855 | nargs.trans = args->trans; | 857 | nargs.trans = args->trans; |
856 | nargs.oknoent = 1; | 858 | nargs.op_flags = XFS_DA_OP_OKNOENT; |
857 | entry = &leaf->entries[0]; | 859 | entry = &leaf->entries[0]; |
858 | for (i = 0; i < be16_to_cpu(leaf->hdr.count); entry++, i++) { | 860 | for (i = 0; i < be16_to_cpu(leaf->hdr.count); entry++, i++) { |
859 | if (entry->flags & XFS_ATTR_INCOMPLETE) | 861 | if (entry->flags & XFS_ATTR_INCOMPLETE) |
@@ -1155,7 +1157,7 @@ xfs_attr_leaf_add_work(xfs_dabuf_t *bp, xfs_da_args_t *args, int mapindex) | |||
1155 | entry->hashval = cpu_to_be32(args->hashval); | 1157 | entry->hashval = cpu_to_be32(args->hashval); |
1156 | entry->flags = tmp ? XFS_ATTR_LOCAL : 0; | 1158 | entry->flags = tmp ? XFS_ATTR_LOCAL : 0; |
1157 | entry->flags |= XFS_ATTR_NSP_ARGS_TO_ONDISK(args->flags); | 1159 | entry->flags |= XFS_ATTR_NSP_ARGS_TO_ONDISK(args->flags); |
1158 | if (args->rename) { | 1160 | if (args->op_flags & XFS_DA_OP_RENAME) { |
1159 | entry->flags |= XFS_ATTR_INCOMPLETE; | 1161 | entry->flags |= XFS_ATTR_INCOMPLETE; |
1160 | if ((args->blkno2 == args->blkno) && | 1162 | if ((args->blkno2 == args->blkno) && |
1161 | (args->index2 <= args->index)) { | 1163 | (args->index2 <= args->index)) { |