From 94f3cad555d66048906deade06a764f7ea2c6e4d Mon Sep 17 00:00:00 2001 From: Eric Sandeen Date: Tue, 9 Sep 2014 11:57:52 +1000 Subject: 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 Reviewed-by: Christoph Hellwig Reviewed-by: Brian Foster Signed-off-by: Dave Chinner --- fs/xfs/libxfs/xfs_dir2.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'fs/xfs/libxfs/xfs_dir2.c') diff --git a/fs/xfs/libxfs/xfs_dir2.c b/fs/xfs/libxfs/xfs_dir2.c index 6cef221..ea84e1c 100644 --- a/fs/xfs/libxfs/xfs_dir2.c +++ b/fs/xfs/libxfs/xfs_dir2.c @@ -535,22 +535,17 @@ out_free: /* * See if this entry can be added to the directory without allocating space. - * First checks that the caller couldn't reserve enough space (resblks = 0). */ int xfs_dir_canenter( xfs_trans_t *tp, xfs_inode_t *dp, - struct xfs_name *name, /* name of entry to add */ - uint resblks) + struct xfs_name *name) /* name of entry to add */ { struct xfs_da_args *args; int rval; int v; /* type-checking value */ - if (resblks) - return 0; - ASSERT(S_ISDIR(dp->i_d.di_mode)); args = kmem_zalloc(sizeof(*args), KM_SLEEP | KM_NOFS); -- cgit v1.1