Changeset View
Changeset View
Standalone View
Standalone View
sys/fs/fuse/fuse_ipc.h
Show First 20 Lines • Show All 206 Lines • ▼ Show 20 Lines | struct fuse_data { | ||||
uint32_t subtype; | uint32_t subtype; | ||||
char volname[MAXPATHLEN]; | char volname[MAXPATHLEN]; | ||||
struct selinfo ks_rsel; | struct selinfo ks_rsel; | ||||
int daemon_timeout; | int daemon_timeout; | ||||
int linux_errnos; | int linux_errnos; | ||||
unsigned time_gran; | unsigned time_gran; | ||||
/* A bitmask of FUSE RPCs that are not implemented by the server */ | |||||
uint64_t notimpl; | uint64_t notimpl; | ||||
/* | |||||
* A bitmask of FUSE RPCs that are implemented by the server. | |||||
* If an operation is not present in either notimpl or isimpl, then it | |||||
* may be implemented by the server, but the kernel doesn't know for | |||||
* sure. | |||||
*/ | |||||
uint64_t isimpl; | |||||
uint64_t mnt_flag; | uint64_t mnt_flag; | ||||
enum fuse_data_cache_mode cache_mode; | enum fuse_data_cache_mode cache_mode; | ||||
}; | }; | ||||
#define FSESS_DEAD 0x0001 /* session is to be closed */ | #define FSESS_DEAD 0x0001 /* session is to be closed */ | ||||
#define FSESS_INITED 0x0004 /* session has been inited */ | #define FSESS_INITED 0x0004 /* session has been inited */ | ||||
#define FSESS_DAEMON_CAN_SPY 0x0010 /* let non-owners access this fs */ | #define FSESS_DAEMON_CAN_SPY 0x0010 /* let non-owners access this fs */ | ||||
/* (and being observed by the daemon) */ | /* (and being observed by the daemon) */ | ||||
Show All 11 Lines | |||||
static inline struct fuse_data * | static inline struct fuse_data * | ||||
fuse_get_mpdata(struct mount *mp) | fuse_get_mpdata(struct mount *mp) | ||||
{ | { | ||||
return mp->mnt_data; | return mp->mnt_data; | ||||
} | } | ||||
static inline bool | static inline bool | ||||
fsess_isimpl(struct mount *mp, int opcode) | fsess_is_impl(struct mount *mp, int opcode) | ||||
{ | { | ||||
struct fuse_data *data = fuse_get_mpdata(mp); | struct fuse_data *data = fuse_get_mpdata(mp); | ||||
return ((data->isimpl & (1ULL << opcode)) != 0); | |||||
} | |||||
static inline bool | |||||
fsess_maybe_impl(struct mount *mp, int opcode) | |||||
{ | |||||
struct fuse_data *data = fuse_get_mpdata(mp); | |||||
return ((data->notimpl & (1ULL << opcode)) == 0); | return ((data->notimpl & (1ULL << opcode)) == 0); | ||||
} | } | ||||
static inline bool | |||||
fsess_not_impl(struct mount *mp, int opcode) | |||||
{ | |||||
struct fuse_data *data = fuse_get_mpdata(mp); | |||||
return ((data->notimpl & (1ULL << opcode)) != 0); | |||||
} | |||||
static inline void | |||||
fsess_set_impl(struct mount *mp, int opcode) | |||||
{ | |||||
struct fuse_data *data = fuse_get_mpdata(mp); | |||||
data->isimpl |= (1ULL << opcode); | |||||
cem: Should we assert !notimpl? | |||||
Done Inline ActionsMaybe. But I worry that a schizophrenic server might change its mind about whether a particular RPC is supported and trigger a panic. That's not possible ATM, because fsess_set_impl is only called in one place, but it might be possible if we start using fsess_set_impl more widely. asomers: Maybe. But I worry that a schizophrenic server might change its mind about whether a… | |||||
Not Done Inline ActionsMakes sense to me, thanks. cem: Makes sense to me, thanks. | |||||
} | |||||
static inline void | static inline void | ||||
fsess_set_notimpl(struct mount *mp, int opcode) | fsess_set_notimpl(struct mount *mp, int opcode) | ||||
{ | { | ||||
struct fuse_data *data = fuse_get_mpdata(mp); | struct fuse_data *data = fuse_get_mpdata(mp); | ||||
data->notimpl |= (1ULL << opcode); | data->notimpl |= (1ULL << opcode); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 165 Lines • Show Last 20 Lines |
Should we assert !notimpl?