aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph
diff options
context:
space:
mode:
authorXiubo Li <xiubli@redhat.com>2022-07-05 10:40:23 +0800
committerIlya Dryomov <idryomov@gmail.com>2022-08-03 00:54:13 +0200
commitc460f4e4bba2d3f8dc0b5bfa8995d6e8d2d527a1 (patch)
tree2d0d3696a538d76b60a1799b3f9e4b3d651e2b8c /fs/ceph
parentceph: don't truncate file in atomic_open (diff)
downloadlinux-dev-c460f4e4bba2d3f8dc0b5bfa8995d6e8d2d527a1.tar.xz
linux-dev-c460f4e4bba2d3f8dc0b5bfa8995d6e8d2d527a1.zip
ceph: remove useless check for the folio
The netfs_write_begin() won't set the folio if the return value is non-zero. Signed-off-by: Xiubo Li <xiubli@redhat.com> Reviewed-by: Ilya Dryomov <idryomov@gmail.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph')
-rw-r--r--fs/ceph/addr.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index 2f886ec426a0..de12715c237b 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -1326,16 +1326,13 @@ static int ceph_write_begin(struct file *file, struct address_space *mapping,
int r;
r = netfs_write_begin(&ci->netfs, file, inode->i_mapping, pos, len, &folio, NULL);
- if (r == 0)
- folio_wait_fscache(folio);
- if (r < 0) {
- if (folio)
- folio_put(folio);
- } else {
- WARN_ON_ONCE(!folio_test_locked(folio));
- *pagep = &folio->page;
- }
- return r;
+ if (r < 0)
+ return r;
+
+ folio_wait_fscache(folio);
+ WARN_ON_ONCE(!folio_test_locked(folio));
+ *pagep = &folio->page;
+ return 0;
}
/*