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_dir2_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_dir2_leaf.c')
-rw-r--r-- | fs/xfs/xfs_dir2_leaf.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/fs/xfs/xfs_dir2_leaf.c b/fs/xfs/xfs_dir2_leaf.c index b52903bc0b14..2ebbed4f1b0d 100644 --- a/fs/xfs/xfs_dir2_leaf.c +++ b/fs/xfs/xfs_dir2_leaf.c | |||
@@ -263,20 +263,21 @@ xfs_dir2_leaf_addname( | |||
263 | * If we don't have enough free bytes but we can make enough | 263 | * If we don't have enough free bytes but we can make enough |
264 | * by compacting out stale entries, we'll do that. | 264 | * by compacting out stale entries, we'll do that. |
265 | */ | 265 | */ |
266 | if ((char *)bestsp - (char *)&leaf->ents[be16_to_cpu(leaf->hdr.count)] < needbytes && | 266 | if ((char *)bestsp - (char *)&leaf->ents[be16_to_cpu(leaf->hdr.count)] < |
267 | be16_to_cpu(leaf->hdr.stale) > 1) { | 267 | needbytes && be16_to_cpu(leaf->hdr.stale) > 1) { |
268 | compact = 1; | 268 | compact = 1; |
269 | } | 269 | } |
270 | /* | 270 | /* |
271 | * Otherwise if we don't have enough free bytes we need to | 271 | * Otherwise if we don't have enough free bytes we need to |
272 | * convert to node form. | 272 | * convert to node form. |
273 | */ | 273 | */ |
274 | else if ((char *)bestsp - (char *)&leaf->ents[be16_to_cpu(leaf->hdr.count)] < | 274 | else if ((char *)bestsp - (char *)&leaf->ents[be16_to_cpu( |
275 | needbytes) { | 275 | leaf->hdr.count)] < needbytes) { |
276 | /* | 276 | /* |
277 | * Just checking or no space reservation, give up. | 277 | * Just checking or no space reservation, give up. |
278 | */ | 278 | */ |
279 | if (args->justcheck || args->total == 0) { | 279 | if ((args->op_flags & XFS_DA_OP_JUSTCHECK) || |
280 | args->total == 0) { | ||
280 | xfs_da_brelse(tp, lbp); | 281 | xfs_da_brelse(tp, lbp); |
281 | return XFS_ERROR(ENOSPC); | 282 | return XFS_ERROR(ENOSPC); |
282 | } | 283 | } |
@@ -301,7 +302,7 @@ xfs_dir2_leaf_addname( | |||
301 | * If just checking, then it will fit unless we needed to allocate | 302 | * If just checking, then it will fit unless we needed to allocate |
302 | * a new data block. | 303 | * a new data block. |
303 | */ | 304 | */ |
304 | if (args->justcheck) { | 305 | if (args->op_flags & XFS_DA_OP_JUSTCHECK) { |
305 | xfs_da_brelse(tp, lbp); | 306 | xfs_da_brelse(tp, lbp); |
306 | return use_block == -1 ? XFS_ERROR(ENOSPC) : 0; | 307 | return use_block == -1 ? XFS_ERROR(ENOSPC) : 0; |
307 | } | 308 | } |
@@ -1414,7 +1415,7 @@ xfs_dir2_leaf_lookup_int( | |||
1414 | cbp = dbp; | 1415 | cbp = dbp; |
1415 | } | 1416 | } |
1416 | } | 1417 | } |
1417 | ASSERT(args->oknoent); | 1418 | ASSERT(args->op_flags & XFS_DA_OP_OKNOENT); |
1418 | /* | 1419 | /* |
1419 | * Here, we can only be doing a lookup (not a rename or replace). | 1420 | * Here, we can only be doing a lookup (not a rename or replace). |
1420 | * If a case-insensitive match was found earlier, release the current | 1421 | * If a case-insensitive match was found earlier, release the current |