Print this page
6198 Let's EOL cachefs

*** 95,106 **** extern AUTH *nfs_create_ah(); extern enum snego_stat nfs_sec_nego(); #define MAXHOSTS 512 - #define MNTTYPE_CACHEFS "cachefs" - /* * host cache states */ #define NOHOST 0 #define GOODHOST 1 --- 95,104 ----
*** 129,139 **** typedef struct mfs_snego_t mfs_snego_t; static struct cache_entry *cache_head = NULL; rwlock_t cache_lock; /* protect the cache chain */ ! static enum nfsstat nfsmount(struct mapfs *, char *, char *, int, int, uid_t, action_list *); static int is_nfs_port(char *); static void netbuf_free(struct netbuf *); static int get_pathconf(CLIENT *, char *, char *, struct pathcnf **, int); --- 127,137 ---- typedef struct mfs_snego_t mfs_snego_t; static struct cache_entry *cache_head = NULL; rwlock_t cache_lock; /* protect the cache chain */ ! static enum nfsstat nfsmount(struct mapfs *, char *, char *, int, uid_t, action_list *); static int is_nfs_port(char *); static void netbuf_free(struct netbuf *); static int get_pathconf(CLIENT *, char *, char *, struct pathcnf **, int);
*** 234,244 **** uid_t uid, action_list **alpp) { struct mapfs *mfs, *mp; int err = -1; - int cached; action_list *alp; char *dir; alp = *alpp; --- 232,241 ----
*** 276,289 **** } } } } if (err) { - cached = strcmp(me->map_mounter, MNTTYPE_CACHEFS) == 0; dir = strdup(mfs->mfs_dir); err = nfsmount(mfs, mntpnt, me->map_mntopts, ! cached, overlay, uid, alp); if (err && trace > 1) { trace_prt(1, " Couldn't mount %s:%s, err=%d\n", mfs->mfs_host ? mfs->mfs_host : "", mfs->mfs_dir ? mfs->mfs_dir : dir, err); } --- 273,285 ---- } } } } if (err) { dir = strdup(mfs->mfs_dir); err = nfsmount(mfs, mntpnt, me->map_mntopts, ! overlay, uid, alp); if (err && trace > 1) { trace_prt(1, " Couldn't mount %s:%s, err=%d\n", mfs->mfs_host ? mfs->mfs_host : "", mfs->mfs_dir ? mfs->mfs_dir : dir, err); }
*** 637,647 **** static enum nfsstat nfsmount( struct mapfs *mfs_in, char *mntpnt, char *opts, ! int cached, int overlay, uid_t uid, action_list *alp) { CLIENT *cl; char remname[MAXPATHLEN], *mnttabtext = NULL; --- 633,643 ---- static enum nfsstat nfsmount( struct mapfs *mfs_in, char *mntpnt, char *opts, ! int overlay, uid_t uid, action_list *alp) { CLIENT *cl; char remname[MAXPATHLEN], *mnttabtext = NULL;
*** 713,729 **** syslog(LOG_WARNING, "mount on %s is not read-only and will not be replicated.", mntpnt); replicated = 0; } - if (replicated && cached) { - if (verbose) - syslog(LOG_WARNING, - "mount on %s is cached and will not be replicated.", - mntpnt); - replicated = 0; - } if (replicated) loglevel = LOG_WARNING; else loglevel = LOG_ERR; --- 709,718 ----
*** 1178,1231 **** (void) sprintf(remname, "%s:%s", rhost, dir); if (trace > 4 && replicated) trace_prt(1, " nfsmount: examining %s\n", remname); - /* - * If it's cached we need to get cachefs to mount it. - */ - if (cached) { - char *copts = opts; - - /* - * If we started with a URL we need to turn on - * -o public if not on already - */ - if (use_pubfh == FALSE && - (mfs->mfs_flags & MFS_FH_VIA_WEBNFS)) { - - copts = malloc(strlen(opts) + - strlen(",public")+1); - - if (copts == NULL) { - syslog(LOG_ERR, "nfsmount: no memory"); - last_error = NFSERR_IO; - goto out; - } - - strcpy(copts, opts); - - if (strlen(copts) != 0) - strcat(copts, ","); - - strcat(copts, "public"); - } - - last_error = mount_generic(remname, MNTTYPE_CACHEFS, - copts, mntpnt, overlay); - - if (copts != opts) - free(copts); - - if (last_error) { - skipentry = 1; - mfs->mfs_ignore = 1; - continue; - } - goto out; - } - if (mfs->mfs_args == NULL) { /* * Allocate nfs_args structure */ --- 1167,1176 ----