]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
coda: Convert coda_symlink_filler() to use folio_end_read()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Thu, 30 May 2024 20:20:54 +0000 (21:20 +0100)
committerChristian Brauner <brauner@kernel.org>
Fri, 31 May 2024 10:31:39 +0000 (12:31 +0200)
This is slightly more efficient than separate calls to
folio_mark_uptodate() and folio_unlock(), and it's easier to read.
Get rid of the call to folio_set_error() as nobody will check this flag.

Cc: Jan Harkes <jaharkes@cs.cmu.edu>
Cc: coda@cs.cmu.edu
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Link: https://lore.kernel.org/r/20240530202110.2653630-3-willy@infradead.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/coda/symlink.c

index ccdbec388091abb9c637027cd12aa4dcddf75164..40f84d01452475973261cc831eea28dc6b726c41 100644 (file)
@@ -31,15 +31,7 @@ static int coda_symlink_filler(struct file *file, struct folio *folio)
        cii = ITOC(inode);
 
        error = venus_readlink(inode->i_sb, &cii->c_fid, p, &len);
-       if (error)
-               goto fail;
-       folio_mark_uptodate(folio);
-       folio_unlock(folio);
-       return 0;
-
-fail:
-       folio_set_error(folio);
-       folio_unlock(folio);
+       folio_end_read(folio, error == 0);
        return error;
 }