From 4ba65eaa74265542b2ce0f607f950ffbf521b9cd Mon Sep 17 00:00:00 2001 From: Graham Inggs Date: Wed, 15 Sep 2021 20:58:49 +0200 Subject: [PATCH] cmsfs-fuse: fix compiler warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Compiling against fuse3 shows 'incompatible pointer type' warnings due to the additional function arguments in the new API. Therefore, adjust the declarations of cmsfs_getattr(), cmsfs_readdir(), cmsfs_utimens(), cmsfs_rename() and cmsfs_truncate() to match. GitHub-ID: https://github.com/ibm-s390-linux/s390-tools/pull/117 Signed-off-by: Graham Inggs Signed-off-by: Jan Höppner --- cmsfs-fuse/cmsfs-fuse.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/cmsfs-fuse/cmsfs-fuse.c b/cmsfs-fuse/cmsfs-fuse.c index 1a8a6713..4e0095fc 100644 --- a/cmsfs-fuse/cmsfs-fuse.c +++ b/cmsfs-fuse/cmsfs-fuse.c @@ -1728,8 +1728,11 @@ static off_t get_file_size_logical(struct fst_entry *fst) return total; } -static int cmsfs_getattr(const char *path, struct stat *stbuf) +static int cmsfs_getattr(const char *path, struct stat *stbuf, + struct fuse_file_info *fi) { + (void) fi; + int mask = (cmsfs.allow_other) ? 0444 : 0440; struct fst_entry fst; @@ -1783,13 +1786,15 @@ static int cmsfs_getattr(const char *path, struct stat *stbuf) } static int cmsfs_readdir(const char *path, void *buf, fuse_fill_dir_t filler, - off_t offset, struct fuse_file_info *fi) + off_t offset, struct fuse_file_info *fi, + enum fuse_readdir_flags flags) { struct walk_file walk; struct fst_entry fst; (void) offset; (void) fi; + (void) flags; /* * Offset is ignored and 0 passed to the filler fn so the whole @@ -2683,13 +2688,16 @@ static int cmsfs_statfs(const char *path, struct statvfs *buf) return 0; } -static int cmsfs_utimens(const char *path, const struct timespec ts[2]) +static int cmsfs_utimens(const char *path, const struct timespec ts[2], + struct fuse_file_info *fi) { struct fst_entry fst; off_t fst_addr; struct tm tm; int rc; + (void) fi; + if (cmsfs.readonly) return -EACCES; @@ -2825,7 +2833,8 @@ error: return rc; } -static int cmsfs_rename(const char *path, const char *new_path) +static int cmsfs_rename(const char *path, const char *new_path, + unsigned int flags) { struct fst_entry fst, fst_new; off_t fst_addr, fst_addr_new; @@ -2835,6 +2844,8 @@ static int cmsfs_rename(const char *path, const char *new_path) struct file *f; int rc; + (void) flags; + if (cmsfs.readonly) return -EACCES; @@ -3232,13 +3243,16 @@ static void update_fst(struct file *f, off_t addr) unhide_null_blocks(f); } -static int cmsfs_truncate(const char *path, off_t size) +static int cmsfs_truncate(const char *path, off_t size, + struct fuse_file_info *fi) { struct fst_entry fst; off_t fst_addr, len; struct file *f; int rc = 0; + (void) fi; + if (cmsfs.readonly) return -EROFS;