Whamcloud - gitweb
LU-1581 utils: osd_read_ldd() wrapper
[fs/lustre-release.git] / lustre / utils / mount_utils.c
index 84e0da3..4fb5ee0 100644 (file)
@@ -376,6 +376,27 @@ int loop_format(struct mkfs_opts *mop)
        return 0;
 }
 
+/* Read the server config files */
+int osd_read_ldd(char *dev, struct lustre_disk_data *ldd)
+{
+       int ret;
+
+       switch (ldd->ldd_mount_type) {
+       case LDD_MT_LDISKFS:
+       case LDD_MT_LDISKFS2:
+               ret = ldiskfs_read_ldd(dev, ldd);
+               break;
+       default:
+               fatal();
+               fprintf(stderr, "unknown fs type %d '%s'\n",
+                       ldd->ldd_mount_type, MT_STR(ldd));
+               ret = EINVAL;
+               break;
+       }
+
+       return ret;
+}
+
 /* Was this device formatted for Lustre */
 int osd_is_lustre(char *dev, unsigned *mount_type)
 {