diff options
Diffstat (limited to 'api')
-rw-r--r-- | api/src/glfs-fops.c | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/api/src/glfs-fops.c b/api/src/glfs-fops.c index 0a59a8dcf1c..ea61c8b7a43 100644 --- a/api/src/glfs-fops.c +++ b/api/src/glfs-fops.c @@ -934,10 +934,9 @@ pub_glfs_preadv_async (struct glfs_fd *glfd, const struct iovec *iovec, offset, flags, NULL); out: - if (fd) - fd_unref (fd); - if (ret) { + if (fd) + fd_unref (fd); if (glfd) GF_REF_PUT (glfd); if (gio) { @@ -1252,10 +1251,9 @@ pub_glfs_pwritev_async (struct glfs_fd *glfd, const struct iovec *iovec, ret = 0; out: - if (fd) - fd_unref (fd); - if (ret) { + if (fd) + fd_unref (fd); if (glfd) GF_REF_PUT (glfd); GF_FREE (gio); @@ -1439,10 +1437,9 @@ glfs_fsync_async_common (struct glfs_fd *glfd, glfs_io_cbk fn, void *data, subvol->fops->fsync, fd, dataonly, NULL); out: - if (fd) - fd_unref (fd); - if (ret) { + if (fd) + fd_unref (fd); if (glfd) GF_REF_PUT (glfd); GF_FREE (gio); @@ -1693,10 +1690,9 @@ pub_glfs_ftruncate_async (struct glfs_fd *glfd, off_t offset, glfs_io_cbk fn, ret = 0; out: - if (fd) - fd_unref (fd); - if (ret) { + if (fd) + fd_unref (fd); if (glfd) GF_REF_PUT (glfd); GF_FREE (gio); @@ -2552,10 +2548,9 @@ pub_glfs_discard_async (struct glfs_fd *glfd, off_t offset, size_t len, ret = 0; out: - if (fd) - fd_unref (fd); - if (ret) { + if (fd) + fd_unref (fd); if (glfd) GF_REF_PUT (glfd); GF_FREE (gio); @@ -2640,10 +2635,9 @@ pub_glfs_zerofill_async (struct glfs_fd *glfd, off_t offset, off_t len, subvol->fops->zerofill, fd, offset, len, NULL); ret = 0; out: - if (fd) - fd_unref (fd); - if (ret) { + if (fd) + fd_unref (fd); if (glfd) GF_REF_PUT (glfd); GF_FREE (gio); |