Whamcloud - gitweb
Branch b1_4_newconfig2
authornathan <nathan>
Tue, 9 Aug 2005 00:07:48 +0000 (00:07 +0000)
committernathan <nathan>
Tue, 9 Aug 2005 00:07:48 +0000 (00:07 +0000)
b=6663
mkfs.lustre now creates startup logs through mds, soon to be mcobd

lustre/include/linux/lustre_disk.h
lustre/mds/mds_fs.c
lustre/obdclass/llog_lvfs.c
lustre/obdclass/obd_mount.c
lustre/obdfilter/filter.c
lustre/utils/mkfs_lustre.c

index 8aee9f3..574ecb8 100644 (file)
@@ -35,8 +35,8 @@
 
 /* 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 MOUNT_CONFIGS_DIR "CONFIGS"
+#define MOUNT_DATA_FILE   MOUNT_CONFIGS_DIR"/mountdata"
 
 #define LDD_MAGIC 0xbabb0001
 
index 48e10c9..cd9b135 100644 (file)
@@ -468,10 +468,11 @@ int mds_fs_setup(struct obd_device *obd, struct vfsmount *mnt)
         }
         mds->mds_pending_dir = dentry;
 
-        dentry = simple_mkdir(current->fs->pwd, "LOGS", 0777, 1);
+        dentry = simple_mkdir(current->fs->pwd, MOUNT_CONFIGS_DIR, 0777, 1);
         if (IS_ERR(dentry)) {
                 rc = PTR_ERR(dentry);
-                CERROR("cannot create LOGS directory: rc = %d\n", rc);
+                CERROR("cannot create %s directory: rc = %d\n",
+                       MOUNT_CONFIGS_DIR, rc);
                 GOTO(err_pending, rc);
         }
         mds->mds_logs_dir = dentry;
index b466ef3..bb66155 100644 (file)
@@ -45,6 +45,7 @@
 #include <libcfs/list.h>
 #include <linux/lvfs.h>
 #include <linux/lustre_fsfilt.h>
+#include <linux/lustre_disk.h>
 #include "llog_internal.h"
 
 #ifdef __KERNEL__
@@ -573,7 +574,8 @@ static int llog_lvfs_destroy(struct llog_handle *handle)
         ENTRY;
 
         fdentry = handle->lgh_file->f_dentry;
-        if (!strcmp(fdentry->d_parent->d_name.name, "LOGS")) {
+        if (strcmp(fdentry->d_parent->d_name.name, MOUNT_CONFIGS_DIR) == 0) {
+                /* CONFIGS files aren't really "lustre" objects - special case*/
                 struct obd_device *obd = handle->lgh_ctxt->loc_exp->exp_obd;
                 struct inode *inode = fdentry->d_parent->d_inode;
                 struct lvfs_run_ctxt saved;
index d9945ea..96dd8da 100644 (file)
@@ -415,7 +415,7 @@ static void server_put_super(struct super_block *sb)
         err = dentry_readdir(obd, mgcobd->mgc_configs_dir,
                        mgcobd->mgc_vfsmnt, &dentry_list);
         if (err)
-                CERROR("Can't read LOGS dir, %d\n", err);
+                CERROR("Can't read %s dir, %d\n", MOUNT_CONFIGS_DIR, err);
                                                                                        
         list_for_each_entry_safe(dirent, n, &dentry_list, lld_list) {
                 char *logname;
@@ -650,7 +650,7 @@ int lustre_process_logs(struct super_block *sb,
         err = dentry_readdir(obd, mgcobd->mgc_configs_dir,
                        mgcobd->mgc_vfsmnt, &dentry_list);
         if (err) {
-                CERROR("Can't read LOGS dir\n");
+                CERROR("Can't read %s dir, rc=%d\n", MOUNT_CONFIGS_DIR, err);
                 return(err);
         }
                                                                                        
index 6cb127b..7391be8 100644 (file)
@@ -369,7 +369,7 @@ static int filter_init_server_data(struct obd_device *obd, struct file * filp)
         LASSERT (offsetof(struct filter_client_data, fcd_padding) +
                  sizeof(fcd->fcd_padding) == FILTER_LR_CLIENT_SIZE);
         LASSERT(FILTER_LR_CLIENT_SIZE == LR_CLIENT_SIZE);
-        LASSERT(FILTER_LR_CLIENT_START == LR_CLIENT_SIZE);
+        LASSERT(FILTER_LR_CLIENT_START == LR_CLIENT_START);
 
         OBD_ALLOC(fsd, sizeof(*fsd));
         if (!fsd)
index 95e118c..5e75eda 100644 (file)
@@ -308,6 +308,7 @@ int write_local_files(struct mkfs_opts *mop)
 
         if (mop->mo_flags & MO_IS_LOOP) {
                 /* ext3 can't understand iopen_nopriv, others */
+                // FIXME ext3 on 2.6 can't. So use ldiskfs on 2.6
                 if (strlen(mop->mo_ldd.ldd_mount_opts)) 
                         snprintf(local_mount_opts, sizeof(local_mount_opts),
                                  "loop,%s", mop->mo_ldd.ldd_mount_opts);
@@ -326,7 +327,7 @@ int write_local_files(struct mkfs_opts *mop)
 
         /* Set up initial directories */
         sprintf(filepnm, "%s/%s", mntpt, MOUNT_CONFIGS_DIR);
-        ret = mkdir(filepnm, 0755);
+        ret = mkdir(filepnm, 0777);
         if (ret) {
                 fprintf(stderr, "Can't make configs dir %s (%d)\n", 
                         filepnm, ret);
@@ -1083,6 +1084,7 @@ int main(int argc , char *const argv[])
         } else if (mop.mo_ldd.ldd_mount_type == LDD_MT_LDISKFS) {
                 sprintf(mop.mo_ldd.ldd_mount_opts, "errors=remount-ro");
                 if (IS_MDT(&mop.mo_ldd))
+                        // FIXME ext3 also
                         strcat(mop.mo_ldd.ldd_mount_opts, ",iopen_nopriv");
         } else if (mop.mo_ldd.ldd_mount_type == LDD_MT_SMFS) {
                 sprintf(mop.mo_ldd.ldd_mount_opts, "type=ext3,dev=%s",