Whamcloud - gitweb
Branch b1_5
authornathan <nathan>
Mon, 1 May 2006 20:13:36 +0000 (20:13 +0000)
committernathan <nathan>
Mon, 1 May 2006 20:13:36 +0000 (20:13 +0000)
b=8007
move mkfs private struct out of lustre_disk.h
change errno for "no osts" to be unique

lustre/include/lustre_disk.h
lustre/lov/lov_obd.c
lustre/utils/mkfs_lustre.c
lustre/utils/mount_lustre.c

index 8430107..1f38619 100644 (file)
 #include <linux/types.h>
 #include <lnet/types.h>
 
+/****************** on-disk files *********************/
 
-/****************** persistent mount data *********************/
-
-/* Persistent mount data are stored on the disk in this file.
-   Used before the setup llog can be read. */
-#define MOUNT_CONFIGS_DIR "CONFIGS"
-#define MOUNT_DATA_FILE   MOUNT_CONFIGS_DIR"/mountdata"
 #define MDT_LOGS_DIR      "LOGS"  /* COMPAT_146 */
+#define MOUNT_CONFIGS_DIR "CONFIGS"
+/* Persistent mount data are stored on the disk in this file. */
+#define MOUNT_DATA_FILE    MOUNT_CONFIGS_DIR"/mountdata"
+#define LAST_RCVD         "last_rcvd"
+#define LOV_OBJID         "lov_objid"
+#define HEALTH_CHECK      "health_check"
+
+
+/****************** persistent mount data *********************/
 
 #define LDD_F_SV_TYPE_MDT   0x0001
 #define LDD_F_SV_TYPE_OST   0x0002
@@ -49,7 +53,6 @@
 #define LDD_F_UPGRADE14     0x0200 /* COMPAT_14 */
 #define MTI_F_IOCTL         0x0400 /* only used in mti  */
 
-
 enum ldd_mount_type {
         LDD_MT_EXT3 = 0, 
         LDD_MT_LDISKFS,
@@ -66,7 +69,6 @@ static inline char *mt_str(enum ldd_mount_type mt)
                 "smfs",
                 "reiserfs",
         };
-        //LASSERT(mt < LDD_MT_LAST);
         return mount_type_string[mt];
 }
 
@@ -153,29 +155,6 @@ struct lustre_mount_data {
 
 #define lmd_is_client(x) ((x)->lmd_flags & LMD_FLG_CLIENT) 
 
-/****************** mkfs command *********************/
-
-#define MO_IS_LOOP     0x01
-#define MO_FORCEFORMAT 0x02
-
-/* used to describe the options to format the lustre disk, not persistent */
-struct mkfs_opts {
-        struct lustre_disk_data mo_ldd; /* to be written in MOUNT_DATA_FILE */
-        char  mo_mount_type_string[20]; /* "ext3", "ldiskfs", ... */
-        char  mo_device[128];           /* disk device name */
-        char  mo_mkfsopts[128];         /* options to the backing-store mkfs */
-        char  mo_loopdev[128];          /* in case a loop dev is needed */
-        __u64 mo_device_sz;             /* in KB */
-        int   mo_stripe_count;
-        int   mo_flags; 
-        int   mo_mgs_failnodes;
-};
-
-/****************** on-disk files *********************/
-
-#define LAST_RCVD    "last_rcvd"
-#define LOV_OBJID    "lov_objid"
-#define HEALTH_CHECK "health_check"
 
 /****************** last_rcvd file *********************/
 
index 4b22292..40f6b46 100644 (file)
@@ -1547,7 +1547,7 @@ int lov_prep_async_page(struct obd_export *exp, struct lov_stripe_md *lsm,
                 while (!lov->tgts[i].ltd_exp) {
                         i++;
                         if (i >= lov->desc.ld_tgt_count) 
-                                RETURN(-ENOTBLK);
+                                RETURN(-ENOMEDIUM);
                 }
                 rc = size_round(sizeof(*lap)) +
                         obd_prep_async_page(lov->tgts[i].ltd_exp, NULL, NULL,
index 1f88563..291f566 100644 (file)
 #define MAX_LOOP_DEVICES 16
 #define L_BLOCK_SIZE 4096
 #define INDEX_UNASSIGNED 0xFFFF
+#define MO_IS_LOOP     0x01
+#define MO_FORCEFORMAT 0x02
+
+/* used to describe the options to format the lustre disk, not persistent */
+struct mkfs_opts {
+        struct lustre_disk_data mo_ldd; /* to be written in MOUNT_DATA_FILE */
+        char  mo_mount_type_string[20]; /* "ext3", "ldiskfs", ... */
+        char  mo_device[128];           /* disk device name */
+        char  mo_mkfsopts[128];         /* options to the backing-store mkfs */
+        char  mo_loopdev[128];          /* in case a loop dev is needed */
+        __u64 mo_device_sz;             /* in KB */
+        int   mo_stripe_count;
+        int   mo_flags; 
+        int   mo_mgs_failnodes;
+};
 
 static char *progname;
 static int verbose = 1;
index be8ebdf..6658154 100644 (file)
@@ -380,7 +380,9 @@ int main(int argc, char *const argv[])
                         fprintf(stderr, "Are the lustre modules loaded?\n"
                              "Check /etc/modules.conf and /proc/filesystems\n");
                 if (errno == ENOTBLK)
-                        fprintf(stderr,"Does this filesystem have any OSTs?\n");
+                        fprintf(stderr,"Do you need -o loop?\n");
+                if (errno == ENOMEDIUM)
+                        fprintf(stderr,"This filesystem needs at least 1 OST\n");
                 if (errno == ENOENT)
                         fprintf(stderr,"Is the MGS specification correct? "
                                 "(%s)\n", source);
@@ -389,7 +391,8 @@ int main(int argc, char *const argv[])
                                 "(%s)\n", source);
                 if (errno == ENXIO)
                         fprintf(stderr,"The target service failed to start "
-                                "(bad config log?) (%s)\n", source);
+                                "(bad config log?) (%s).  "
+                                "See /var/log/messages.\n", source);
                 if (errno == EIO)
                         fprintf(stderr,"Is the MGS running? (%s)\n", source);
                 if (errno == EADDRINUSE)