All of lore.kernel.org
 help / color / mirror / Atom feed
* per-inode locks in FUSE (kernel vs userspace)
@ 2021-12-03  0:05 Eric Wong
  2021-12-06 22:28 ` Vivek Goyal
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Wong @ 2021-12-03  0:05 UTC (permalink / raw)
  To: fuse-devel, linux-fsdevel

Hi all, I'm working on a new multi-threaded FS using the
libfuse3 fuse_lowlevel.h API.  It looks to me like the kernel
already performs the necessary locking on a per-inode basis to
save me some work in userspace.

In particular, I originally thought I'd need pthreads mutexes on
a per-inode (fuse_ino_t) basis to protect userspace data
structures between the .setattr (truncate), .fsync, and
.write_buf userspace callbacks.

However upon reading the kernel, I can see fuse_fsync,
fuse_{cache,direct}_write_iter in fs/fuse/file.c all use
inode_lock.  do_truncate also uses inode_lock in fs/open.c.

So it's look like implementing extra locking in userspace would
do nothing useful in my case, right?

Thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-12-07 14:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-03  0:05 per-inode locks in FUSE (kernel vs userspace) Eric Wong
2021-12-06 22:28 ` Vivek Goyal
2021-12-07  8:38   ` Miklos Szeredi
2021-12-07 13:48     ` Vivek Goyal
2021-12-07 14:07       ` Miklos Szeredi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.