X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=module%2Fzfs%2Fzfs_vfsops.c;h=ef433125a1ec6042610589f59cfe7227b9d1400d;hb=a405c8a665bf7d96880c97bcb783cf84d04e3e76;hp=4e571ed6dff19f7a8cb3b43a0d7c132ae5d5f1c5;hpb=e5c39b95a7ccc19ce7a3af8d8d09f0b8959a3991;p=zfs.git diff --git a/module/zfs/zfs_vfsops.c b/module/zfs/zfs_vfsops.c index 4e571ed..ef43312 100644 --- a/module/zfs/zfs_vfsops.c +++ b/module/zfs/zfs_vfsops.c @@ -1245,61 +1245,7 @@ zfs_unregister_callbacks(zfsvfs_t *zfsvfs) } EXPORT_SYMBOL(zfs_unregister_callbacks); -/* - * Convert a decimal digit string to a uint64_t integer. - */ -static int -str_to_uint64(char *str, uint64_t *objnum) -{ - uint64_t num = 0; - - while (*str) { - if (*str < '0' || *str > '9') - return (EINVAL); - - num = num*10 + *str++ - '0'; - } - - *objnum = num; - return (0); -} - -/* - * The boot path passed from the boot loader is in the form of - * "rootpool-name/root-filesystem-object-number'. Convert this - * string to a dataset name: "rootpool-name/root-filesystem-name". - */ -static int -zfs_parse_bootfs(char *bpath, char *outpath) -{ - char *slashp; - uint64_t objnum; - int error; - - if (*bpath == 0 || *bpath == '/') - return (EINVAL); - - (void) strcpy(outpath, bpath); - - slashp = strchr(bpath, '/'); - - /* if no '/', just return the pool name */ - if (slashp == NULL) { - return (0); - } - - /* if not a number, just return the root dataset name */ - if (str_to_uint64(slashp+1, &objnum)) { - return (0); - } - - *slashp = '\0'; - error = dsl_dsobj_to_dsname(bpath, objnum, outpath); - *slashp = '/'; - - return (error); -} - +#ifdef HAVE_MLSLABEL /* * zfs_check_global_label: * Check that the hex label string is appropriate for the dataset @@ -1327,6 +1273,7 @@ zfs_check_global_label(const char *dsname, const char *hexsl) } return (EACCES); } +#endif /* HAVE_MLSLABEL */ /* * zfs_mount_label_policy: