diff options
| author | Luis Henriques <luis@igalia.com> | 2025-09-16 16:53:10 +0300 |
|---|---|---|
| committer | Miklos Szeredi <mszeredi@redhat.com> | 2025-11-12 13:45:03 +0300 |
| commit | b4909ae8d4e95a5046bcba099a3afdef8024b1b2 (patch) | |
| tree | 01a83ed727b43c8f84319ebc9e582860e1c74be6 | |
| parent | 64becd224ff99dbdcffab22709dfcf170e52aff1 (diff) | |
| download | linux-b4909ae8d4e95a5046bcba099a3afdef8024b1b2.tar.xz | |
fuse: refactor fuse_conn_put() to remove negative logic.
There is no functional change with this patch. It simply refactors
function fuse_conn_put() to not use negative logic, which makes it more
easier to read.
Signed-off-by: Luis Henriques <luis@igalia.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
| -rw-r--r-- | fs/fuse/inode.c | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index 3087165a6004..21e04c394a80 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c @@ -1022,27 +1022,28 @@ static void delayed_release(struct rcu_head *p) void fuse_conn_put(struct fuse_conn *fc) { - if (refcount_dec_and_test(&fc->count)) { - struct fuse_iqueue *fiq = &fc->iq; - struct fuse_sync_bucket *bucket; - - if (IS_ENABLED(CONFIG_FUSE_DAX)) - fuse_dax_conn_free(fc); - if (fc->timeout.req_timeout) - cancel_delayed_work_sync(&fc->timeout.work); - cancel_work_sync(&fc->epoch_work); - if (fiq->ops->release) - fiq->ops->release(fiq); - put_pid_ns(fc->pid_ns); - bucket = rcu_dereference_protected(fc->curr_bucket, 1); - if (bucket) { - WARN_ON(atomic_read(&bucket->count) != 1); - kfree(bucket); - } - if (IS_ENABLED(CONFIG_FUSE_PASSTHROUGH)) - fuse_backing_files_free(fc); - call_rcu(&fc->rcu, delayed_release); + struct fuse_iqueue *fiq = &fc->iq; + struct fuse_sync_bucket *bucket; + + if (!refcount_dec_and_test(&fc->count)) + return; + + if (IS_ENABLED(CONFIG_FUSE_DAX)) + fuse_dax_conn_free(fc); + if (fc->timeout.req_timeout) + cancel_delayed_work_sync(&fc->timeout.work); + cancel_work_sync(&fc->epoch_work); + if (fiq->ops->release) + fiq->ops->release(fiq); + put_pid_ns(fc->pid_ns); + bucket = rcu_dereference_protected(fc->curr_bucket, 1); + if (bucket) { + WARN_ON(atomic_read(&bucket->count) != 1); + kfree(bucket); } + if (IS_ENABLED(CONFIG_FUSE_PASSTHROUGH)) + fuse_backing_files_free(fc); + call_rcu(&fc->rcu, delayed_release); } EXPORT_SYMBOL_GPL(fuse_conn_put); |
