afs: remove redudant use of variable ret in afs_dir_iterate_contents
Subsystems (2)
PATCH 1/1 afs: remove redudant use of variable ret in afs_dir_iterate_contents
The variable ret is being initialized with 0 and is never re-assigned. At the end of the function the check for ret being set to -ESTALE is always false, so the check and the call to afs_invalidate_dir is redundant. Remove ret and this check and just return 0 at the end of the function.
--- fs/afs/dir.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
fs/afs/dir.c +1 -4
@@ -488,7 +488,6 @@ static int afs_dir_iterate_contents(struct inode *dir, struct dir_context *ctx)struct afs_vnode *dvnode =AFS_FS_I (dir);struct iov_iter iter;unsigned long long i_size =i_size_read (dir); -int ret =0 ;/* Round the file position up to the next entry boundary */ ctx->pos =round_up (ctx->pos,sizeof (union afs_xdr_dirent ));
@@ -502,9 +501,7 @@ static int afs_dir_iterate_contents(struct inode *dir, struct dir_context *ctx)iterate_folioq (&iter,iov_iter_count (&iter), dvnode, ctx, afs_dir_iterate_step); -if (ret == -ESTALE ) -afs_invalidate_dir (dvnode, afs_dir_invalid_iter_stale); -return ret; +return 0 ; }/*
Signature · 1 line
2.39.5
David Howells
maintainerQuoted 5 lines · Colin Ian King
The variable ret is being initialized with 0 and is never re-assigned. At the end of the function the check for ret being set to
-ESTALEis always false, so the check and the call toafs_invalidate_diris redundant. Remove ret and this check and just return 0 at the end of the function.
This is the wrong thing to do. We need to get the error out. I'm fixing my patch to do that.
Thanks,
David