summaryrefslogtreecommitdiff
path: root/fs/fuse/dev.c
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@redhat.com>2026-03-17 13:09:20 +0100
committerMiklos Szeredi <mszeredi@redhat.com>2026-06-15 14:06:15 +0200
commit4e0de84063159aa1804120c6c5493bd05be35adf (patch)
tree6211f10e44586f305daa676cb3086bc6978f62b7 /fs/fuse/dev.c
parentd8189630a1a1468a8702e252dd93e36d6ec8121e (diff)
downloadlinux-next-4e0de84063159aa1804120c6c5493bd05be35adf.tar.gz
linux-next-4e0de84063159aa1804120c6c5493bd05be35adf.zip
fuse: move 'devices' member from fuse_conn to fuse_chan
This belongs in the transport layer. Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/fuse/dev.c')
-rw-r--r--fs/fuse/dev.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index 7339959fa8d3..41834108bcc1 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -343,13 +343,20 @@ void fuse_chan_release(struct fuse_chan *fch)
void fuse_chan_free(struct fuse_chan *fch)
{
+ WARN_ON(!list_empty(&fch->devices));
kfree(fch);
}
EXPORT_SYMBOL_GPL(fuse_chan_free);
struct fuse_chan *fuse_chan_new(void)
{
- return kzalloc_obj(struct fuse_chan);
+ struct fuse_chan *fch = kzalloc_obj(struct fuse_chan);
+ if (!fch)
+ return NULL;
+
+ INIT_LIST_HEAD(&fch->devices);
+
+ return fch;
}
EXPORT_SYMBOL_GPL(fuse_chan_new);
@@ -418,7 +425,7 @@ void fuse_dev_install(struct fuse_dev *fud, struct fuse_conn *fc)
*/
fc->connected = 0;
} else {
- list_add_tail(&fud->entry, &fc->devices);
+ list_add_tail(&fud->entry, &fc->chan->devices);
fuse_conn_get(fc);
}
spin_unlock(&fc->lock);
@@ -2051,7 +2058,7 @@ static void fuse_resend(struct fuse_conn *fc)
return;
}
- list_for_each_entry(fud, &fc->devices, entry) {
+ list_for_each_entry(fud, &fc->chan->devices, entry) {
struct fuse_pqueue *fpq = &fud->pq;
spin_lock(&fpq->lock);
@@ -2532,7 +2539,7 @@ void fuse_abort_conn(struct fuse_conn *fc)
spin_unlock(&fc->bg_lock);
fuse_set_initialized(fc);
- list_for_each_entry(fud, &fc->devices, entry) {
+ list_for_each_entry(fud, &fc->chan->devices, entry) {
struct fuse_pqueue *fpq = &fud->pq;
spin_lock(&fpq->lock);
@@ -2618,7 +2625,7 @@ int fuse_dev_release(struct inode *inode, struct file *file)
spin_lock(&fc->lock);
list_del(&fud->entry);
/* Are we the last open device? */
- last = list_empty(&fc->devices);
+ last = list_empty(&fc->chan->devices);
spin_unlock(&fc->lock);
if (last) {