📄 vfs.h
字号:
int (*sys_acl_get_tag_type)(struct vfs_handle_struct *handle, struct connection_struct *conn, SMB_ACL_ENTRY_T entry_d, SMB_ACL_TAG_T *tag_type_p); int (*sys_acl_get_permset)(struct vfs_handle_struct *handle, struct connection_struct *conn, SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T *permset_p); void * (*sys_acl_get_qualifier)(struct vfs_handle_struct *handle, struct connection_struct *conn, SMB_ACL_ENTRY_T entry_d); SMB_ACL_T (*sys_acl_get_file)(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *path_p, SMB_ACL_TYPE_T type); SMB_ACL_T (*sys_acl_get_fd)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd); int (*sys_acl_clear_perms)(struct vfs_handle_struct *handle, struct connection_struct *conn, SMB_ACL_PERMSET_T permset); int (*sys_acl_add_perm)(struct vfs_handle_struct *handle, struct connection_struct *conn, SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm); char * (*sys_acl_to_text)(struct vfs_handle_struct *handle, struct connection_struct *conn, SMB_ACL_T theacl, ssize_t *plen); SMB_ACL_T (*sys_acl_init)(struct vfs_handle_struct *handle, struct connection_struct *conn, int count); int (*sys_acl_create_entry)(struct vfs_handle_struct *handle, struct connection_struct *conn, SMB_ACL_T *pacl, SMB_ACL_ENTRY_T *pentry); int (*sys_acl_set_tag_type)(struct vfs_handle_struct *handle, struct connection_struct *conn, SMB_ACL_ENTRY_T entry, SMB_ACL_TAG_T tagtype); int (*sys_acl_set_qualifier)(struct vfs_handle_struct *handle, struct connection_struct *conn, SMB_ACL_ENTRY_T entry, void *qual); int (*sys_acl_set_permset)(struct vfs_handle_struct *handle, struct connection_struct *conn, SMB_ACL_ENTRY_T entry, SMB_ACL_PERMSET_T permset); int (*sys_acl_valid)(struct vfs_handle_struct *handle, struct connection_struct *conn, SMB_ACL_T theacl ); int (*sys_acl_set_file)(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *name, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl); int (*sys_acl_set_fd)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, SMB_ACL_T theacl); int (*sys_acl_delete_def_file)(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *path); int (*sys_acl_get_perm)(struct vfs_handle_struct *handle, struct connection_struct *conn, SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm); int (*sys_acl_free_text)(struct vfs_handle_struct *handle, struct connection_struct *conn, char *text); int (*sys_acl_free_acl)(struct vfs_handle_struct *handle, struct connection_struct *conn, SMB_ACL_T posix_acl); int (*sys_acl_free_qualifier)(struct vfs_handle_struct *handle, struct connection_struct *conn, void *qualifier, SMB_ACL_TAG_T tagtype); /* EA operations. */ ssize_t (*getxattr)(struct vfs_handle_struct *handle,struct connection_struct *conn,const char *path, const char *name, void *value, size_t size); ssize_t (*lgetxattr)(struct vfs_handle_struct *handle,struct connection_struct *conn,const char *path, const char *name, void *value, size_t size); ssize_t (*fgetxattr)(struct vfs_handle_struct *handle, struct files_struct *fsp,int fd, const char *name, void *value, size_t size); ssize_t (*listxattr)(struct vfs_handle_struct *handle, struct connection_struct *conn,const char *path, char *list, size_t size); ssize_t (*llistxattr)(struct vfs_handle_struct *handle, struct connection_struct *conn,const char *path, char *list, size_t size); ssize_t (*flistxattr)(struct vfs_handle_struct *handle, struct files_struct *fsp,int fd, char *list, size_t size); int (*removexattr)(struct vfs_handle_struct *handle, struct connection_struct *conn,const char *path, const char *name); int (*lremovexattr)(struct vfs_handle_struct *handle, struct connection_struct *conn,const char *path, const char *name); int (*fremovexattr)(struct vfs_handle_struct *handle, struct files_struct *fsp,int filedes, const char *name); int (*setxattr)(struct vfs_handle_struct *handle, struct connection_struct *conn,const char *path, const char *name, const void *value, size_t size, int flags); int (*lsetxattr)(struct vfs_handle_struct *handle, struct connection_struct *conn,const char *path, const char *name, const void *value, size_t size, int flags); int (*fsetxattr)(struct vfs_handle_struct *handle, struct files_struct *fsp,int filedes, const char *name, const void *value, size_t size, int flags); /* aio operations */ int (*aio_read)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb); int (*aio_write)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb); ssize_t (*aio_return_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb); int (*aio_cancel)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, SMB_STRUCT_AIOCB *aiocb); int (*aio_error_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb); int (*aio_fsync)(struct vfs_handle_struct *handle, struct files_struct *fsp, int op, SMB_STRUCT_AIOCB *aiocb); int (*aio_suspend)(struct vfs_handle_struct *handle, struct files_struct *fsp, const SMB_STRUCT_AIOCB * const aiocb[], int n, const struct timespec *timeout); } ops; struct vfs_handles_pointers { /* Disk operations */ struct vfs_handle_struct *connect_hnd; struct vfs_handle_struct *disconnect; struct vfs_handle_struct *disk_free; struct vfs_handle_struct *get_quota; struct vfs_handle_struct *set_quota; struct vfs_handle_struct *get_shadow_copy_data; struct vfs_handle_struct *statvfs; /* Directory operations */ struct vfs_handle_struct *opendir; struct vfs_handle_struct *readdir; struct vfs_handle_struct *seekdir; struct vfs_handle_struct *telldir; struct vfs_handle_struct *rewind_dir; struct vfs_handle_struct *mkdir; struct vfs_handle_struct *rmdir; struct vfs_handle_struct *closedir; /* File operations */ struct vfs_handle_struct *open; struct vfs_handle_struct *close_hnd; struct vfs_handle_struct *read; struct vfs_handle_struct *pread; struct vfs_handle_struct *write; struct vfs_handle_struct *pwrite; struct vfs_handle_struct *lseek; struct vfs_handle_struct *sendfile; struct vfs_handle_struct *rename; struct vfs_handle_struct *fsync; struct vfs_handle_struct *stat; struct vfs_handle_struct *fstat; struct vfs_handle_struct *lstat; struct vfs_handle_struct *unlink; struct vfs_handle_struct *chmod; struct vfs_handle_struct *fchmod; struct vfs_handle_struct *chown; struct vfs_handle_struct *fchown; struct vfs_handle_struct *chdir; struct vfs_handle_struct *getwd; struct vfs_handle_struct *utime; struct vfs_handle_struct *ftruncate; struct vfs_handle_struct *lock; struct vfs_handle_struct *symlink; struct vfs_handle_struct *readlink; struct vfs_handle_struct *link; struct vfs_handle_struct *mknod; struct vfs_handle_struct *realpath; /* NT ACL operations. */ struct vfs_handle_struct *fget_nt_acl; struct vfs_handle_struct *get_nt_acl; struct vfs_handle_struct *fset_nt_acl; struct vfs_handle_struct *set_nt_acl; /* POSIX ACL operations. */ struct vfs_handle_struct *chmod_acl; struct vfs_handle_struct *fchmod_acl; struct vfs_handle_struct *sys_acl_get_entry; struct vfs_handle_struct *sys_acl_get_tag_type; struct vfs_handle_struct *sys_acl_get_permset; struct vfs_handle_struct *sys_acl_get_qualifier; struct vfs_handle_struct *sys_acl_get_file; struct vfs_handle_struct *sys_acl_get_fd; struct vfs_handle_struct *sys_acl_clear_perms; struct vfs_handle_struct *sys_acl_add_perm; struct vfs_handle_struct *sys_acl_to_text; struct vfs_handle_struct *sys_acl_init; struct vfs_handle_struct *sys_acl_create_entry; struct vfs_handle_struct *sys_acl_set_tag_type; struct vfs_handle_struct *sys_acl_set_qualifier; struct vfs_handle_struct *sys_acl_set_permset; struct vfs_handle_struct *sys_acl_valid; struct vfs_handle_struct *sys_acl_set_file; struct vfs_handle_struct *sys_acl_set_fd; struct vfs_handle_struct *sys_acl_delete_def_file; struct vfs_handle_struct *sys_acl_get_perm; struct vfs_handle_struct *sys_acl_free_text; struct vfs_handle_struct *sys_acl_free_acl; struct vfs_handle_struct *sys_acl_free_qualifier; /* EA operations. */ struct vfs_handle_struct *getxattr; struct vfs_handle_struct *lgetxattr; struct vfs_handle_struct *fgetxattr; struct vfs_handle_struct *listxattr; struct vfs_handle_struct *llistxattr; struct vfs_handle_struct *flistxattr; struct vfs_handle_struct *removexattr; struct vfs_handle_struct *lremovexattr; struct vfs_handle_struct *fremovexattr; struct vfs_handle_struct *setxattr; struct vfs_handle_struct *lsetxattr; struct vfs_handle_struct *fsetxattr; /* aio operations */ struct vfs_handle_struct *aio_read; struct vfs_handle_struct *aio_write; struct vfs_handle_struct *aio_return; struct vfs_handle_struct *aio_cancel; struct vfs_handle_struct *aio_error; struct vfs_handle_struct *aio_fsync; struct vfs_handle_struct *aio_suspend; } handles;};/* Possible VFS operation layers (per-operation) These values are used by VFS subsystem when building vfs_ops for connection from multiple VFS modules. Internally, Samba differentiates only opaque and transparent layers at this process. Other types are used for providing better diagnosing facilities. Most modules will provide transparent layers. Opaque layer is for modules which implement actual file system calls (like DB-based VFS). For example, default POSIX VFS which is built in into Samba is an opaque VFS module. Other layer types (audit, splitter, scanner) were designed to provide different degree of transparency and for diagnosing VFS module behaviour. Each module can implement several layers at the same time provided that only one layer is used per each operation. */typedef enum _vfs_op_layer { SMB_VFS_LAYER_NOOP = -1, /* - For using in VFS module to indicate end of array */ /* of operations description */ SMB_VFS_LAYER_OPAQUE = 0, /* - Final level, does not call anything beyond itself */ SMB_VFS_LAYER_TRANSPARENT, /* - Normal operation, calls underlying layer after */ /* possibly changing passed data */ SMB_VFS_LAYER_LOGGER, /* - Logs data, calls underlying layer, logging may not */ /* use Samba VFS */ SMB_VFS_LAYER_SPLITTER, /* - Splits operation, calls underlying layer _and_ own facility, */ /* then combines result */ SMB_VFS_LAYER_SCANNER /* - Checks data and possibly initiates additional */ /* file activity like logging to files _inside_ samba VFS */} vfs_op_layer;/* VFS operation description. Each VFS module registers an array of vfs_op_tuple to VFS subsystem, which describes all operations this module is willing to intercept. VFS subsystem initializes then the conn->vfs_ops and conn->vfs_opaque_ops structs using this information.*/typedef struct vfs_op_tuple { void* op; vfs_op_type type; vfs_op_layer layer;} vfs_op_tuple;typedef struct vfs_handle_struct { struct vfs_handle_struct *next, *prev; const char *param; struct vfs_ops vfs_next; struct connection_struct *conn; void *data; void (*free_data)(void **data);} vfs_handle_struct;typedef struct vfs_statvfs_struct { /* For undefined recommended transfer size return -1 in that field */ uint32 OptimalTransferSize; /* bsize on some os, iosize on other os */ uint32 BlockSize; /* The next three fields are in terms of the block size. (above). If block size is unknown, 4096 would be a reasonable block size for a server to report. Note that returning the blocks/blocksavail removes need to make a second call (to QFSInfo level 0x103 to get this info. UserBlockAvail is typically less than or equal to BlocksAvail, if no distinction is made return the same value in each. */ SMB_BIG_UINT TotalBlocks; SMB_BIG_UINT BlocksAvail; /* bfree */ SMB_BIG_UINT UserBlocksAvail; /* bavail */ /* For undefined Node fields or FSID return -1 */ SMB_BIG_UINT TotalFileNodes; SMB_BIG_UINT FreeFileNodes; SMB_BIG_UINT FsIdentifier; /* fsid */ /* NB Namelen comes from FILE_SYSTEM_ATTRIBUTE_INFO call */ /* NB flags can come from FILE_SYSTEM_DEVICE_INFO call */} vfs_statvfs_struct;#define SMB_VFS_HANDLE_GET_DATA(handle, datap, type, ret) { \ if (!(handle)||((datap=(type *)(handle)->data)==NULL)) { \ DEBUG(0,("%s() failed to get vfs_handle->data!\n",FUNCTION_MACRO)); \ ret; \ } \}#define SMB_VFS_HANDLE_SET_DATA(handle, datap, free_fn, type, ret) { \ if (!(handle)) { \ DEBUG(0,("%s() failed to set handle->data!\n",FUNCTION_MACRO)); \ ret; \ } else { \ if ((handle)->free_data) { \ (handle)->free_data(&(handle)->data); \ } \ (handle)->data = (void *)datap; \ (handle)->free_data = free_fn; \ } \}#define SMB_VFS_HANDLE_FREE_DATA(handle) { \ if ((handle) && (handle)->free_data) { \ (handle)->free_data(&(handle)->data); \ } \}/* Check whether module-specific data handle was already allocated or not */#define SMB_VFS_HANDLE_TEST_DATA(handle) ( !(handle) || !(handle)->data ? False : True )#define SMB_VFS_OP(x) ((void *) x)#include "vfs_macros.h"#endif /* _VFS_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -