diff options
author | Miklos Szeredi <miklos@szeredi.hu> | 2002-10-28 08:49:39 +0000 |
---|---|---|
committer | Miklos Szeredi <miklos@szeredi.hu> | 2002-10-28 08:49:39 +0000 |
commit | 6bf8b68e0ee6596e8b5f0e53656a078bc5e579ba (patch) | |
tree | 2b9febaa21ce38a144e0db088c86acb1677f2b56 | |
parent | 8b39a9f1b7517dac6b9b69daf200948fb96ca4cf (diff) | |
download | libfuse-6bf8b68e0ee6596e8b5f0e53656a078bc5e579ba.tar.gz |
Portability fix
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | include/linux/fuse.h | 5 | ||||
-rw-r--r-- | lib/fuse.c | 15 |
3 files changed, 12 insertions, 12 deletions
@@ -1,3 +1,7 @@ +2002-10-28 Miklos Szeredi <mszeredi@inf.bme.hu> + + * Portablility fix (bug reported by C. Chris Erway) + 2002-10-25 Miklos Szeredi <mszeredi@inf.bme.hu> * Use Mark Glines' fd passing method for default operation instead diff --git a/include/linux/fuse.h b/include/linux/fuse.h index b6f41db..24905c4 100644 --- a/include/linux/fuse.h +++ b/include/linux/fuse.h @@ -119,7 +119,6 @@ struct fuse_getdir_out { struct fuse_mknod_in { unsigned short mode; unsigned short rdev; - char name[0]; }; struct fuse_mknod_out { @@ -129,17 +128,14 @@ struct fuse_mknod_out { struct fuse_mkdir_in { unsigned short mode; - char name[0]; }; struct fuse_rename_in { unsigned long newdir; - char names[0]; }; struct fuse_link_in { unsigned long newdir; - char name[0]; }; struct fuse_setattr_in { @@ -163,7 +159,6 @@ struct fuse_read_in { struct fuse_write_in { unsigned long long offset; unsigned int size; - char buf[0]; }; struct fuse_statfs_out { @@ -17,6 +17,7 @@ #include <sys/param.h> #define FUSE_MAX_PATH 4096 +#define PARAM(inarg) (((char *)(inarg)) + sizeof(*inarg)) static inline void inc_avail(struct fuse *f) { @@ -572,7 +573,7 @@ static void do_mknod(struct fuse *f, struct fuse_in_header *in, struct stat buf; res = -ENOENT; - path = get_path_name(f, in->ino, inarg->name); + path = get_path_name(f, in->ino, PARAM(inarg)); if(path != NULL) { res = -ENOSYS; if(f->op.mknod && f->op.getattr) { @@ -584,7 +585,7 @@ static void do_mknod(struct fuse *f, struct fuse_in_header *in, } if(res == 0) { convert_stat(&buf, &outarg.attr); - outarg.ino = find_node(f, in->ino, inarg->name, &outarg.attr, + outarg.ino = find_node(f, in->ino, PARAM(inarg), &outarg.attr, in->unique); } @@ -598,7 +599,7 @@ static void do_mkdir(struct fuse *f, struct fuse_in_header *in, char *path; res = -ENOENT; - path = get_path_name(f, in->ino, inarg->name); + path = get_path_name(f, in->ino, PARAM(inarg)); if(path != NULL) { res = -ENOSYS; if(f->op.mkdir) @@ -655,8 +656,8 @@ static void do_rename(struct fuse *f, struct fuse_in_header *in, int res; fino_t olddir = in->ino; fino_t newdir = inarg->newdir; - char *oldname = inarg->names; - char *newname = inarg->names + strlen(oldname) + 1; + char *oldname = PARAM(inarg); + char *newname = oldname + strlen(oldname) + 1; char *oldpath; char *newpath; @@ -687,7 +688,7 @@ static void do_link(struct fuse *f, struct fuse_in_header *in, res = -ENOENT; oldpath = get_path(f, in->ino); if(oldpath != NULL) { - newpath = get_path_name(f, arg->newdir, arg->name); + newpath = get_path_name(f, arg->newdir, PARAM(arg)); if(newpath != NULL) { res = -ENOSYS; if(f->op.link) @@ -774,7 +775,7 @@ static void do_write(struct fuse *f, struct fuse_in_header *in, res = -ENOSYS; if(f->op.write) - res = f->op.write(path, arg->buf, arg->size, arg->offset); + res = f->op.write(path, PARAM(arg), arg->size, arg->offset); free(path); } |