mirror of
https://github.com/winfsp/winfsp.git
synced 2025-06-14 15:52:47 -05:00
dll: fuse: implement BSD flags support
This commit is contained in:
110
inc/fuse/fuse.h
110
inc/fuse/fuse.h
@ -39,54 +39,80 @@ typedef int (*fuse_dirfil_t)(fuse_dirh_t h, const char *name,
|
||||
|
||||
struct fuse_operations
|
||||
{
|
||||
int (*getattr)(const char *path, struct fuse_stat *stbuf);
|
||||
int (*getdir)(const char *path, fuse_dirh_t h, fuse_dirfil_t filler);
|
||||
int (*readlink)(const char *path, char *buf, size_t size);
|
||||
int (*mknod)(const char *path, fuse_mode_t mode, fuse_dev_t dev);
|
||||
int (*mkdir)(const char *path, fuse_mode_t mode);
|
||||
int (*unlink)(const char *path);
|
||||
int (*rmdir)(const char *path);
|
||||
int (*symlink)(const char *dstpath, const char *srcpath);
|
||||
int (*rename)(const char *oldpath, const char *newpath);
|
||||
int (*link)(const char *srcpath, const char *dstpath);
|
||||
int (*chmod)(const char *path, fuse_mode_t mode);
|
||||
int (*chown)(const char *path, fuse_uid_t uid, fuse_gid_t gid);
|
||||
int (*truncate)(const char *path, fuse_off_t size);
|
||||
int (*utime)(const char *path, struct fuse_utimbuf *timbuf);
|
||||
int (*open)(const char *path, struct fuse_file_info *fi);
|
||||
int (*read)(const char *path, char *buf, size_t size, fuse_off_t off,
|
||||
/* S - supported by WinFsp */
|
||||
/* S */ int (*getattr)(const char *path, struct fuse_stat *stbuf);
|
||||
/* S */ int (*getdir)(const char *path, fuse_dirh_t h, fuse_dirfil_t filler);
|
||||
/* S */ int (*readlink)(const char *path, char *buf, size_t size);
|
||||
/* S */ int (*mknod)(const char *path, fuse_mode_t mode, fuse_dev_t dev);
|
||||
/* S */ int (*mkdir)(const char *path, fuse_mode_t mode);
|
||||
/* S */ int (*unlink)(const char *path);
|
||||
/* S */ int (*rmdir)(const char *path);
|
||||
/* S */ int (*symlink)(const char *dstpath, const char *srcpath);
|
||||
/* S */ int (*rename)(const char *oldpath, const char *newpath);
|
||||
/* _ */ int (*link)(const char *srcpath, const char *dstpath);
|
||||
/* S */ int (*chmod)(const char *path, fuse_mode_t mode);
|
||||
/* S */ int (*chown)(const char *path, fuse_uid_t uid, fuse_gid_t gid);
|
||||
/* S */ int (*truncate)(const char *path, fuse_off_t size);
|
||||
/* S */ int (*utime)(const char *path, struct fuse_utimbuf *timbuf);
|
||||
/* S */ int (*open)(const char *path, struct fuse_file_info *fi);
|
||||
/* S */ int (*read)(const char *path, char *buf, size_t size, fuse_off_t off,
|
||||
struct fuse_file_info *fi);
|
||||
int (*write)(const char *path, const char *buf, size_t size, fuse_off_t off,
|
||||
/* S */ int (*write)(const char *path, const char *buf, size_t size, fuse_off_t off,
|
||||
struct fuse_file_info *fi);
|
||||
int (*statfs)(const char *path, struct fuse_statvfs *stbuf);
|
||||
int (*flush)(const char *path, struct fuse_file_info *fi);
|
||||
int (*release)(const char *path, struct fuse_file_info *fi);
|
||||
int (*fsync)(const char *path, int datasync, struct fuse_file_info *fi);
|
||||
int (*setxattr)(const char *path, const char *name, const char *value, size_t size,
|
||||
/* S */ int (*statfs)(const char *path, struct fuse_statvfs *stbuf);
|
||||
/* S */ int (*flush)(const char *path, struct fuse_file_info *fi);
|
||||
/* S */ int (*release)(const char *path, struct fuse_file_info *fi);
|
||||
/* S */ int (*fsync)(const char *path, int datasync, struct fuse_file_info *fi);
|
||||
/* _ */ int (*setxattr)(const char *path, const char *name, const char *value, size_t size,
|
||||
int flags);
|
||||
int (*getxattr)(const char *path, const char *name, char *value, size_t size);
|
||||
int (*listxattr)(const char *path, char *namebuf, size_t size);
|
||||
int (*removexattr)(const char *path, const char *name);
|
||||
int (*opendir)(const char *path, struct fuse_file_info *fi);
|
||||
int (*readdir)(const char *path, void *buf, fuse_fill_dir_t filler, fuse_off_t off,
|
||||
/* _ */ int (*getxattr)(const char *path, const char *name, char *value, size_t size);
|
||||
/* _ */ int (*listxattr)(const char *path, char *namebuf, size_t size);
|
||||
/* _ */ int (*removexattr)(const char *path, const char *name);
|
||||
/* S */ int (*opendir)(const char *path, struct fuse_file_info *fi);
|
||||
/* S */ int (*readdir)(const char *path, void *buf, fuse_fill_dir_t filler, fuse_off_t off,
|
||||
struct fuse_file_info *fi);
|
||||
int (*releasedir)(const char *path, struct fuse_file_info *fi);
|
||||
int (*fsyncdir)(const char *path, int datasync, struct fuse_file_info *fi);
|
||||
void *(*init)(struct fuse_conn_info *conn);
|
||||
void (*destroy)(void *data);
|
||||
int (*access)(const char *path, int mask);
|
||||
int (*create)(const char *path, fuse_mode_t mode, struct fuse_file_info *fi);
|
||||
int (*ftruncate)(const char *path, fuse_off_t off, struct fuse_file_info *fi);
|
||||
int (*fgetattr)(const char *path, struct fuse_stat *stbuf, struct fuse_file_info *fi);
|
||||
int (*lock)(const char *path, struct fuse_file_info *fi, int cmd, struct fuse_flock *lock);
|
||||
int (*utimens)(const char *path, const struct fuse_timespec tv[2]);
|
||||
int (*bmap)(const char *path, size_t blocksize, uint64_t *idx);
|
||||
unsigned int flag_nullpath_ok:1;
|
||||
unsigned int flag_reserved:31;
|
||||
int (*ioctl)(const char *path, int cmd, void *arg, struct fuse_file_info *fi,
|
||||
/* S */ int (*releasedir)(const char *path, struct fuse_file_info *fi);
|
||||
/* S */ int (*fsyncdir)(const char *path, int datasync, struct fuse_file_info *fi);
|
||||
/* S */ void *(*init)(struct fuse_conn_info *conn);
|
||||
/* S */ void (*destroy)(void *data);
|
||||
/* _ */ int (*access)(const char *path, int mask);
|
||||
/* S */ int (*create)(const char *path, fuse_mode_t mode, struct fuse_file_info *fi);
|
||||
/* S */ int (*ftruncate)(const char *path, fuse_off_t off, struct fuse_file_info *fi);
|
||||
/* S */ int (*fgetattr)(const char *path, struct fuse_stat *stbuf, struct fuse_file_info *fi);
|
||||
/* _ */ int (*lock)(const char *path,
|
||||
struct fuse_file_info *fi, int cmd, struct fuse_flock *lock);
|
||||
/* S */ int (*utimens)(const char *path, const struct fuse_timespec tv[2]);
|
||||
/* _ */ int (*bmap)(const char *path, size_t blocksize, uint64_t *idx);
|
||||
/* _ */ unsigned int flag_nullpath_ok:1;
|
||||
/* _ */ unsigned int flag_reserved:31;
|
||||
/* _ */ int (*ioctl)(const char *path, int cmd, void *arg, struct fuse_file_info *fi,
|
||||
unsigned int flags, void *data);
|
||||
int (*poll)(const char *path, struct fuse_file_info *fi,
|
||||
/* _ */ int (*poll)(const char *path, struct fuse_file_info *fi,
|
||||
struct fuse_pollhandle *ph, unsigned *reventsp);
|
||||
/* FUSE 2.9 */
|
||||
/* _ */ int (*write_buf)(const char *path,
|
||||
struct fuse_bufvec *buf, fuse_off_t off, struct fuse_file_info *fi);
|
||||
/* _ */ int (*read_buf)(const char *path,
|
||||
struct fuse_bufvec **bufp, size_t size, fuse_off_t off, struct fuse_file_info *fi);
|
||||
/* _ */ int (*flock)(const char *path, struct fuse_file_info *, int op);
|
||||
/* _ */ int (*fallocate)(const char *path, int mode, fuse_off_t off, fuse_off_t len,
|
||||
struct fuse_file_info *fi);
|
||||
/* OSXFUSE */
|
||||
/* _ */ int (*reserved00)();
|
||||
/* _ */ int (*reserved01)();
|
||||
/* _ */ int (*reserved02)();
|
||||
/* _ */ int (*statfs_x)(const char *path, struct fuse_statfs *stbuf);
|
||||
/* _ */ int (*setvolname)(const char *volname);
|
||||
/* _ */ int (*exchange)(const char *oldpath, const char *newpath, unsigned long flags);
|
||||
/* _ */ int (*getxtimes)(const char *path,
|
||||
struct fuse_timespec *bkuptime, struct fuse_timespec *crtime);
|
||||
/* _ */ int (*setbkuptime)(const char *path, const struct fuse_timespec *tv);
|
||||
/* _ */ int (*setchgtime)(const char *path, const struct fuse_timespec *tv);
|
||||
/* _ */ int (*setcrtime)(const char *path, const struct fuse_timespec *tv);
|
||||
/* S */ int (*chflags)(const char *path, uint32_t flags);
|
||||
/* _ */ int (*setattr_x)(const char *path, struct fuse_setattr_x *attr);
|
||||
/* _ */ int (*fsetattr_x)(const char *path, struct fuse_setattr_x *attr,
|
||||
struct fuse_file_info *fi);
|
||||
};
|
||||
|
||||
struct fuse_context
|
||||
|
@ -49,6 +49,7 @@ extern "C" {
|
||||
|
||||
#define FSP_FUSE_CAP_READDIR_PLUS (1 << 21) /* file system supports enhanced readdir */
|
||||
#define FSP_FUSE_CAP_READ_ONLY (1 << 22) /* file system is marked read-only */
|
||||
#define FSP_FUSE_CAP_STAT_EX (1 << 23) /* file system supports fuse_stat_ex */
|
||||
#define FSP_FUSE_CAP_CASE_INSENSITIVE FUSE_CAP_CASE_INSENSITIVE
|
||||
|
||||
#define FUSE_IOCTL_COMPAT (1 << 0)
|
||||
@ -56,6 +57,24 @@ extern "C" {
|
||||
#define FUSE_IOCTL_RETRY (1 << 2)
|
||||
#define FUSE_IOCTL_MAX_IOV 256
|
||||
|
||||
/* from FreeBSD */
|
||||
#define FSP_FUSE_UF_HIDDEN 0x00008000
|
||||
#define FSP_FUSE_UF_READONLY 0x00001000
|
||||
#define FSP_FUSE_UF_SYSTEM 0x00000080
|
||||
#define FSP_FUSE_UF_ARCHIVE 0x00000800
|
||||
#if !defined(UF_HIDDEN)
|
||||
#define UF_HIDDEN FSP_FUSE_UF_HIDDEN
|
||||
#endif
|
||||
#if !defined(UF_READONLY)
|
||||
#define UF_READONLY FSP_FUSE_UF_READONLY
|
||||
#endif
|
||||
#if !defined(UF_SYSTEM)
|
||||
#define UF_SYSTEM FSP_FUSE_UF_SYSTEM
|
||||
#endif
|
||||
#if !defined(UF_ARCHIVE)
|
||||
#define UF_ARCHIVE FSP_FUSE_UF_ARCHIVE
|
||||
#endif
|
||||
|
||||
struct fuse_file_info
|
||||
{
|
||||
int flags;
|
||||
@ -85,6 +104,9 @@ struct fuse_conn_info
|
||||
struct fuse_session;
|
||||
struct fuse_chan;
|
||||
struct fuse_pollhandle;
|
||||
struct fuse_bufvec;
|
||||
struct fuse_statfs;
|
||||
struct fuse_setattr_x;
|
||||
|
||||
FSP_FUSE_API int FSP_FUSE_API_NAME(fsp_fuse_version)(struct fsp_fuse_env *env);
|
||||
FSP_FUSE_API struct fuse_chan *FSP_FUSE_API_NAME(fsp_fuse_mount)(struct fsp_fuse_env *env,
|
||||
|
@ -65,6 +65,22 @@ extern "C" {
|
||||
* to be usable from Cygwin.
|
||||
*/
|
||||
|
||||
#define FSP_FUSE_STAT_FIELD_DEFN \
|
||||
fuse_dev_t st_dev; \
|
||||
fuse_ino_t st_ino; \
|
||||
fuse_mode_t st_mode; \
|
||||
fuse_nlink_t st_nlink; \
|
||||
fuse_uid_t st_uid; \
|
||||
fuse_gid_t st_gid; \
|
||||
fuse_dev_t st_rdev; \
|
||||
fuse_off_t st_size; \
|
||||
struct fuse_timespec st_atim; \
|
||||
struct fuse_timespec st_mtim; \
|
||||
struct fuse_timespec st_ctim; \
|
||||
fuse_blksize_t st_blksize; \
|
||||
fuse_blkcnt_t st_blocks; \
|
||||
struct fuse_timespec st_birthtim;
|
||||
|
||||
#if defined(_WIN64) || defined(_WIN32)
|
||||
|
||||
typedef uint32_t fuse_uid_t;
|
||||
@ -113,20 +129,7 @@ struct fuse_timespec
|
||||
|
||||
struct fuse_stat
|
||||
{
|
||||
fuse_dev_t st_dev;
|
||||
fuse_ino_t st_ino;
|
||||
fuse_mode_t st_mode;
|
||||
fuse_nlink_t st_nlink;
|
||||
fuse_uid_t st_uid;
|
||||
fuse_gid_t st_gid;
|
||||
fuse_dev_t st_rdev;
|
||||
fuse_off_t st_size;
|
||||
struct fuse_timespec st_atim;
|
||||
struct fuse_timespec st_mtim;
|
||||
struct fuse_timespec st_ctim;
|
||||
fuse_blksize_t st_blksize;
|
||||
fuse_blkcnt_t st_blocks;
|
||||
struct fuse_timespec st_birthtim;
|
||||
FSP_FUSE_STAT_FIELD_DEFN
|
||||
};
|
||||
|
||||
#if defined(_WIN64)
|
||||
@ -246,6 +249,13 @@ struct fuse_flock
|
||||
#error unsupported environment
|
||||
#endif
|
||||
|
||||
struct fuse_stat_ex
|
||||
{
|
||||
FSP_FUSE_STAT_FIELD_DEFN
|
||||
uint32_t st_flags;
|
||||
uint64_t st_reserved[3];
|
||||
};
|
||||
|
||||
struct fsp_fuse_env
|
||||
{
|
||||
unsigned environment;
|
||||
|
Reference in New Issue
Block a user