aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmd/sharefs
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-12-25 06:00:58 +0900
committerOphestra <cat@gensokyo.uk>2025-12-25 06:00:58 +0900
commitda2bb546ba5ccd1b282123e555e9577630d0ad90 (patch)
treee0e63530f9e72c9489c7919ca8134287b0449aa5 /cmd/sharefs
parent7bfbd5981025282007f09225e22e895523d7a7bf (diff)
cmd/sharefs: remove readlink
This filesystem does not support symbolic links, so readlink is not useful, and unreachable in this case because of the check in getattr. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'cmd/sharefs')
-rw-r--r--cmd/sharefs/fuse-helper.c13
-rw-r--r--cmd/sharefs/fuse-helper.h1
-rw-r--r--cmd/sharefs/fuse.go1
3 files changed, 0 insertions, 15 deletions
diff --git a/cmd/sharefs/fuse-helper.c b/cmd/sharefs/fuse-helper.c
index 7725b679..2c62c260 100644
--- a/cmd/sharefs/fuse-helper.c
+++ b/cmd/sharefs/fuse-helper.c
@@ -82,19 +82,6 @@ int sharefs_getattr(const char *pathname, struct stat *statbuf, struct fuse_file
return impl_getattr(ctx, statbuf);
}
-int sharefs_readlink(const char *pathname, char *buf, size_t bufsiz) {
- int res;
- struct fuse_context *ctx;
- struct sharefs_private *priv;
- GET_CONTEXT_PRIV(ctx, priv);
- MUST_TRANSLATE_PATHNAME(pathname);
-
- if ((res = readlinkat(priv->dirfd, pathname, buf, bufsiz - 1)) == -1)
- return -errno;
- buf[res] = '\0';
- return 0;
-}
-
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 fd;
DIR *dp;
diff --git a/cmd/sharefs/fuse-helper.h b/cmd/sharefs/fuse-helper.h
index fdcd1d5e..869df6bb 100644
--- a/cmd/sharefs/fuse-helper.h
+++ b/cmd/sharefs/fuse-helper.h
@@ -12,7 +12,6 @@ struct sharefs_private {
};
int sharefs_getattr(const char *pathname, struct stat *statbuf, struct fuse_file_info *fi);
-int sharefs_readlink(const char *pathname, char *buf, size_t bufsiz);
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);
diff --git a/cmd/sharefs/fuse.go b/cmd/sharefs/fuse.go
index ac276dd7..c9b24b27 100644
--- a/cmd/sharefs/fuse.go
+++ b/cmd/sharefs/fuse.go
@@ -240,7 +240,6 @@ func _main(argc int, argv **C.char) int {
// implemented in fuse-helper.c
getattr: closure(C.sharefs_getattr),
- readlink: closure(C.sharefs_readlink),
readdir: closure(C.sharefs_readdir),
mkdir: closure(C.sharefs_mkdir),
unlink: closure(C.sharefs_unlink),