From: Ralf Hoffmann <ralf@...>
Subject: Re: [AVFS] avfs on Linux 2.6 Newsgroups: gmane.comp.file-systems.avfs.user Date: 2005-06-30 12:51:44 GMT (20 weeks, 2 days, 19 hours and 42 minutes ago) Hi, On 2005-06-30 13:54, romildo@... wrote: > Two hunks have failed when applying the patch to > avfs-0.9.5. One concerns debuging, as you noted. > The other rejected hunk is attached. It seems to > already be in the code. But I am not sure. Please, > take a look at it. The rejected hunk you attached is the one I meant. The other failed hunk probably causes the problems you noticed. I updated the patch so it will apply to avfs 0.9.5 without any problem, please try the attached patch. > Is this the same error you have got? No, I got this error: In file included from /usr/include/linux/coda.h:102, from mount.c:16: /usr/include/linux/time.h:9: error: redefinition of `struct timespec' /usr/include/linux/time.h:15: error: redefinition of `struct timeval' >>If we can use avfs over fuse I don't see any need for the >>avfscoda anymore. > > And can we use avfs over fuse? I can't tell much about fuse but as Miklos said the code in the CVS is experimental. If I understand it correctly the biggest problem is the mount point. With avfscoda you can use /overlay and I think you could use fuse to mount an avfs server or something to some mount point. But in both cases virtual files can only be accessed through this mount point. This is not as convenient as the old redir code which redirects all file accesses to the /overlay mount point. Best Regards, Ralf Hoffmann -- Homepage: http://www.boomerangsworld.de E-Mail: Ralf Hoffmann <ralf@...> english or german diff -purN avfs-0.9.5/avfscoda/avfscoda.h avfs-0.9.5-new/avfscoda/avfscoda.h --- avfs-0.9.5/avfscoda/avfscoda.h 2001-05-11 19:29:01.000000000 +0200 +++ avfs-0.9.5-new/avfscoda/avfscoda.h 2005-06-30 14:23:53.000000000 +0200 <at> <at> -14,6 +14,12 <at> <at> struct child_message { int path2size; }; +struct AvfsFid { /* maps the content of opaque CodaFid for Avfs */ + u_int32_t Unused0; + u_int32_t Unused1; + u_int32_t Unused2; + u_int32_t Unique; +}; extern void run(int cfs, const char *codadir, int dm); extern void child_process(int infd, int outfd); diff -purN avfs-0.9.5/avfscoda/child.c avfs-0.9.5-new/avfscoda/child.c --- avfs-0.9.5/avfscoda/child.c 2001-10-24 11:51:24.000000000 +0200 +++ avfs-0.9.5-new/avfscoda/child.c 2005-06-30 14:23:53.000000000 +0200 <at> <at> -16,8 +16,8 <at> <at> #include <errno.h> #include <fcntl.h> #include <pthread.h> - #include <sys/stat.h> +#include <signal.h> /* #include "KERNINCLUDE/linux/coda.h" */ #include CODAINCLUDE <at> <at> -59,7 +59,7 <at> <at> static int st2type(struct stat *s) } -static void st2attr(struct stat *s, struct coda_vattr *a, ViceFid *id) +static void st2attr(struct stat *s, struct coda_vattr *a, struct CodaFid *id) { memset(a, 0, sizeof(struct coda_vattr)); a->va_type = st2type(s); <at> <at> -434,10 +434,12 <at> <at> void *process_request(void *arg) if(ret == -1) rep->oh.result = errno; else { + struct AvfsFid *id = (struct AvfsFid *)&rep->coda_lookup.VFid; /* We don't know these */ - rep->coda_lookup.VFid.Volume = 0; - rep->coda_lookup.VFid.Vnode = 0; - rep->coda_lookup.VFid.Unique = 0; + id->Unused0 = 0; + id->Unused1 = 0; + id->Unused2 = 0; + id->Unique = 0; rep->coda_lookup.vtype = st2type(&stbuf); } break; diff -purN avfs-0.9.5/avfscoda/dispatch.c avfs-0.9.5-new/avfscoda/dispatch.c --- avfs-0.9.5/avfscoda/dispatch.c 2004-03-27 17:48:42.000000000 +0100 +++ avfs-0.9.5-new/avfscoda/dispatch.c 2005-06-30 14:25:20.000000000 +0200 <at> <at> -98,6 +98,7 <at> <at> struct fileinfo { struct openfile *ofs; }; + #define FMAPSIZE 65536 static struct fileinfo *fmap[FMAPSIZE]; static unsigned int nextunique = 0; <at> <at> -319,13 +320,17 <at> <at> static struct fileinfo *get_info(unsigne return fi; } -static struct fileinfo *look_info(ViceFid *id) +static struct fileinfo *look_info(struct CodaFid *cid) { + struct AvfsFid *id = (struct AvfsFid *)cid; struct fileinfo *fi; - if ((id->Volume != 0) || (id->Vnode != 0)) { - logerr("Bad handle passed %lx/%lx/%lx\n", - id->Volume, id->Vnode, id->Unique ); + if ((id->Unused0 != 0) || (id->Unused1 != 0) || (id->Unused2 != 0)) { + logerr("Bad handle passed %lx/%lx/%lx/%lx\n", + (long unsigned int)id->Unused0, + (long unsigned int)id->Unused1, + (long unsigned int)id->Unused2, + (long unsigned int)id->Unique ); clean_exit(1); } <at> <at> -345,7 +350,7 <at> <at> static struct fileinfo *look_info(ViceFi } } -static char *look_name(ViceFid *id) +static char *look_name(struct CodaFid *id) { struct fileinfo *fi; <at> <at> -358,7 +363,7 <at> <at> static char *look_name(ViceFid *id) return fi->path; } -static void ref_fid(ViceFid *fid) +static void ref_fid(struct CodaFid *fid) { struct fileinfo *fi = look_info(fid); <at> <at> -366,7 +371,7 <at> <at> static void ref_fid(ViceFid *fid) fi->use ++; } -static void unref_fid(ViceFid *fid) +static void unref_fid(struct CodaFid *fid) { struct fileinfo *fi = look_info(fid); <at> <at> -398,9 +403,10 <at> <at> static void send_to_kernel(union outputA } } -static struct fileinfo *create_file(const char *filename, ViceFid *parentid, - ViceFid *newid) +static struct fileinfo *create_file(const char *filename, struct CodaFid *parentid, + struct CodaFid *newcid) { + struct AvfsFid *newid = (struct AvfsFid *)newcid; struct fileinfo *fi; fi = look_info(parentid); <at> <at> -408,8 +414,9 <at> <at> static struct fileinfo *create_file(cons return NULL; fi = get_file(fi, filename); - newid->Volume = 0; - newid->Vnode = 0; + newid->Unused0 = 0; + newid->Unused1 = 0; + newid->Unused2 = 0; newid->Unique = fi->unique; return fi; <at> <at> -418,6 +425,7 <at> <at> static struct fileinfo *create_file(cons static void purge_file(struct fileinfo *fi) { union outputArgs rep; + struct AvfsFid *id; log("=================================================================\n"); log_date(); <at> <at> -427,15 +435,18 <at> <at> static void purge_file(struct fileinfo * rep.oh.opcode = CODA_PURGEFID; rep.oh.result = 0; rep.oh.unique = 0; - rep.coda_purgefid.CodaFid.Volume = 0; - rep.coda_purgefid.CodaFid.Vnode = 0; - rep.coda_purgefid.CodaFid.Unique = fi->unique; + id = (struct AvfsFid *)&rep.coda_purgefid.CodaFid; + id->Unused0 = 0; + id->Unused1 = 0; + id->Unused2 = 0; + id->Unique = fi->unique; send_to_kernel(&rep, sizeof(rep.coda_purgefid)); } static void zap_file(struct fileinfo *fi) { + struct AvfsFid *id; union outputArgs rep; log("=================================================================\n"); <at> <at> -446,9 +457,11 <at> <at> static void zap_file(struct fileinfo *fi rep.oh.opcode = CODA_ZAPFILE; rep.oh.result = 0; rep.oh.unique = 0; - rep.coda_zapfile.CodaFid.Volume = 0; - rep.coda_zapfile.CodaFid.Vnode = 0; - rep.coda_zapfile.CodaFid.Unique = fi->unique; + id = (struct AvfsFid *)&rep.coda_zapfile.CodaFid; + id->Unused0 = 0; + id->Unused1 = 0; + id->Unused2 = 0; + id->Unique = fi->unique; send_to_kernel(&rep, sizeof(rep.coda_zapfile)); } <at> <at> -582,7 +595,7 <at> <at> static void del_file(const char *tmpname } static void close_file(struct openfile *of, struct openfile **ofp, - ViceFid *fid) + struct CodaFid *fid) { if(of->use > 0) of->use --; <at> <at> -681,7 +694,10 <at> <at> static void process_answer(struct userin user->uid, user->gid, user->serverpid); log_date(); log("%i (%i) bytes: opcode: %li, result: %i, unique: %li\n", - numread, insize, rep->oh.opcode, (int) rep->oh.result, rep->oh.unique); + numread, insize, + (unsigned long int)rep->oh.opcode, + (unsigned int)rep->oh.result, + (unsigned long int)rep->oh.unique); for(opp = &user->ops; *opp != NULL; opp = &(*opp)->next) if((*opp)->req->ih.unique == rep->oh.unique) break; <at> <at> -691,7 +707,7 <at> <at> static void process_answer(struct userin if(op == NULL) logerr("Operation not found!!!!\n"); else { - log("Found operation: %li\n", op->req->ih.unique); + log("Found operation: %li\n", (unsigned long int)op->req->ih.unique); switch(rep->oh.opcode) { #ifdef CODA_OPEN_BY_FD <at> <at> -819,7 +835,7 <at> <at> static void process_answer(struct userin if(user->ops != NULL) { log("Remaining operations: "); for(op = user->ops; op != NULL; op = op->next) - log("%li ", op->req->ih.unique); + log("%li ", (unsigned long int)op->req->ih.unique); log("\n"); } } <at> <at> -1058,8 +1074,8 <at> <at> static void send_to_child(union inputArg char *path2) { struct operation *op; - uid_t uid = req->ih.cred.cr_fsuid; - gid_t gid = req->ih.cred.cr_fsgid; + uid_t uid = req->ih.uid; + gid_t gid = req->ih.pgid; struct userinfo *user; int msgsize; struct child_message msg; <at> <at> -1109,7 +1125,7 <at> <at> static void send_to_child(union inputArg memcpy(mp, req, msg.reqsize); mp += msg.reqsize; - log("****** opcode: %li\n", req->ih.opcode); + log("****** opcode: %li\n", (unsigned long int)req->ih.opcode); log("****** msgsize: %i, msgoff: %i, msg.reqsize: %i, \n", msgsize, msgoff, msg.reqsize); <at> <at> -1140,7 +1156,7 <at> <at> static void send_to_child(union inputArg } static void send_with_path(union inputArgs *req, int reqsize, char *filename, - ViceFid *id, char *path2) + struct CodaFid *id, char *path2) { char pathbuf[1024]; struct fileinfo *fi; <at> <at> -1239,19 +1255,25 <at> <at> static void process_kernel_req() log("=================================================================\n"); log_date(); log("%i bytes: opcode: %li, unique: %li\n", - numread, req->ih.opcode, req->ih.unique); + numread, + (unsigned long int)req->ih.opcode, + (unsigned long int)req->ih.unique); switch (req->ih.opcode) { case CODA_ROOT: log("CODA_ROOT\n"); - + rep.oh.opcode = req->ih.opcode; rep.oh.unique = req->ih.unique; rep.oh.result = 0; - rep.coda_root.VFid.Volume = 0; - rep.coda_root.VFid.Vnode = 0; - rep.coda_root.VFid.Unique = 0; /* 0 means root */ - + { + struct AvfsFid *fid; + fid = (struct AvfsFid *)&rep.coda_root.VFid; + fid->Unused0 = 0; + fid->Unused1 = 0; + fid->Unused2 = 0; + fid->Unique = 0; /* 0 means root */ + } send_to_kernel(&rep, sizeof(rep.coda_root)); break; <at> <at> -1312,7 +1334,7 <at> <at> static void process_kernel_req() reply(req, ENFILE); } else { - fchown(fd, req->ih.cred.cr_fsuid, req->ih.cred.cr_fsgid); + fchown(fd, req->ih.uid, req->ih.pgid); close(fd); of = malloc(sizeof(struct openfile)); <at> <at> -1522,7 +1544,8 <at> <at> static void process_kernel_req() break; - default:; + default: + logerr("Unknown opcode!!!!\n"); } release_fids(op->req); |