Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fuse: signal that a fuse inode should exhibit local fs behaviors

Create a new fuse inode flag that indicates that the kernel should
implement various local filesystem behaviors instead of passing vfs
commands straight through to the fuse server and expecting the server to
do all the work. For example, this means that we'll use the kernel to
transform some ACL updates into mode changes, and later to do
enforcement of the immutable and append iflags.

Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Joanne Koong <joannelkoong@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>

authored by

Darrick J. Wong and committed by
Miklos Szeredi
28fec8b9 1ce120dc

+13 -1
+13 -1
fs/fuse/fuse_i.h
··· 239 239 FUSE_I_BTIME, 240 240 /* Wants or already has page cache IO */ 241 241 FUSE_I_CACHE_IO_MODE, 242 + /* 243 + * Client has exclusive access to the inode, either because fs is local 244 + * or the fuse server has an exclusive "lease" on distributed fs 245 + */ 246 + FUSE_I_EXCLUSIVE, 242 247 }; 243 248 244 249 struct fuse_conn; ··· 1060 1055 return get_fuse_mount_super(inode->i_sb)->fc; 1061 1056 } 1062 1057 1063 - static inline struct fuse_inode *get_fuse_inode(struct inode *inode) 1058 + static inline struct fuse_inode *get_fuse_inode(const struct inode *inode) 1064 1059 { 1065 1060 return container_of(inode, struct fuse_inode, inode); 1066 1061 } ··· 1100 1095 static inline bool fuse_is_bad(struct inode *inode) 1101 1096 { 1102 1097 return unlikely(test_bit(FUSE_I_BAD, &get_fuse_inode(inode)->state)); 1098 + } 1099 + 1100 + static inline bool fuse_inode_is_exclusive(const struct inode *inode) 1101 + { 1102 + const struct fuse_inode *fi = get_fuse_inode(inode); 1103 + 1104 + return test_bit(FUSE_I_EXCLUSIVE, &fi->state); 1103 1105 } 1104 1106 1105 1107 static inline struct folio **fuse_folios_alloc(unsigned int nfolios, gfp_t flags,