diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-10-13 23:25:14 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-10-13 23:33:49 +0900 |
| commit | 612533ee40aaeb97247db551ecbfc5026eb3ca41 (patch) | |
| tree | 13ae364771f9bcf0def2b7401924d5b7c82af790 /cmd/sharefs/fuse-operations.h | |
| parent | fadb42ec8daeeb8a576582d274cd4aeb64e535c0 (diff) | |
all: use Linux kernel coding style
The Gitea web interface is no longer publicly accessible, so it no
longer matters that this code style does not render well on Gitea.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'cmd/sharefs/fuse-operations.h')
| -rw-r--r-- | cmd/sharefs/fuse-operations.h | 44 |
1 files changed, 29 insertions, 15 deletions
diff --git a/cmd/sharefs/fuse-operations.h b/cmd/sharefs/fuse-operations.h index 2150571a..fae181d1 100644 --- a/cmd/sharefs/fuse-operations.h +++ b/cmd/sharefs/fuse-operations.h @@ -6,29 +6,43 @@ #error This package requires libfuse >= v3.12 #endif -#define SHAREFS_MEDIA_RW_ID (1 << 10) - 1 /* owning gid presented to userspace */ -#define SHAREFS_PERM_DIR 0770 /* permission bits for directories presented to userspace */ -#define SHAREFS_PERM_REG 0660 /* permission bits for regular files presented to userspace */ -#define SHAREFS_FORBIDDEN_FLAGS O_DIRECT /* these open flags are cleared unconditionally */ +/* owning gid presented to userspace */ +#define SHAREFS_MEDIA_RW_ID (1 << 10) - 1 +/* permission bits for directories presented to userspace */ +#define SHAREFS_PERM_DIR 0770 +/* permission bits for regular files presented to userspace */ +#define SHAREFS_PERM_REG 0660 +/* these open flags are cleared unconditionally */ +#define SHAREFS_FORBIDDEN_FLAGS O_DIRECT /* sharefs_private is populated by sharefs_init and contains process-wide context */ struct sharefs_private { - int dirfd; /* source dirfd opened during sharefs_init */ - uintptr_t setup; /* cgo handle of opaque setup state */ + int dirfd; /* source dirfd opened during sharefs_init */ + uintptr_t setup; /* cgo handle of opaque setup state */ }; -int sharefs_getattr(const char *pathname, struct stat *statbuf, struct fuse_file_info *fi); -int sharefs_readdir(const char *pathname, void *buf, fuse_fill_dir_t filler, off_t offset, struct fuse_file_info *fi, enum fuse_readdir_flags flags); +int sharefs_getattr(const char *pathname, struct stat *statbuf, + struct fuse_file_info *fi); +int sharefs_readdir(const char *pathname, void *buf, fuse_fill_dir_t filler, + off_t offset, struct fuse_file_info *fi, + enum fuse_readdir_flags flags); int sharefs_mkdir(const char *pathname, mode_t mode); int sharefs_unlink(const char *pathname); int sharefs_rmdir(const char *pathname); -int sharefs_rename(const char *oldpath, const char *newpath, unsigned int flags); -int sharefs_truncate(const char *pathname, off_t length, struct fuse_file_info *fi); -int sharefs_utimens(const char *pathname, const struct timespec times[2], struct fuse_file_info *fi); -int sharefs_create(const char *pathname, mode_t mode, struct fuse_file_info *fi); +int sharefs_rename(const char *oldpath, const char *newpath, + unsigned int flags); +int sharefs_truncate(const char *pathname, off_t length, + struct fuse_file_info *fi); +int sharefs_utimens(const char *pathname, const struct timespec times[2], + struct fuse_file_info *fi); +int sharefs_create(const char *pathname, mode_t mode, + struct fuse_file_info *fi); int sharefs_open(const char *pathname, struct fuse_file_info *fi); -int sharefs_read(const char *pathname, char *buf, size_t count, off_t offset, struct fuse_file_info *fi); -int sharefs_write(const char *pathname, const char *buf, size_t count, off_t offset, struct fuse_file_info *fi); +int sharefs_read(const char *pathname, char *buf, size_t count, off_t offset, + struct fuse_file_info *fi); +int sharefs_write(const char *pathname, const char *buf, size_t count, + off_t offset, struct fuse_file_info *fi); int sharefs_statfs(const char *pathname, struct statvfs *statbuf); int sharefs_release(const char *pathname, struct fuse_file_info *fi); -int sharefs_fsync(const char *pathname, int datasync, struct fuse_file_info *fi); +int sharefs_fsync(const char *pathname, int datasync, + struct fuse_file_info *fi); |
