fusefs: raise protocol level to 7.10
Protocol version 7.10 has only one new feature, and I'm choosing not to implement it, so this commit is basically a noop. The sole new feature is the FOPEN_NONSEEKABLE flag, which a fuse file system can return to indicate that a certain file handle cannot be seeked. However, I'm unaware of any file system in ports that uses this flag. Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
d4fd0c8148
commit
3f105d16a0
@ -134,7 +134,16 @@ struct fuse_filehandle {
|
||||
/* The filehandle returned by FUSE_OPEN */
|
||||
uint64_t fh_id;
|
||||
|
||||
/* flags returned by FUSE_OPEN */
|
||||
/*
|
||||
* flags returned by FUSE_OPEN
|
||||
* Supported flags: FOPEN_DIRECT_IO, FOPEN_KEEP_CACHE
|
||||
* Unsupported:
|
||||
* FOPEN_NONSEEKABLE: Adding support would require a new per-file
|
||||
* or per-vnode attribute, which would have to be checked by
|
||||
* kern_lseek (and others) for every file system. The benefit is
|
||||
* dubious, since I'm unaware of any file systems in ports that use
|
||||
* this flag.
|
||||
*/
|
||||
uint32_t fuse_open_flags;
|
||||
|
||||
/* The access mode of the file handle */
|
||||
|
@ -45,6 +45,9 @@
|
||||
* - add lock_owner field to fuse_setattr_in, fuse_read_in and fuse_write_in
|
||||
* - add blksize field to fuse_attr
|
||||
* - add file flags field to fuse_read_in and fuse_write_in
|
||||
*
|
||||
* 7.10
|
||||
* - add nonseekable open flag
|
||||
*/
|
||||
|
||||
#ifndef _FUSE_FUSE_KERNEL_H
|
||||
@ -64,7 +67,7 @@
|
||||
#define FUSE_KERNEL_VERSION 7
|
||||
|
||||
/** Minor version number of this interface */
|
||||
#define FUSE_KERNEL_MINOR_VERSION 9
|
||||
#define FUSE_KERNEL_MINOR_VERSION 10
|
||||
|
||||
/** The node ID of the root inode */
|
||||
#define FUSE_ROOT_ID 1
|
||||
@ -72,9 +75,6 @@
|
||||
/** The major number of the fuse character device */
|
||||
#define FUSE_MAJOR MISC_MAJOR
|
||||
|
||||
/** The minor number of the fuse character device */
|
||||
#define FUSE_MINOR 229
|
||||
|
||||
/* Make sure all structures are padded to 64bit boundary, so 32bit
|
||||
userspace works under 64bit kernels */
|
||||
|
||||
@ -136,9 +136,11 @@ struct fuse_file_lock {
|
||||
*
|
||||
* FOPEN_DIRECT_IO: bypass page cache for this open file
|
||||
* FOPEN_KEEP_CACHE: don't invalidate the data cache on open
|
||||
* FOPEN_NONSEEKABLE: the file is not seekable
|
||||
*/
|
||||
#define FOPEN_DIRECT_IO (1 << 0)
|
||||
#define FOPEN_KEEP_CACHE (1 << 1)
|
||||
#define FOPEN_NONSEEKABLE (1 << 2)
|
||||
|
||||
/**
|
||||
* INIT request/reply flags
|
||||
|
@ -312,30 +312,15 @@ fuse_vnode_get(struct mount *mp,
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Called for every fusefs vnode open to initialize the vnode (not
|
||||
* fuse_filehandle) for use
|
||||
*/
|
||||
void
|
||||
fuse_vnode_open(struct vnode *vp, int32_t fuse_open_flags, struct thread *td)
|
||||
{
|
||||
/*
|
||||
* Function is called for every vnode open.
|
||||
* Merge fuse_open_flags it may be 0
|
||||
*/
|
||||
/*
|
||||
* Ideally speaking, direct io should be enabled on
|
||||
* fd's but do not see of any way of providing that
|
||||
* this implementation.
|
||||
*
|
||||
* Also cannot think of a reason why would two
|
||||
* different fd's on same vnode would like
|
||||
* have DIRECT_IO turned on and off. But linux
|
||||
* based implementation works on an fd not an
|
||||
* inode and provides such a feature.
|
||||
*
|
||||
* XXXIP: Handle fd based DIRECT_IO
|
||||
*/
|
||||
if (vnode_vtype(vp) == VREG) {
|
||||
/* XXXIP prevent getattr, by using cached node size */
|
||||
if (vnode_vtype(vp) == VREG)
|
||||
vnode_create_vobject(vp, 0, td);
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
|
Loading…
x
Reference in New Issue
Block a user