diff options
author | Eric Sandeen <sandeen@sandeen.net> | 2014-09-08 21:57:52 -0400 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2014-09-08 21:57:52 -0400 |
commit | 94f3cad555d66048906deade06a764f7ea2c6e4d (patch) | |
tree | 537cfbb0bcdacfb55f027cac223d6a2e35e358d5 /fs/xfs/xfs_symlink.c | |
parent | 970fd3f04d5949a4b5f6d0a5fea8e4b6797a5992 (diff) |
xfs: check resblks before calling xfs_dir_canenter
Move the resblks test out of the xfs_dir_canenter,
and into the caller.
This makes a little more sense on the face of it;
xfs_dir_canenter immediately returns if resblks !=0;
and given some of the comments preceding the calls:
* Check for ability to enter directory entry, if no space reserved.
even more so.
It also facilitates the next patch.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/xfs_symlink.c')
-rw-r--r-- | fs/xfs/xfs_symlink.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/xfs/xfs_symlink.c b/fs/xfs/xfs_symlink.c index 6a944a2cd36f..02ae62a998e0 100644 --- a/fs/xfs/xfs_symlink.c +++ b/fs/xfs/xfs_symlink.c | |||
@@ -269,9 +269,11 @@ xfs_symlink( | |||
269 | /* | 269 | /* |
270 | * Check for ability to enter directory entry, if no space reserved. | 270 | * Check for ability to enter directory entry, if no space reserved. |
271 | */ | 271 | */ |
272 | error = xfs_dir_canenter(tp, dp, link_name, resblks); | 272 | if (!resblks) { |
273 | if (error) | 273 | error = xfs_dir_canenter(tp, dp, link_name); |
274 | goto error_return; | 274 | if (error) |
275 | goto error_return; | ||
276 | } | ||
275 | /* | 277 | /* |
276 | * Initialize the bmap freelist prior to calling either | 278 | * Initialize the bmap freelist prior to calling either |
277 | * bmapi or the directory create code. | 279 | * bmapi or the directory create code. |