X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Futils%2Fmkfs_lustre.c;h=2c20ac95684dc7f604dd003b45962e6b1c49798e;hp=4236a4c034b6647bf541271eb10acfb99b3e2893;hb=a0b83ae3120e79fc6ea6eba7e6bff7e3720209d5;hpb=495c2c6b6de9b307d2a90d3b33053685a77a3fad;ds=sidebyside diff --git a/lustre/utils/mkfs_lustre.c b/lustre/utils/mkfs_lustre.c index 4236a4c..2c20ac9 100644 --- a/lustre/utils/mkfs_lustre.c +++ b/lustre/utils/mkfs_lustre.c @@ -133,31 +133,6 @@ void usage(FILE *out) return; } -/*================ utility functions =====================*/ - -static int check_mtab_entry(char *spec) -{ - FILE *fp; - struct mntent *mnt; - - fp = setmntent(MOUNTED, "r"); - if (fp == NULL) - return(0); - - while ((mnt = getmntent(fp)) != NULL) { - if (strcmp(mnt->mnt_fsname, spec) == 0) { - endmntent(fp); - fprintf(stderr, "%s: according to %s %s is " - "already mounted on %s\n", - progname, MOUNTED, spec, mnt->mnt_dir); - return(EEXIST); - } - } - endmntent(fp); - - return(0); -} - /* ==================== Lustre config functions =============*/ void print_ldd(char *str, struct lustre_disk_data *ldd) @@ -688,8 +663,8 @@ int main(int argc, char *const argv[]) goto out; } - if (check_mtab_entry(mop.mo_device)) - return(EEXIST); + if (check_mtab_entry(mop.mo_device, mop.mo_device, NULL, NULL)) + return(EEXIST); /* Create the loopback file */ if (mop.mo_flags & MO_IS_LOOP) {