Whamcloud - gitweb
->o_setup() methods always take struct lustre_cfg in buffer, make this explicit in...
authornikita <nikita>
Wed, 29 Mar 2006 18:41:38 +0000 (18:41 +0000)
committernikita <nikita>
Wed, 29 Mar 2006 18:41:38 +0000 (18:41 +0000)
21 files changed:
lustre/include/linux/lustre_lib.h
lustre/include/linux/lustre_net.h
lustre/ldiskfs/quotafmt_test.c
lustre/ldlm/ldlm_lib.c
lustre/lov/lov_obd.c
lustre/mdc/mdc_request.c
lustre/mds/handler.c
lustre/mgc/mgc_request.c
lustre/mgs/mgs_handler.c
lustre/obdclass/llog_test.c
lustre/obdclass/obd_config.c
lustre/obdecho/echo.c
lustre/obdecho/echo_client.c
lustre/obdfilter/filter.c
lustre/obdfilter/filter_internal.h
lustre/obdfilter/filter_san.c
lustre/osc/osc_lib.c
lustre/osc/osc_request.c
lustre/ost/ost_handler.c
lustre/quota/quotacheck_test.c
lustre/quota/quotactl_test.c

index 2d74940..7ff6f37 100644 (file)
@@ -95,7 +95,7 @@ void target_send_reply(struct ptlrpc_request *req, int rc, int fail_id);
 
 /* client.c */
 
-int client_sanobd_setup(struct obd_device *obddev, obd_count len, void *buf);
+int client_sanobd_setup(struct obd_device *obddev, struct lustre_cfg* lcfg);
 struct client_obd *client_conn2cli(struct lustre_handle *conn);
 
 struct mdc_open_data;
index c61a35c..12f2fc4 100644 (file)
@@ -89,6 +89,7 @@
 #define LDLM_MAXREQSIZE (5 * 1024)
 #define LDLM_MAXREPSIZE (1024)
 
+#define MDT_MIN_THREADS 2UL
 #define MDT_MAX_THREADS 32UL
 #define MDT_NUM_THREADS max(min_t(unsigned long, MDT_MAX_THREADS, \
                                   num_physpages >> (25 - PAGE_SHIFT)), 2UL)
@@ -767,7 +768,7 @@ ptlrpc_rs_decref(struct ptlrpc_reply_state *rs)
 }
 
 /* ldlm/ldlm_lib.c */
-int client_obd_setup(struct obd_device *obddev, obd_count len, void *buf);
+int client_obd_setup(struct obd_device *obddev, struct lustre_cfg* lcfg);
 int client_obd_cleanup(struct obd_device * obddev);
 int client_connect_import(struct lustre_handle *conn, struct obd_device *obd,
                           struct obd_uuid *cluuid, struct obd_connect_data *);
index 9dcbdcd..57b4546 100644 (file)
@@ -344,7 +344,7 @@ static int quotfmt_test_4(struct lustre_quota_info *lqi)
 
 static int quotfmt_test_5(struct lustre_quota_info *lqi)
 {
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12)        
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12)
         int i, rc = 0;
 
         for (i = USRQUOTA; i < MAXQUOTAS && !rc; i++) {
@@ -440,10 +440,9 @@ static int quotfmt_test_cleanup(struct obd_device *obd)
         RETURN(0);
 }
 
-static int quotfmt_test_setup(struct obd_device *obd, obd_count len, void *buf)
+static int quotfmt_test_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
 {
         struct lprocfs_static_vars lvars;
-        struct lustre_cfg *lcfg = buf;
         struct obd_device *tgt;
         int rc;
         ENTRY;
index fab1c40..2108c45 100644 (file)
@@ -186,9 +186,8 @@ out:
  * 2 - server UUID
  * 3 - inactive-on-startup
  */
-int client_obd_setup(struct obd_device *obddev, obd_count len, void *buf)
+int client_obd_setup(struct obd_device *obddev, struct lustre_cfg* lcfg)
 {
-        struct lustre_cfg* lcfg = buf;
         struct client_obd *cli = &obddev->u.cli;
         struct obd_import *imp;
         struct obd_uuid server_uuid;
index ae4bb27..8b9a3e5 100644 (file)
@@ -113,12 +113,12 @@ static int lov_connect_obd(struct obd_device *obd, struct lov_tgt_desc *tgt,
 
         tgt_obd = class_find_client_obd(tgt_uuid, LUSTRE_OSC_NAME,
                                         &obd->obd_uuid);
-        
+
         if (!tgt_obd) {
                 CERROR("Target %s not attached\n", obd_uuid2str(tgt_uuid));
                 RETURN(-EINVAL);
         }
-        
+
         CDEBUG(D_CONFIG, "Connect tgt %s (%s)\n", obd_uuid2str(tgt_uuid),
                tgt_obd->obd_name);
 
@@ -129,7 +129,7 @@ static int lov_connect_obd(struct obd_device *obd, struct lov_tgt_desc *tgt,
 
         if (activate) {
                 tgt_obd->obd_no_recov = 0;
-                /* FIXME this is probably supposed to be 
+                /* FIXME this is probably supposed to be
                    ptlrpc_set_import_active.  Horrible naming. */
                 ptlrpc_activate_import(tgt_obd->u.cli.cl_import);
         }
@@ -208,12 +208,12 @@ static int lov_connect(struct lustre_handle *conn, struct obd_device *obd,
         int rc;
         ENTRY;
 
-        lov->ocd.ocd_connect_flags = OBD_CONNECT_EMPTY; 
-        if (data) 
+        lov->ocd.ocd_connect_flags = OBD_CONNECT_EMPTY;
+        if (data)
                 lov->ocd = *data;
 
         rc = class_connect(conn, obd, cluuid);
-        if (!rc) 
+        if (!rc)
                 lov->connects++;
         CDEBUG(D_CONFIG, "connect #%d\n", lov->connects);
 
@@ -230,7 +230,7 @@ static int lov_disconnect_obd(struct obd_device *obd, struct lov_tgt_desc *tgt)
         int rc;
         ENTRY;
 
-        CDEBUG(D_CONFIG, "%s: disconnecting target %s\n", 
+        CDEBUG(D_CONFIG, "%s: disconnecting target %s\n",
                obd->obd_name, osc_obd->obd_name);
 
         lov_proc_dir = lprocfs_srch(obd->obd_proc_entry, "target_obds");
@@ -373,7 +373,7 @@ static int lov_notify(struct obd_device *obd, struct obd_device *watched,
                 struct obd_uuid *uuid;
 
                 LASSERT(watched);
-                
+
                 if (strcmp(watched->obd_type->typ_name, LUSTRE_OSC_NAME)) {
                         CERROR("unexpected notification of %s %s!\n",
                                watched->obd_type->typ_name,
@@ -406,7 +406,7 @@ static int lov_notify(struct obd_device *obd, struct obd_device *watched,
                 struct lov_tgt_desc *tgt;
                 struct obd_device *tgt_obd;
                 int i;
-                for (i = 0, tgt = lov->tgts; i < lov->desc.ld_tgt_count; 
+                for (i = 0, tgt = lov->tgts; i < lov->desc.ld_tgt_count;
                       i++, tgt++) {
                         if (obd_uuid_empty(&tgt->uuid))
                                 continue;
@@ -414,7 +414,7 @@ static int lov_notify(struct obd_device *obd, struct obd_device *watched,
                         rc = obd_notify_observer(obd, tgt_obd, ev, data);
                         if (rc) {
                                 CERROR("%s: notify %s of %s failed %d\n",
-                                       obd->obd_name, 
+                                       obd->obd_name,
                                        obd->obd_observer->obd_name,
                                        tgt_obd->obd_name, rc);
                                 break;
@@ -496,10 +496,10 @@ static int lov_add_target(struct obd_device *obd, struct obd_uuid *uuidp,
                         osc_obd->obd_no_recov = 0;
         }
 
-        if (lov->ocd.ocd_connect_flags != OBD_CONNECT_EMPTY) { 
+        if (lov->ocd.ocd_connect_flags != OBD_CONNECT_EMPTY) {
                 /* Keep the original connect flags pristine */
                 OBD_ALLOC(ocd, sizeof(*ocd));
-                if (!ocd) 
+                if (!ocd)
                         RETURN(-ENOMEM);
                 *ocd = lov->ocd;
         }
@@ -510,13 +510,13 @@ static int lov_add_target(struct obd_device *obd, struct obd_uuid *uuidp,
                 GOTO(out, rc);
 
         idx = index;
-        rc = lov_notify(obd, tgt->ltd_exp->exp_obd, 
+        rc = lov_notify(obd, tgt->ltd_exp->exp_obd,
                         active ? OBD_NOTIFY_ACTIVE : OBD_NOTIFY_INACTIVE,
                         (void *)&idx);
 
 out:
         if (rc) {
-                CERROR("add failed (%d), deleting %s\n", rc, 
+                CERROR("add failed (%d), deleting %s\n", rc,
                        (char *)tgt->uuid.uuid);
                 lov_del_target(obd, &tgt->uuid, index, 0);
         }
@@ -524,7 +524,7 @@ out:
 }
 
 /* Schedule a target for deletion */
-static int lov_del_target(struct obd_device *obd, struct obd_uuid *uuidp, 
+static int lov_del_target(struct obd_device *obd, struct obd_uuid *uuidp,
                           int index, int gen)
 {
         struct lov_obd *lov = &obd->u.lov;
@@ -571,7 +571,7 @@ static void __lov_del_obd(struct obd_device *obd, struct lov_tgt_desc *tgt)
         LASSERT(tgt->reap);
         osc_obd = class_exp2obd(tgt->ltd_exp);
 
-        CDEBUG(D_CONFIG, "Removing tgt %s : %s\n", tgt->uuid.uuid, 
+        CDEBUG(D_CONFIG, "Removing tgt %s : %s\n", tgt->uuid.uuid,
                osc_obd ? osc_obd->obd_name : "<no obd>");
 
         if (tgt->ltd_exp)
@@ -612,7 +612,7 @@ static void lov_fix_desc(struct lov_desc *desc)
                 desc->ld_default_stripe_count = 1;
 
         /* from lov_setstripe */
-        if ((desc->ld_pattern != 0) && 
+        if ((desc->ld_pattern != 0) &&
             (desc->ld_pattern != LOV_PATTERN_RAID0)) {
                 CDEBUG(D_IOCTL, "bad userland stripe pattern: %#x\n",
                        desc->ld_pattern);
@@ -620,10 +620,9 @@ static void lov_fix_desc(struct lov_desc *desc)
         }
 }
 
-static int lov_setup(struct obd_device *obd, obd_count len, void *buf)
+static int lov_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
 {
         struct lprocfs_static_vars lvars;
-        struct lustre_cfg *lcfg = buf;
         struct lov_desc *desc;
         struct lov_obd *lov = &obd->u.lov;
         int count;
index b88e508..c647c90 100644 (file)
@@ -100,7 +100,7 @@ int mdc_getstatus(struct obd_export *exp, struct ll_fid *rootfid)
 }
 
 static
-int mdc_getattr_common(struct obd_export *exp, unsigned int ea_size, 
+int mdc_getattr_common(struct obd_export *exp, unsigned int ea_size,
                        unsigned int acl_size, struct ptlrpc_request *req)
 {
         struct mds_body *body;
@@ -148,14 +148,14 @@ int mdc_getattr_common(struct obd_export *exp, unsigned int ea_size,
                         RETURN (-EPROTO);
                 }
         }
-        
+
         if (body->valid & OBD_MD_FLMODEASIZE) {
-                if (exp->exp_obd->u.cli.cl_max_mds_easize < body->max_mdsize) 
-                        exp->exp_obd->u.cli.cl_max_mds_easize = 
+                if (exp->exp_obd->u.cli.cl_max_mds_easize < body->max_mdsize)
+                        exp->exp_obd->u.cli.cl_max_mds_easize =
                                                 body->max_mdsize;
-                if (exp->exp_obd->u.cli.cl_max_mds_cookiesize < 
+                if (exp->exp_obd->u.cli.cl_max_mds_cookiesize <
                                                 body->max_cookiesize)
-                        exp->exp_obd->u.cli.cl_max_mds_cookiesize = 
+                        exp->exp_obd->u.cli.cl_max_mds_cookiesize =
                                                 body->max_cookiesize;
         }
 
@@ -210,7 +210,7 @@ int mdc_getattr_name(struct obd_export *exp, struct ll_fid *fid,
                 GOTO(out, rc = -ENOMEM);
 
         mdc_pack_req_body(req, MDS_REQ_REC_OFF, valid, fid, ea_len);
+
         LASSERT (strnlen (filename, namelen) == namelen - 1);
         memcpy(lustre_msg_buf(req->rq_reqmsg, 1, namelen), filename, namelen);
 
@@ -890,7 +890,7 @@ int mdc_get_info(struct obd_export *exp, __u32 keylen, void *key,
         if (keylen == strlen("max_easize") &&
             memcmp(key, "max_easize", strlen("max_easize")) == 0) {
                 int mdsize, *max_easize;
-                
+
                 if (*vallen != sizeof(int))
                         RETURN(-EINVAL);
                 mdsize = *(int*)val;
@@ -1087,7 +1087,7 @@ static int mdc_import_event(struct obd_device *obd, struct obd_import *imp,
         RETURN(rc);
 }
 
-static int mdc_setup(struct obd_device *obd, obd_count len, void *buf)
+static int mdc_setup(struct obd_device *obd, struct lustre_cfg *cfg)
 {
         struct client_obd *cli = &obd->u.cli;
         struct lprocfs_static_vars lvars;
@@ -1106,7 +1106,7 @@ static int mdc_setup(struct obd_device *obd, obd_count len, void *buf)
                 GOTO(err_rpc_lock, rc = -ENOMEM);
         mdc_init_rpc_lock(cli->cl_setattr_lock);
 
-        rc = client_obd_setup(obd, len, buf);
+        rc = client_obd_setup(obd, cfg);
         if (rc)
                 GOTO(err_setattr_lock, rc);
         lprocfs_init_vars(mdc, &lvars);
@@ -1152,7 +1152,7 @@ int mdc_init_ea_size(struct obd_export *mdc_exp, struct obd_export *lov_exp)
         stripes = min(desc.ld_tgt_count, (__u32)LOV_MAX_STRIPE_COUNT);
         lsm.lsm_stripe_count = stripes;
         size = obd_size_diskmd(lov_exp, &lsm);
-        
+
         if (cli->cl_max_mds_easize < size)
                 cli->cl_max_mds_easize = size;
 
@@ -1168,7 +1168,7 @@ int mdc_init_ea_size(struct obd_export *mdc_exp, struct obd_export *lov_exp)
 
         CDEBUG(D_HA, "updating max_mdsize/max_cookiesize: %d/%d\n",
                cli->cl_max_mds_easize, cli->cl_max_mds_cookiesize);
-        
+
         RETURN(0);
 }
 
index 4e95a45..cb5995b 100644 (file)
@@ -171,7 +171,7 @@ struct dentry *mds_fid2locked_dentry(struct obd_device *obd, struct ll_fid *fid,
         struct dentry *de = mds_fid2dentry(mds, fid, mnt), *retval = de;
         struct ldlm_res_id res_id = { .name = {0} };
         int flags = 0, rc;
-        ldlm_policy_data_t policy = { .l_inodebits = { lockpart} }; 
+        ldlm_policy_data_t policy = { .l_inodebits = { lockpart} };
         ENTRY;
 
         if (IS_ERR(de))
@@ -250,7 +250,7 @@ struct dentry *mds_fid2dentry(struct mds_obd *mds, struct ll_fid *fid,
         RETURN(result);
 }
 
-static int mds_connect_internal(struct obd_export *exp, 
+static int mds_connect_internal(struct obd_export *exp,
                                 struct obd_connect_data *data)
 {
         struct obd_device *obd = exp->exp_obd;
@@ -1717,12 +1717,12 @@ int mds_update_server_data(struct obd_device *obd, int force_sync)
                 /* Swap to the old mds_server_data format, in case
                    someone wants to revert to a pre-1.6 lustre */
                 CDEBUG(D_CONFIG, "writing old last_rcvd format\n");
-                /* malloc new struct instead of swap in-place because 
+                /* malloc new struct instead of swap in-place because
                    we don't have a lock on the last_trasno or mount count -
                    someone may modify it while we're here, and we don't want
                    them to inc the wrong thing. */
                 OBD_ALLOC(lsd_copy, sizeof(*lsd_copy));
-                if (!lsd_copy) 
+                if (!lsd_copy)
                         RETURN(-ENOMEM);
                 *lsd_copy = *lsd;
                 lsd_copy->lsd_unused = lsd->lsd_last_transno;
@@ -1736,7 +1736,7 @@ int mds_update_server_data(struct obd_device *obd, int force_sync)
         if (rc)
                 CERROR("error writing MDS server data: rc = %d\n", rc);
 
-        if (lsd_copy) 
+        if (lsd_copy)
                 OBD_FREE(lsd_copy, sizeof(*lsd_copy));
 
         RETURN(rc);
@@ -1777,10 +1777,9 @@ void fsoptions_to_mds_flags(struct mds_obd *mds, char *options)
  * 3 = config name
  * 4 = mount options
  */
-static int mds_setup(struct obd_device *obd, obd_count len, void *buf)
+static int mds_setup(struct obd_device *obd, struct lustre_cfg* lcfg)
 {
         struct lprocfs_static_vars lvars;
-        struct lustre_cfg* lcfg = buf;
         struct mds_obd *mds = &obd->u.mds;
         struct lustre_mount_info *lmi;
         struct vfsmount *mnt;
@@ -1831,9 +1830,9 @@ static int mds_setup(struct obd_device *obd, obd_count len, void *buf)
                                 lustre_cfg_string(lcfg, 4));
                         fsoptions_to_mds_flags(mds, options);
                 }
-                
+
                 mnt = do_kern_mount(lustre_cfg_string(lcfg, 2), 0,
-                                    lustre_cfg_string(lcfg, 1), 
+                                    lustre_cfg_string(lcfg, 1),
                                     (void *)options);
                 free_page(page);
                 if (IS_ERR(mnt)) {
@@ -1974,7 +1973,7 @@ err_put:
                 unlock_kernel();
                 mntput(mds->mds_vfsmnt);
                 lock_kernel();
-        }               
+        }
         obd->u.obt.obt_sb = NULL;
         return rc;
 }
@@ -2029,10 +2028,10 @@ static int mds_postsetup(struct obd_device *obd)
 
         if (mds->mds_profile) {
                 struct lustre_profile *lprof;
-                /* The profile defines which osc and mdc to connect to, for a 
+                /* The profile defines which osc and mdc to connect to, for a
                    client.  We reuse that here to figure out the name of the
                    lov to use (and ignore lprof->lp_mdc).
-                   The profile was set in the config log with 
+                   The profile was set in the config log with
                    LCFG_MOUNTOPT profilenm oscnm mdcnm */
                 lprof = class_get_profile(mds->mds_profile);
                 if (lprof == NULL) {
@@ -2082,7 +2081,7 @@ int mds_postrecov(struct obd_device *obd)
         /* Notify the LOV, which will in turn call mds_notify for each tgt */
         /* This means that we have to hack obd_notify to think we're obd_set_up
            during mds_lov_connect. */
-        obd_notify(obd->u.mds.mds_osc_obd, NULL, 
+        obd_notify(obd->u.mds.mds_osc_obd, NULL,
                    obd->obd_async_recov ? OBD_NOTIFY_SYNC_NONBLOCK :
                    OBD_NOTIFY_SYNC, NULL);
 
@@ -2150,7 +2149,7 @@ static int mds_cleanup(struct obd_device *obd)
         lquota_cleanup(quota_interface, obd);
 
         mds_update_server_data(obd, 1);
-        if (mds->mds_lov_objids != NULL) 
+        if (mds->mds_lov_objids != NULL)
                 OBD_FREE(mds->mds_lov_objids, mds->mds_lov_objids_size);
         mds_fs_cleanup(obd);
 
@@ -2166,8 +2165,8 @@ static int mds_cleanup(struct obd_device *obd)
                 unlock_kernel();
                 must_relock++;
         }
-        
-        if (must_put) 
+
+        if (must_put)
                 /* In case we didn't mount with lustre_get_mount -- old method*/
                 mntput(mds->mds_vfsmnt);
         obd->u.obt.obt_sb = NULL;
@@ -2427,7 +2426,7 @@ static int mds_intent_policy(struct ldlm_namespace *ns,
         RETURN(ELDLM_LOCK_REPLACED);
 }
 
-static int mdt_setup(struct obd_device *obd, obd_count len, void *buf)
+static int mdt_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
 {
         struct mds_obd *mds = &obd->u.mds;
         struct lprocfs_static_vars lvars;
@@ -2618,7 +2617,7 @@ static int __init mds_init(void)
                 return rc;
         }
         init_obd_quota_ops(quota_interface, &mds_obd_ops);
-        
+
         lprocfs_init_vars(mds, &lvars);
         class_register_type(&mds_obd_ops, lvars.module_vars, LUSTRE_MDS_NAME);
         lprocfs_init_vars(mdt, &lvars);
index 0e5e2fc..05e73cc 100644 (file)
@@ -23,7 +23,7 @@
  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
  */
+
 #ifndef EXPORT_SYMTAB
 # define EXPORT_SYMTAB
 #endif
@@ -51,7 +51,7 @@ int mgc_logname2resid(char *logname, struct ldlm_res_id *res_id)
         char *name_end;
         int len;
         __u64 resname = 0;
-        
+
         /* fsname is at most 8 chars long at the beginning of the logname
            e.g. "lustre-MDT0001" or "lustre" */
         name_end = strrchr(logname, '-');
@@ -100,14 +100,14 @@ static void config_log_put(struct config_llog_data *cld)
                 CDEBUG(D_MGC, "dropping config log %s\n", cld->cld_logname);
                 OBD_FREE(cld->cld_logname, strlen(cld->cld_logname) + 1);
                 if (cld->cld_cfg.cfg_instance != NULL)
-                        OBD_FREE(cld->cld_cfg.cfg_instance, 
+                        OBD_FREE(cld->cld_cfg.cfg_instance,
                                  strlen(cld->cld_cfg.cfg_instance) + 1);
                 OBD_FREE(cld, sizeof(*cld));
         }
         EXIT;
 }
 
-static struct config_llog_data *config_log_find(char *logname, 
+static struct config_llog_data *config_log_find(char *logname,
                                                struct config_llog_instance *cfg)
 {
         struct list_head *tmp;
@@ -128,10 +128,10 @@ static struct config_llog_data *config_log_find(char *logname,
         spin_lock(&config_list_lock);
         list_for_each(tmp, &config_llog_list) {
                 cld = list_entry(tmp, struct config_llog_data, cld_list_chain);
-                if (match_instance && cld->cld_cfg.cfg_instance && 
+                if (match_instance && cld->cld_cfg.cfg_instance &&
                     strcmp(logid, cld->cld_cfg.cfg_instance) == 0)
                         goto out_found;
-                if (!match_instance &&  
+                if (!match_instance &&
                     strcmp(logid, cld->cld_logname) == 0)
                         goto out_found;
         }
@@ -145,7 +145,7 @@ out_found:
         RETURN(cld);
 }
 
-/* Add this log to our list of active logs. 
+/* Add this log to our list of active logs.
    We have one active log per "mount" - client instance or servername.
    Each instance may be at a different point in the log. */
 static int config_log_add(char *logname, struct config_llog_instance *cfg,
@@ -156,12 +156,12 @@ static int config_log_add(char *logname, struct config_llog_instance *cfg,
         ENTRY;
 
         CDEBUG(D_MGC, "adding config log %s:%s\n", logname, cfg->cfg_instance);
-        
+
         OBD_ALLOC(cld, sizeof(*cld));
-        if (!cld) 
+        if (!cld)
                 RETURN(-ENOMEM);
         OBD_ALLOC(cld->cld_logname, strlen(logname) + 1);
-        if (!cld->cld_logname) { 
+        if (!cld->cld_logname) {
                 OBD_FREE(cld, sizeof(*cld));
                 RETURN(-ENOMEM);
         }
@@ -172,7 +172,7 @@ static int config_log_add(char *logname, struct config_llog_instance *cfg,
         cld->cld_cfg.cfg_sb = sb;
         atomic_set(&cld->cld_refcount, 1);
         if (cfg->cfg_instance != NULL) {
-                OBD_ALLOC(cld->cld_cfg.cfg_instance, 
+                OBD_ALLOC(cld->cld_cfg.cfg_instance,
                           strlen(cfg->cfg_instance) + 1);
                 strcpy(cld->cld_cfg.cfg_instance, cfg->cfg_instance);
         }
@@ -184,19 +184,19 @@ static int config_log_add(char *logname, struct config_llog_instance *cfg,
         spin_lock(&config_list_lock);
         list_add(&cld->cld_list_chain, &config_llog_list);
         spin_unlock(&config_list_lock);
-        
+
         RETURN(rc);
 }
 
 /* Stop watching for updates on this log. */
 static int config_log_end(char *logname, struct config_llog_instance *cfg)
-{       
+{
         struct config_llog_data *cld;
         int rc = 0;
         ENTRY;
-                                       
+
         cld = config_log_find(logname, cfg);
-        if (IS_ERR(cld)) 
+        if (IS_ERR(cld))
                 RETURN(PTR_ERR(cld));
         /* drop the ref from the find */
         config_log_put(cld);
@@ -218,7 +218,7 @@ static void config_log_end_all(void)
         struct list_head *tmp, *n;
         struct config_llog_data *cld;
         ENTRY;
-        
+
         spin_lock(&config_list_lock);
         list_for_each_safe(tmp, n, &config_llog_list) {
                 cld = list_entry(tmp, struct config_llog_data, cld_list_chain);
@@ -233,7 +233,7 @@ static void config_log_end_all(void)
 
 /********************** class fns **********************/
 
-static int mgc_fs_setup(struct obd_device *obd, struct super_block *sb, 
+static int mgc_fs_setup(struct obd_device *obd, struct super_block *sb,
                         struct vfsmount *mnt)
 {
         struct lvfs_run_ctxt saved;
@@ -253,13 +253,13 @@ static int mgc_fs_setup(struct obd_device *obd, struct super_block *sb,
         obd->obd_fsops = fsfilt_get_ops(MT_STR(lsi->lsi_ldd));
         if (IS_ERR(obd->obd_fsops)) {
                 up(&cli->cl_mgc_sem);
-                CERROR("No fstype %s rc=%ld\n", MT_STR(lsi->lsi_ldd), 
+                CERROR("No fstype %s rc=%ld\n", MT_STR(lsi->lsi_ldd),
                        PTR_ERR(obd->obd_fsops));
                 RETURN(PTR_ERR(obd->obd_fsops));
         }
 
         cli->cl_mgc_vfsmnt = mnt;
-        // FIXME which is the right SB? - filter_common_setup also 
+        // FIXME which is the right SB? - filter_common_setup also
         CDEBUG(D_MGC, "SB's: fill=%p mnt=%p root=%p\n", sb, mnt->mnt_sb,
                mnt->mnt_root->d_inode->i_sb);
         fsfilt_setup(obd, mnt->mnt_sb);
@@ -275,7 +275,7 @@ static int mgc_fs_setup(struct obd_device *obd, struct super_block *sb,
         pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
         if (IS_ERR(dentry)) {
                 err = PTR_ERR(dentry);
-                CERROR("cannot lookup %s directory: rc = %d\n", 
+                CERROR("cannot lookup %s directory: rc = %d\n",
                        MOUNT_CONFIGS_DIR, err);
                 GOTO(err_ops, err);
         }
@@ -284,7 +284,7 @@ static int mgc_fs_setup(struct obd_device *obd, struct super_block *sb,
         /* We keep the cl_mgc_sem until mgc_fs_cleanup */
         RETURN(0);
 
-err_ops:        
+err_ops:
         fsfilt_put_ops(obd->obd_fsops);
         obd->obd_fsops = NULL;
         cli->cl_mgc_vfsmnt = NULL;
@@ -304,14 +304,14 @@ static int mgc_fs_cleanup(struct obd_device *obd)
                 struct lvfs_run_ctxt saved;
                 push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
                 l_dput(cli->cl_mgc_configs_dir);
-                cli->cl_mgc_configs_dir = NULL; 
+                cli->cl_mgc_configs_dir = NULL;
                 pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
         }
 
         cli->cl_mgc_vfsmnt = NULL;
-        if (obd->obd_fsops) 
+        if (obd->obd_fsops)
                 fsfilt_put_ops(obd->obd_fsops);
-        
+
         up(&cli->cl_mgc_sem);
         RETURN(rc);
 }
@@ -324,7 +324,7 @@ static int mgc_cleanup(struct obd_device *obd)
         /* FIXME calls to mgc_fs_setup must take an obd ref to insure there's
            no fs by the time we get here. */
         LASSERT(cli->cl_mgc_vfsmnt == NULL);
-        
+
         rc = obd_llog_finish(obd, 0);
         if (rc != 0)
                 CERROR("failed to cleanup llogging subsystems\n");
@@ -338,14 +338,14 @@ static int mgc_cleanup(struct obd_device *obd)
 
 static struct obd_device *the_mgc;
 
-static int mgc_setup(struct obd_device *obd, obd_count len, void *buf)
+static int mgc_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
 {
         int rc;
         ENTRY;
 
         ptlrpcd_addref();
 
-        rc = client_obd_setup(obd, len, buf);
+        rc = client_obd_setup(obd, lcfg);
         if (rc)
                 GOTO(err_decref, rc);
 
@@ -365,7 +365,7 @@ err_decref:
         RETURN(rc);
 }
 
-static int mgc_process_log(struct obd_device *mgc, 
+static int mgc_process_log(struct obd_device *mgc,
                            struct config_llog_data *cld);
 
 /* FIXME I don't want a thread for every cld; make a list of cld's to requeue
@@ -380,9 +380,9 @@ static int mgc_async_requeue(void *data)
         int rc = 0;
         ENTRY;
 
-        if (!data) 
+        if (!data)
                 RETURN(-EINVAL);
-        if (cld->cld_stopping) 
+        if (cld->cld_stopping)
                 GOTO(out, rc = 0);
 
         lock_kernel();
@@ -391,14 +391,14 @@ static int mgc_async_requeue(void *data)
         sigfillset(&current->blocked);
         RECALC_SIGPENDING;
         SIGNAL_MASK_UNLOCK(current, flags);
-        THREAD_NAME(current->comm, sizeof(current->comm) - 1, "reQ %s", 
+        THREAD_NAME(current->comm, sizeof(current->comm) - 1, "reQ %s",
                     cld->cld_logname);
         unlock_kernel();
 
-        CDEBUG(D_MGC, "requeue "LPX64" %s:%s\n", 
-               cld->cld_resid.name[0], cld->cld_logname, 
+        CDEBUG(D_MGC, "requeue "LPX64" %s:%s\n",
+               cld->cld_resid.name[0], cld->cld_logname,
                cld->cld_cfg.cfg_instance);
-        
+
         /* Sleep a few seconds to allow the server who caused
            the lock revocation to finish its setup, plus some random
            so everyone doesn't try to reconnect at once. */
@@ -415,13 +415,13 @@ static int mgc_async_requeue(void *data)
            every server at every update.  Turning it off until I'm sure
            it's needed. */
         server_register_target(cld->cld_cfg.cfg_sb);
-#endif 
+#endif
         rc = mgc_process_log(the_mgc, cld);
         class_export_put(the_mgc->obd_self_export);
 out:
-        /* Whether we enqueued again or not in mgc_process_log, 
-           we're done with the ref from the old mgc_blocking_ast */        
-        config_log_put(cld);                                                    
+        /* Whether we enqueued again or not in mgc_process_log,
+           we're done with the ref from the old mgc_blocking_ast */
+        config_log_put(cld);
 
         RETURN(rc);
 }
@@ -445,9 +445,9 @@ static int mgc_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc,
         case LDLM_CB_CANCELING: {
                 /* We've given up the lock, prepare ourselves to update. */
                 LDLM_DEBUG(lock, "MGC cancel CB");
-                
+
                 CDEBUG(D_MGC, "Lock res "LPX64" (%.8s)\n",
-                       lock->l_resource->lr_name.name[0], 
+                       lock->l_resource->lr_name.name[0],
                        (char *)&lock->l_resource->lr_name.name[0]);
 
                 /* Make sure not to re-enqueue when the mgc is stopping
@@ -484,7 +484,7 @@ out_drop:
                 /* Drop this here or in mgc_async_requeue,
                    in either case, we're done with the reference
                    after this. */
-                config_log_put(cld);    
+                config_log_put(cld);
                 break;
         }
         default:
@@ -493,7 +493,7 @@ out_drop:
 
 
         if (rc) {
-                CERROR("%s CB failed %d:\n", flag == LDLM_CB_BLOCKING ? 
+                CERROR("%s CB failed %d:\n", flag == LDLM_CB_BLOCKING ?
                        "blocking" : "cancel", rc);
                 LDLM_ERROR(lock, "MGC ast");
         }
@@ -506,7 +506,7 @@ static int mgc_enqueue(struct obd_export *exp, struct lov_stripe_md *lsm,
                        int *flags, void *bl_cb, void *cp_cb, void *gl_cb,
                        void *data, __u32 lvb_len, void *lvb_swabber,
                        struct lustre_handle *lockh)
-{                       
+{
         struct config_llog_data *cld = (struct config_llog_data *)data;
         struct obd_device *obd = class_exp2obd(exp);
         int rc;
@@ -514,7 +514,7 @@ static int mgc_enqueue(struct obd_export *exp, struct lov_stripe_md *lsm,
 
         CDEBUG(D_MGC, "Enqueue for %s (res "LPX64")\n", cld->cld_logname,
                cld->cld_resid.name[0]);
-                
+
         /* We can only drop this config log ref when we drop the lock */
         if (config_log_get(cld))
                 RETURN(ELDLM_LOCK_ABORTED);
@@ -523,7 +523,7 @@ static int mgc_enqueue(struct obd_export *exp, struct lov_stripe_md *lsm,
            ldlm_lock_match (see rev 1.1.2.11.2.47) */
 
         rc = ldlm_cli_enqueue(exp, NULL, obd->obd_namespace, cld->cld_resid,
-                              type, NULL, mode, flags, 
+                              type, NULL, mode, flags,
                               mgc_blocking_ast, ldlm_completion_ast, NULL,
                               data, NULL, 0, NULL, lockh);
 
@@ -619,14 +619,14 @@ static int mgc_target_register(struct obd_export *exp,
                 RETURN(-ENOMEM);
 
         req_mti = lustre_msg_buf(req->rq_reqmsg, 0, sizeof(*req_mti));
-        if (!req_mti) 
+        if (!req_mti)
                 RETURN(-ENOMEM);
         memcpy(req_mti, mti, sizeof(*req_mti));
 
         req->rq_replen = lustre_msg_size(1, &rep_size);
 
         CDEBUG(D_MGC, "register %s\n", mti->mti_svname);
-        
+
         rc = ptlrpc_queue_wait(req);
         if (!rc) {
                 rep_mti = lustre_swab_repbuf(req, 0, sizeof(*rep_mti),
@@ -667,12 +667,12 @@ int mgc_set_info(struct obd_export *exp, obd_count keylen,
                        exp->exp_obd->obd_name, imp->imp_initial_recov_bk);
                 if (imp->imp_invalid) {
                         /* Resurrect if we previously died */
-                        CDEBUG(D_MGC, "Reactivate %s %d:%d:%d\n", 
+                        CDEBUG(D_MGC, "Reactivate %s %d:%d:%d\n",
                                imp->imp_obd->obd_name,
-                               imp->imp_deactive, imp->imp_invalid, 
+                               imp->imp_deactive, imp->imp_invalid,
                                imp->imp_state);
                         /* can't put this in obdclass, module loop with ptlrpc*/
-                        /* This seems to be necessary when restarting a 
+                        /* This seems to be necessary when restarting a
                            combo mgs/mdt while the mgc is alive */
                         ptlrpc_invalidate_import(imp);
                         /* Remove 'invalid' flag */
@@ -716,7 +716,7 @@ int mgc_set_info(struct obd_export *exp, obd_count keylen,
         }
 
         RETURN(rc);
-}               
+}
 
 static int mgc_import_event(struct obd_device *obd,
                             struct obd_import *imp,
@@ -735,9 +735,9 @@ static int mgc_import_event(struct obd_device *obd,
 
                 break;
         }
-        case IMP_EVENT_DISCON: 
-        case IMP_EVENT_INACTIVE: 
-        case IMP_EVENT_ACTIVE: 
+        case IMP_EVENT_DISCON:
+        case IMP_EVENT_INACTIVE:
+        case IMP_EVENT_ACTIVE:
         case IMP_EVENT_OCD:
                 break;
         default:
@@ -800,7 +800,7 @@ static int mgc_llog_is_empty(struct obd_device *obd, struct llog_ctxt *ctxt,
         return(rc <= 1);
 }
 
-static int mgc_copy_handler(struct llog_handle *llh, struct llog_rec_hdr *rec, 
+static int mgc_copy_handler(struct llog_handle *llh, struct llog_rec_hdr *rec,
                             void *data)
 {
         struct llog_rec_hdr local_rec = *rec;
@@ -814,12 +814,12 @@ static int mgc_copy_handler(struct llog_handle *llh, struct llog_rec_hdr *rec,
 
         /* FIXME we should always write to an empty log, so remove this check.*/
         /* append new records */
-        if (rec->lrh_index >= llog_get_size(local_llh)) { 
-                rc = llog_write_rec(local_llh, &local_rec, NULL, 0, 
+        if (rec->lrh_index >= llog_get_size(local_llh)) {
+                rc = llog_write_rec(local_llh, &local_rec, NULL, 0,
                                     (void *)cfg_buf, -1);
 
-                CDEBUG(D_INFO, "idx=%d, rc=%d, len=%d, cmd %x %s %s\n", 
-                       rec->lrh_index, rc, rec->lrh_len, lcfg->lcfg_command, 
+                CDEBUG(D_INFO, "idx=%d, rc=%d, len=%d, cmd %x %s %s\n",
+                       rec->lrh_index, rc, rec->lrh_len, lcfg->lcfg_command,
                        lustre_cfg_string(lcfg, 0), lustre_cfg_string(lcfg, 1));
         } else {
                 CDEBUG(D_INFO, "skip idx=%d\n",  rec->lrh_index);
@@ -878,7 +878,7 @@ DECLARE_MUTEX(llog_process_lock);
 
 /* Get a config log from the MGS and process it.
    This func is called for both clients and servers. */
-static int mgc_process_log(struct obd_device *mgc, 
+static int mgc_process_log(struct obd_device *mgc,
                            struct config_llog_data *cld)
 {
         struct llog_ctxt *ctxt, *lctxt;
@@ -894,12 +894,12 @@ static int mgc_process_log(struct obd_device *mgc,
                 CERROR("Missing cld, aborting log update\n");
                 RETURN(-EINVAL);
         }
-        if (cld->cld_stopping) 
+        if (cld->cld_stopping)
                 RETURN(0);
 
         lsi = s2lsi(cld->cld_cfg.cfg_sb);
 
-        CDEBUG(D_MGC, "Process log %s:%s from %d\n", cld->cld_logname, 
+        CDEBUG(D_MGC, "Process log %s:%s from %d\n", cld->cld_logname,
                cld->cld_cfg.cfg_instance, cld->cld_cfg.cfg_last_idx + 1);
 
         ctxt = llog_get_context(mgc, LLOG_CONFIG_REPL_CTXT);
@@ -908,29 +908,29 @@ static int mgc_process_log(struct obd_device *mgc,
                 RETURN(-EINVAL);
         }
 
-        /* I don't want mutliple processes running process_log at once -- 
-           sounds like badness.  It actually might be fine, as long as 
+        /* I don't want mutliple processes running process_log at once --
+           sounds like badness.  It actually might be fine, as long as
            we're not trying to update from the same log
            simultaneously (in which case we should use a per-log sem.) */
         down(&llog_process_lock);
 
         /* Get the cfg lock on the llog */
-        rcl = mgc_enqueue(mgc->u.cli.cl_mgc_mgsexp, NULL, LDLM_PLAIN, NULL, 
-                          LCK_CR, &flags, NULL, NULL, NULL, 
+        rcl = mgc_enqueue(mgc->u.cli.cl_mgc_mgsexp, NULL, LDLM_PLAIN, NULL,
+                          LCK_CR, &flags, NULL, NULL, NULL,
                           cld, 0, NULL, &lockh);
-        if (rcl) 
+        if (rcl)
                 CERROR("Can't get cfg lock: %d\n", rcl);
-        
+
         lctxt = llog_get_context(mgc, LLOG_CONFIG_ORIG_CTXT);
 
-        /* Copy the setup log locally if we can. Don't mess around if we're 
+        /* Copy the setup log locally if we can. Don't mess around if we're
            running an MGS though (logs are already local). */
-        if (lctxt && lsi && (lsi->lsi_flags & LSI_SERVER) && 
+        if (lctxt && lsi && (lsi->lsi_flags & LSI_SERVER) &&
             (lsi->lsi_srv_mnt == cli->cl_mgc_vfsmnt) &&
             !IS_MGS(lsi->lsi_ldd)) {
                 push_ctxt(&saved, &mgc->obd_lvfs_ctxt, NULL);
                 must_pop++;
-                if (rcl == 0) 
+                if (rcl == 0)
                         /* Only try to copy log if we have the lock. */
                         rc = mgc_copy_llog(mgc, ctxt, lctxt, cld->cld_logname);
                 if (rcl || rc) {
@@ -944,28 +944,28 @@ static int mgc_process_log(struct obd_device *mgc,
                                       "local copy.\n", cld->cld_logname);
                 }
                 /* Now, whether we copied or not, start using the local llog.
-                   If we failed to copy, we'll start using whatever the old 
+                   If we failed to copy, we'll start using whatever the old
                    log has. */
                 ctxt = lctxt;
         }
 
-        /* logname and instance info should be the same, so use our 
+        /* logname and instance info should be the same, so use our
            copy of the instance for the update.  The cfg_last_idx will
            be updated here. */
         rc = class_config_parse_llog(ctxt, cld->cld_logname, &cld->cld_cfg);
-        
+
  out_pop:
-        if (must_pop) 
+        if (must_pop)
                 pop_ctxt(&saved, &mgc->obd_lvfs_ctxt, NULL);
 
-        /* Now drop the lock so MGS can revoke it */ 
+        /* Now drop the lock so MGS can revoke it */
         if (!rcl) {
-                rcl = mgc_cancel(mgc->u.cli.cl_mgc_mgsexp, NULL, 
+                rcl = mgc_cancel(mgc->u.cli.cl_mgc_mgsexp, NULL,
                                  LCK_CR, &lockh);
-                if (rcl) 
+                if (rcl)
                         CERROR("Can't drop cfg lock: %d\n", rcl);
         }
-        
+
         if (rc) {
                 CERROR("%s: the configuration '%s' could not be read "
                        "(%d) from the MGS.\n",
@@ -973,7 +973,7 @@ static int mgc_process_log(struct obd_device *mgc,
         }
 
         up(&llog_process_lock);
-        
+
         RETURN(rc);
 }
 
@@ -988,17 +988,17 @@ static int mgc_process_config(struct obd_device *obd, obd_count len, void *buf)
         case LCFG_LOV_ADD_OBD: {
                 struct mgs_target_info *mti;
 
-                if (LUSTRE_CFG_BUFLEN(lcfg, 1) != 
+                if (LUSTRE_CFG_BUFLEN(lcfg, 1) !=
                     sizeof(struct mgs_target_info))
                         GOTO(out, rc = -EINVAL);
 
                 mti = (struct mgs_target_info *)lustre_cfg_buf(lcfg, 1);
-                CDEBUG(D_MGC, "add_target %s %#x\n",    
+                CDEBUG(D_MGC, "add_target %s %#x\n",
                        mti->mti_svname, mti->mti_flags);
                 rc = mgc_target_register(obd->u.cli.cl_mgc_mgsexp, mti);
                 break;
         }
-        case LCFG_LOV_DEL_OBD: 
+        case LCFG_LOV_DEL_OBD:
                 /* FIXME */
                 CERROR("lov_del_obd unimplemented\n");
                 rc = -ENOSYS;
@@ -1010,29 +1010,29 @@ static int mgc_process_config(struct obd_device *obd, obd_count len, void *buf)
                 char *logname = lustre_cfg_string(lcfg, 1);
                 cfg = (struct config_llog_instance *)lustre_cfg_buf(lcfg, 2);
                 sb = *(struct super_block **)lustre_cfg_buf(lcfg, 3);
-                
-                CDEBUG(D_MGC, "parse_log %s from %d\n", logname, 
+
+                CDEBUG(D_MGC, "parse_log %s from %d\n", logname,
                        cfg->cfg_last_idx);
 
                 /* We're only called through here on the initial mount */
                 rc = config_log_add(logname, cfg, sb);
-                if (rc) 
+                if (rc)
                         break;
                 cld = config_log_find(logname, cfg);
                 if (IS_ERR(cld)) {
                         rc = PTR_ERR(cld);
                         break;
                 }
-                
+
                 /* COMPAT_146 */
                 /* For old logs, there was no start marker. */
                 /* FIXME only set this for old logs! */
                 cld->cld_cfg.cfg_flags |= CFG_F_MARKER;
-                
+
                 rc = mgc_process_log(obd, cld);
                 config_log_put(cld);
-                
-                break;       
+
+                break;
         }
         case LCFG_LOG_END: {
                 struct config_llog_instance *cfg = NULL;
index b25b42d..d4c5aef 100644 (file)
@@ -116,7 +116,7 @@ static int mgs_cleanup(struct obd_device *obd);
 static int mgs_handle(struct ptlrpc_request *req);
 
 /* Start the MGS obd */
-static int mgs_setup(struct obd_device *obd, obd_count len, void *buf)
+static int mgs_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
 {
         struct lprocfs_static_vars lvars;
         struct mgs_obd *mgs = &obd->u.mgs;
@@ -130,7 +130,7 @@ static int mgs_setup(struct obd_device *obd, obd_count len, void *buf)
 
         /* Find our disk */
         lmi = server_get_mount(obd->obd_name);
-        if (!lmi) 
+        if (!lmi)
                 RETURN(rc = -EINVAL);
 
         mnt = lmi->lmi_mnt;
@@ -178,9 +178,9 @@ static int mgs_setup(struct obd_device *obd, obd_count len, void *buf)
         /* Start the service threads */
         mgs->mgs_service =
                 ptlrpc_init_svc(MGS_NBUFS, MGS_BUFSIZE, MGS_MAXREQSIZE,
-                                MGS_MAXREPSIZE, MGS_REQUEST_PORTAL, 
+                                MGS_MAXREPSIZE, MGS_REQUEST_PORTAL,
                                 MGC_REPLY_PORTAL, MGS_SERVICE_WATCHDOG_TIMEOUT,
-                                mgs_handle, LUSTRE_MGS_NAME, 
+                                mgs_handle, LUSTRE_MGS_NAME,
                                 obd->obd_proc_entry, NULL, MGS_NUM_THREADS);
 
         if (!mgs->mgs_service) {
@@ -245,7 +245,7 @@ static int mgs_cleanup(struct obd_device *obd)
                 RETURN(0);
 
         save_dev = lvfs_sbdev(mgs->mgs_sb);
-        
+
         lprocfs_obd_cleanup(obd);
 
         ptlrpc_unregister_service(mgs->mgs_service);
@@ -277,14 +277,14 @@ static int mgs_get_cfg_lock(struct obd_device *obd, char *fsname,
         ENTRY;
 
         rc = mgc_logname2resid(fsname, &res_id);
-        if (!rc) 
+        if (!rc)
                 rc = ldlm_cli_enqueue(NULL, NULL, obd->obd_namespace, res_id,
                                       LDLM_PLAIN, NULL, LCK_EX, &flags,
-                                      ldlm_blocking_ast, ldlm_completion_ast, 
+                                      ldlm_blocking_ast, ldlm_completion_ast,
                                       NULL, fsname, NULL, 0, NULL, lockh);
-        if (rc) 
+        if (rc)
                 CERROR("can't take cfg lock for %s (%d)\n", fsname, rc);
-        
+
         RETURN(rc);
 }
 
@@ -317,7 +317,7 @@ static int mgs_check_target(struct obd_device *obd, struct mgs_target_info *mti)
         } else {
                 /* Index is correctly marked as used */
 
-                /* If the logs don't contain the mti_nids then add 
+                /* If the logs don't contain the mti_nids then add
                    them as failover nids */
                 rc = mgs_check_failnid(obd, mti);
         }
@@ -328,7 +328,7 @@ static int mgs_check_target(struct obd_device *obd, struct mgs_target_info *mti)
 
 /* Called whenever a target starts up.  Flags indicate first connect, etc. */
 static int mgs_handle_target_reg(struct ptlrpc_request *req)
-{    
+{
         struct obd_device *obd = req->rq_export->exp_obd;
         struct lustre_handle lockh;
         struct mgs_target_info *mti, *rep_mti;
@@ -338,7 +338,7 @@ static int mgs_handle_target_reg(struct ptlrpc_request *req)
 
         mti = lustre_swab_reqbuf(req, 0, sizeof(*mti),
                                  lustre_swab_mgs_target_info);
-        
+
         if (!(mti->mti_flags & (LDD_F_WRITECONF | LDD_F_UPGRADE14 |
                                 LDD_F_UPDATE))) {
                 /* We're just here as a startup ping. */
@@ -346,14 +346,14 @@ static int mgs_handle_target_reg(struct ptlrpc_request *req)
                        mti->mti_svname, obd_export_nid2str(req->rq_export));
                 rc = mgs_check_target(obd, mti);
                 /* above will set appropriate mti flags */
-                if (!rc) 
+                if (!rc)
                         /* Nothing wrong, don't revoke lock */
                         GOTO(out_nolock, rc);
         }
 
         /* Revoke the config lock to make sure nobody is reading. */
         /* Although actually I think it should be alright if
-           someone was reading while we were updating the logs - if we 
+           someone was reading while we were updating the logs - if we
            revoke at the end they will just update from where they left off. */
         lockrc = mgs_get_cfg_lock(obd, mti->mti_fsname, &lockh);
         if (lockrc != ELDLM_OK) {
@@ -383,7 +383,7 @@ static int mgs_handle_target_reg(struct ptlrpc_request *req)
                         CERROR("Can't upgrade from 1.4 (%d)\n", rc);
                         GOTO(out, rc);
                 }
-                
+
                 mti->mti_flags &= ~LDD_F_UPGRADE14;
                 /* Turn off the upgrade flag permanently */
                 mti->mti_flags |= LDD_F_REWRITE_LDD;
@@ -391,19 +391,19 @@ static int mgs_handle_target_reg(struct ptlrpc_request *req)
         /* end COMPAT_146 */
 
         if (mti->mti_flags & LDD_F_UPDATE) {
-                CDEBUG(D_MGS, "adding %s, index=%d\n", mti->mti_svname, 
+                CDEBUG(D_MGS, "adding %s, index=%d\n", mti->mti_svname,
                        mti->mti_stripe_index);
-                
-                /* create the log for the new target 
+
+                /* create the log for the new target
                    and update the client/mdt logs */
                 rc = mgs_write_log_target(obd, mti);
                 if (rc) {
-                        CERROR("Failed to write %s log (%d)\n", 
+                        CERROR("Failed to write %s log (%d)\n",
                                mti->mti_svname, rc);
                         GOTO(out, rc);
                 }
 
-                mti->mti_flags &= ~(LDD_F_VIRGIN | LDD_F_UPDATE | 
+                mti->mti_flags &= ~(LDD_F_VIRGIN | LDD_F_UPDATE |
                                     LDD_F_NEED_INDEX);
                 mti->mti_flags |= LDD_F_REWRITE_LDD;
         }
@@ -413,9 +413,9 @@ out:
         if (lockrc == ELDLM_OK)
                 mgs_put_cfg_lock(&lockh);
 out_nolock:
-        CDEBUG(D_MGS, "replying with %s, index=%d, rc=%d\n", mti->mti_svname, 
+        CDEBUG(D_MGS, "replying with %s, index=%d, rc=%d\n", mti->mti_svname,
                mti->mti_stripe_index, rc);
-        lustre_pack_reply(req, 1, &rep_size, NULL); 
+        lustre_pack_reply(req, 1, &rep_size, NULL);
         /* send back the whole mti in the reply */
         rep_mti = lustre_msg_buf(req->rq_repmsg, 0, sizeof(*rep_mti));
         memcpy(rep_mti, mti, sizeof(*rep_mti));
@@ -523,7 +523,7 @@ int mgs_handle(struct ptlrpc_request *req)
         }
 
         LASSERT(current->journal_info == NULL);
-        
+
         CDEBUG(D_CONFIG | (rc?D_ERROR:0), "MGS handle cmd=%d rc=%d\n",
                req->rq_reqmsg->opc, rc);
 
@@ -577,7 +577,7 @@ int mgs_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
                 if (lcfg == NULL)
                         RETURN(-ENOMEM);
                 rc = copy_from_user(lcfg, data->ioc_pbuf1, data->ioc_plen1);
-                if (rc) 
+                if (rc)
                         GOTO(out_free, rc);
 
                 if (lcfg->lcfg_bufcount < 1)
@@ -591,10 +591,10 @@ int mgs_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
                         if (!ptr) {
                                 /* assume devname is the fsname */
                                 strncpy(fsname, devname, sizeof(fsname));
-                        } else {  
+                        } else {
                                 strncpy(fsname, devname, ptr - devname);
                         }
-                        CDEBUG(D_MGS, "set param on fs %s device %s\n", 
+                        CDEBUG(D_MGS, "set param on fs %s device %s\n",
                                fsname, devname);
                 } else {
                         CDEBUG(D_MGS, "set global param\n");
@@ -612,8 +612,8 @@ int mgs_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
                    writing (above). */
                 if (fsname) {
                         lockrc = mgs_get_cfg_lock(obd, fsname, &lockh);
-                        if (lockrc != ELDLM_OK) 
-                                CERROR("lock error %d for fs %s\n", lockrc, 
+                        if (lockrc != ELDLM_OK)
+                                CERROR("lock error %d for fs %s\n", lockrc,
                                        fsname);
                         else
                                 mgs_put_cfg_lock(&lockh);
index 1b7a6ed..53e4469 100644 (file)
@@ -530,10 +530,10 @@ static int llog_test_7(struct obd_device *obd)
         }
 
         rc = llog_destroy(llh);
-        if (rc) 
+        if (rc)
                 CERROR("7: llog_destroy failed: %d\n", rc);
         else
-                llog_free_handle(llh); 
+                llog_free_handle(llh);
         RETURN(rc);
 }
 
@@ -627,10 +627,9 @@ static int llog_test_cleanup(struct obd_device *obd)
         return rc;
 }
 
-static int llog_test_setup(struct obd_device *obd, obd_count len, void *buf)
+static int llog_test_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
 {
         struct lprocfs_static_vars lvars;
-        struct lustre_cfg *lcfg = buf;
         struct obd_device *tgt;
         int rc;
         ENTRY;
index 41bcaa9..f06a1ba 100644 (file)
@@ -75,10 +75,10 @@ int class_attach(struct lustre_cfg *lcfg)
 
         CDEBUG(D_IOCTL, "attach type %s name: %s uuid: %s\n",
                MKSTR(typename), MKSTR(name), MKSTR(uuid));
-        
+
         /* Mountconf transitional hack, should go away after 1.6.
-           1.4.7 uses the old names, so translate back if the 
-           mountconf flag is set. 
+           1.4.7 uses the old names, so translate back if the
+           mountconf flag is set.
            1.6 should set this flag, and translate the other way here
            if not set. */
         if (lcfg->lcfg_flags & LCFG_FLG_MOUNTCONF){
@@ -216,7 +216,7 @@ int class_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
         list_del_init(&exp->exp_obd_chain_timed);
         class_export_put(exp);
 
-        err = obd_setup(obd, sizeof(*lcfg), lcfg);
+        err = obd_setup(obd, lcfg);
         if (err)
                 GOTO(err_exp, err);
 
@@ -346,7 +346,7 @@ int class_cleanup(struct obd_device *obd, struct lustre_cfg *lcfg)
                                 obd->obd_force = 1;
                                 break;
                         case 'A':
-                                LCONSOLE_WARN("Failing over %s\n", 
+                                LCONSOLE_WARN("Failing over %s\n",
                                               obd->obd_name);
                                 obd->obd_fail = 1;
                                 obd->obd_no_transno = 1;
@@ -461,7 +461,7 @@ int class_add_conn(struct obd_device *obd, struct lustre_cfg *lcfg)
                 RETURN(-EINVAL);
         }
         if (strcmp(obd->obd_type->typ_name, LUSTRE_MDC_NAME) &&
-            strcmp(obd->obd_type->typ_name, LUSTRE_OSC_NAME) && 
+            strcmp(obd->obd_type->typ_name, LUSTRE_OSC_NAME) &&
             strcmp(obd->obd_type->typ_name, LUSTRE_MGC_NAME)) {
                 CERROR("can't add connection on non-client dev\n");
                 RETURN(-EINVAL);
@@ -564,8 +564,8 @@ out:
                 OBD_FREE(lprof->lp_osc, osclen);
         if (lprof->lp_profile)
                 OBD_FREE(lprof->lp_profile, proflen);
-        OBD_FREE(lprof, sizeof(*lprof));        
-        RETURN(err);                             
+        OBD_FREE(lprof, sizeof(*lprof));
+        RETURN(err);
 }
 
 void class_del_profile(char *prof)
@@ -700,7 +700,7 @@ int class_process_config(struct lustre_cfg *lcfg)
         }
         }
 out:
-        if ((err == -ENOSYS || err == -EINVAL) && 
+        if ((err == -ENOSYS || err == -EINVAL) &&
             !(lcfg->lcfg_command & LCFG_REQUIRED)) {
                 CWARN("Skipping optional command %#x\n", lcfg->lcfg_command);
                 err = 0;
@@ -725,7 +725,7 @@ static int class_config_llog_handler(struct llog_handle * handle,
         char *cfg_buf = (char*) (rec + 1);
         int rc = 0;
         ENTRY;
-        
+
         //class_config_dump_handler(handle, rec, data);
 
         switch (rec->lrh_type) {
@@ -752,11 +752,11 @@ static int class_config_llog_handler(struct llog_handle * handle,
                         if (marker->cm_flags & CM_START) {
                                 /* all previous flags off */
                                 cfg->cfg_flags = CFG_F_MARKER;
-                                if (marker->cm_flags & CM_SKIP) { 
+                                if (marker->cm_flags & CM_SKIP) {
                                         cfg->cfg_flags |= CFG_F_SKIP;
                                         CDEBUG(D_CONFIG, "SKIP #%d\n",
                                                marker->cm_step);
-                                } else if (lustre_check_exclusion(cfg->cfg_sb, 
+                                } else if (lustre_check_exclusion(cfg->cfg_sb,
                                                           marker->cm_svname)) {
                                         cfg->cfg_flags |= CFG_F_EXCLUDE;
                                         CDEBUG(D_CONFIG, "EXCLUDE %d\n",
@@ -766,15 +766,15 @@ static int class_config_llog_handler(struct llog_handle * handle,
                                 cfg->cfg_flags = 0;
                         }
                 }
-                /* A config command without a start marker before it is 
+                /* A config command without a start marker before it is
                    illegal (1.4.6. compat must set it artificially) */
-                if (!(cfg->cfg_flags & CFG_F_MARKER) && 
+                if (!(cfg->cfg_flags & CFG_F_MARKER) &&
                     (lcfg->lcfg_command != LCFG_MARKER)) {
-                        CWARN("Config not inside markers, ignoring! (%#x)\n", 
+                        CWARN("Config not inside markers, ignoring! (%#x)\n",
                               cfg->cfg_flags);
                         cfg->cfg_flags |= CFG_F_SKIP;
                 }
-                
+
                 if (cfg->cfg_flags & CFG_F_SKIP) {
                         // FIXME warning
                         CDEBUG(D_CONFIG|D_WARNING, "skipping %#x\n",
@@ -784,7 +784,7 @@ static int class_config_llog_handler(struct llog_handle * handle,
                         break;
                 }
 
-                if ((cfg->cfg_flags & CFG_F_EXCLUDE) && 
+                if ((cfg->cfg_flags & CFG_F_EXCLUDE) &&
                     (lcfg->lcfg_command == LCFG_LOV_ADD_OBD))
                         /* Add inactive instead */
                         lcfg->lcfg_command = LCFG_LOV_ADD_INA;
@@ -802,13 +802,13 @@ static int class_config_llog_handler(struct llog_handle * handle,
                                 lustre_cfg_string(lcfg, 0),
                                 cfg->cfg_instance);
                         lustre_cfg_bufs_set_string(&bufs, 0, inst_name);
-                        CDEBUG(D_CONFIG, "cmd %x, instance name: %s\n", 
+                        CDEBUG(D_CONFIG, "cmd %x, instance name: %s\n",
                                lcfg->lcfg_command, inst_name);
                 }
 
                 /* we override the llog's uuid for clients, to insure they
                 are unique */
-                if (cfg && cfg->cfg_instance && 
+                if (cfg && cfg->cfg_instance &&
                     lcfg->lcfg_command == LCFG_ATTACH) {
                         lustre_cfg_bufs_set_string(&bufs, 2,
                                                    cfg->cfg_uuid.uuid);
@@ -835,7 +835,7 @@ static int class_config_llog_handler(struct llog_handle * handle,
                 }
 
                 lcfg_new->lcfg_nal = 0; /* illegal value for obsolete field */
-                
+
                 rc = class_process_config(lcfg_new);
                 lustre_cfg_free(lcfg_new);
 
@@ -885,7 +885,7 @@ int class_config_parse_llog(struct llog_ctxt *ctxt, char *name,
         rc = llog_process(llh, class_config_llog_handler, cfg, &cd);
 
         // FIXME remove warning
-        CDEBUG(D_CONFIG|D_WARNING, "Processed log %s gen %d-%d (%d)\n", name, 
+        CDEBUG(D_CONFIG|D_WARNING, "Processed log %s gen %d-%d (%d)\n", name,
                cd.first_idx + 1, cd.last_idx, rc);
         if (cfg)
                 cfg->cfg_last_idx = cd.last_idx;
@@ -940,7 +940,7 @@ int class_config_dump_handler(struct llog_handle * handle,
                 if (lcfg->lcfg_command == LCFG_MARKER) {
                         struct cfg_marker *marker = lustre_cfg_buf(lcfg, 1);
                         ptr += snprintf(ptr, end-ptr, "marker=%d(%#x)%s '%s'",
-                                        marker->cm_step, marker->cm_flags, 
+                                        marker->cm_step, marker->cm_flags,
                                         marker->cm_svname, marker->cm_comment);
                 } else {
                         for (i = 0; i <  lcfg->lcfg_bufcount; i++) {
index 33c4cf0..5be0f8b 100644 (file)
@@ -142,7 +142,7 @@ int echo_create(struct obd_export *exp, struct obdo *oa,
 }
 
 int echo_destroy(struct obd_export *exp, struct obdo *oa,
-                 struct lov_stripe_md *ea, struct obd_trans_info *oti, 
+                 struct lov_stripe_md *ea, struct obd_trans_info *oti,
                  struct obd_export *md_exp)
 {
         struct obd_device *obd = class_exp2obd(exp);
@@ -463,7 +463,7 @@ commitrw_cleanup:
         return rc;
 }
 
-static int echo_setup(struct obd_device *obd, obd_count len, void *buf)
+static int echo_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
 {
         struct lprocfs_static_vars lvars;
         int                        rc;
index 503633b..5c90203 100644 (file)
@@ -429,9 +429,9 @@ echo_get_stripe_off_id (struct lov_stripe_md *lsm, obd_off *offp, obd_id *idp)
         *offp = offset * stripe_size + woffset % stripe_size;
 }
 
-static void 
-echo_client_page_debug_setup(struct lov_stripe_md *lsm, 
-                             struct page *page, int rw, obd_id id, 
+static void
+echo_client_page_debug_setup(struct lov_stripe_md *lsm,
+                             struct page *page, int rw, obd_id id,
                              obd_off offset, obd_off count)
 {
         char    *addr;
@@ -453,7 +453,7 @@ echo_client_page_debug_setup(struct lov_stripe_md *lsm,
                         stripe_off = 0xdeadbeef00c0ffeeULL;
                         stripe_id = 0xdeadbeef00c0ffeeULL;
                 }
-                block_debug_setup(addr + delta, OBD_ECHO_BLOCK_SIZE, 
+                block_debug_setup(addr + delta, OBD_ECHO_BLOCK_SIZE,
                                   stripe_off, stripe_id);
         }
 
@@ -461,8 +461,8 @@ echo_client_page_debug_setup(struct lov_stripe_md *lsm,
 }
 
 static int
-echo_client_page_debug_check(struct lov_stripe_md *lsm, 
-                             struct page *page, obd_id id, 
+echo_client_page_debug_check(struct lov_stripe_md *lsm,
+                             struct page *page, obd_id id,
                              obd_off offset, obd_off count)
 {
         obd_off stripe_off;
@@ -482,8 +482,8 @@ echo_client_page_debug_check(struct lov_stripe_md *lsm,
                 stripe_id = id;
                 echo_get_stripe_off_id (lsm, &stripe_off, &stripe_id);
 
-                rc2 = block_debug_check("test_brw", 
-                                        addr + delta, OBD_ECHO_BLOCK_SIZE, 
+                rc2 = block_debug_check("test_brw",
+                                        addr + delta, OBD_ECHO_BLOCK_SIZE,
                                         stripe_off, stripe_id);
                 if (rc2 != 0) {
                         CERROR ("Error in echo object "LPX64"\n", id);
@@ -546,7 +546,7 @@ static int echo_client_kbrw(struct obd_device *obd, int rw, struct obdo *oa,
                 pgp->flag = 0;
 
                 if (verify)
-                        echo_client_page_debug_setup(lsm, pgp->pg, rw, 
+                        echo_client_page_debug_setup(lsm, pgp->pg, rw,
                                                      oa->o_id, off, pgp->count);
         }
 
@@ -723,7 +723,7 @@ static void ec_ap_completion(void *data, int cmd, struct obdo *oa, int rc)
             eas->eas_oa.o_id != ECHO_PERSISTENT_OBJID &&
             (eas->eas_oa.o_valid & OBD_MD_FLFLAGS) != 0 &&
             (eas->eas_oa.o_flags & OBD_FL_DEBUG_CHECK) != 0)
-                echo_client_page_debug_check(eas->eas_lsm, eap->eap_page, 
+                echo_client_page_debug_check(eas->eas_lsm, eap->eap_page,
                                              eas->eas_oa.o_id, eap->eap_off,
                                              PAGE_SIZE);
 
@@ -815,7 +815,7 @@ static int echo_client_async_page(struct obd_export *exp, int rw,
 
                 /* sleep until we have a page to send */
                 spin_unlock_irqrestore(&eas.eas_lock, flags);
-                rc = wait_event_interruptible(eas.eas_waitq, 
+                rc = wait_event_interruptible(eas.eas_waitq,
                                               eas_should_wake(&eas));
                 spin_lock_irqsave(&eas.eas_lock, flags);
                 if (rc && !eas.eas_rc)
@@ -831,7 +831,7 @@ static int echo_client_async_page(struct obd_export *exp, int rw,
 
                 /* unbind the eap from its old page offset */
                 if (eap->eap_cookie != NULL) {
-                        obd_teardown_async_page(exp, lsm, NULL, 
+                        obd_teardown_async_page(exp, lsm, NULL,
                                                 eap->eap_cookie);
                         eap->eap_cookie = NULL;
                 }
@@ -851,8 +851,8 @@ static int echo_client_async_page(struct obd_export *exp, int rw,
                 if (oa->o_id != ECHO_PERSISTENT_OBJID &&
                     (oa->o_valid & OBD_MD_FLFLAGS) != 0 &&
                     (oa->o_flags & OBD_FL_DEBUG_CHECK) != 0)
-                        echo_client_page_debug_setup(lsm, eap->eap_page, rw, 
-                                                     oa->o_id, 
+                        echo_client_page_debug_setup(lsm, eap->eap_page, rw,
+                                                     oa->o_id,
                                                      eap->eap_off, PAGE_SIZE);
 
                 /* always asserts urgent, which isn't quite right */
@@ -868,14 +868,14 @@ static int echo_client_async_page(struct obd_export *exp, int rw,
                 eas.eas_in_flight++;
                 if (eas.eas_next_offset == eas.eas_end_offset)
                         break;
-        } 
+        }
 
         /* still hold the eas_lock here.. */
 
         /* now we just spin waiting for all the rpcs to complete */
         while(eas.eas_in_flight) {
                 spin_unlock_irqrestore(&eas.eas_lock, flags);
-                wait_event_interruptible(eas.eas_waitq, 
+                wait_event_interruptible(eas.eas_waitq,
                                          eas.eas_in_flight == 0);
                 spin_lock_irqsave(&eas.eas_lock, flags);
         }
@@ -883,14 +883,14 @@ static int echo_client_async_page(struct obd_export *exp, int rw,
 
 out:
         list_for_each_safe(pos, n, &pages) {
-                struct page *page = list_entry(pos, struct page, 
+                struct page *page = list_entry(pos, struct page,
                                                PAGE_LIST_ENTRY);
 
                 list_del(&PAGE_LIST(page));
                 if (page->private != 0) {
                         eap = (struct echo_async_page *)page->private;
                         if (eap->eap_cookie != NULL)
-                                obd_teardown_async_page(exp, lsm, NULL, 
+                                obd_teardown_async_page(exp, lsm, NULL,
                                                         eap->eap_cookie);
                         OBD_FREE(eap, sizeof(*eap));
                 }
@@ -902,7 +902,7 @@ out:
 
 static int echo_client_prep_commit(struct obd_export *exp, int rw,
                                    struct obdo *oa, struct lov_stripe_md *lsm,
-                                   obd_off offset, obd_size count,  
+                                   obd_off offset, obd_size count,
                                    obd_size batch, struct obd_trans_info *oti)
 {
         struct obd_ioobj ioo;
@@ -1222,7 +1222,7 @@ echo_client_iocontrol(unsigned int cmd, struct obd_export *exp,
                         oa = &data->ioc_obdo1;
                         oa->o_gr = FILTER_GROUP_ECHO;
                         oa->o_valid |= OBD_MD_FLGROUP;
-                        rc = obd_destroy(ec->ec_exp, oa, eco->eco_lsm, 
+                        rc = obd_destroy(ec->ec_exp, oa, eco->eco_lsm,
                                          &dummy_oti, NULL);
                         if (rc == 0)
                                 eco->eco_deleted = 1;
@@ -1309,7 +1309,7 @@ echo_client_iocontrol(unsigned int cmd, struct obd_export *exp,
  out:
 
         /* XXX this should be in a helper also called by target_send_reply */
-        for (ack_lock = dummy_oti.oti_ack_locks, i = 0; i < 4; 
+        for (ack_lock = dummy_oti.oti_ack_locks, i = 0; i < 4;
              i++, ack_lock++) {
                 if (!ack_lock->mode)
                         break;
@@ -1321,10 +1321,8 @@ echo_client_iocontrol(unsigned int cmd, struct obd_export *exp,
         return rc;
 }
 
-static int
-echo_client_setup(struct obd_device *obddev, obd_count len, void *buf)
+static int echo_client_setup(struct obd_device *obddev, struct lustre_cfg *lcfg)
 {
-        struct lustre_cfg* lcfg = buf;
         struct echo_client_obd *ec = &obddev->u.echo_client;
         struct obd_device *tgt;
         struct lustre_handle conn = {0, };
@@ -1355,7 +1353,7 @@ echo_client_setup(struct obd_device *obddev, obd_count len, void *buf)
                        lustre_cfg_string(lcfg, 1));
                 return -ENOMEM;
         }
-        
+
         ocd->ocd_version = LUSTRE_VERSION_CODE;
 
         rc = obd_connect(&conn, tgt, &echo_uuid, ocd);
index d04cb91..8d773c3 100644 (file)
@@ -1383,10 +1383,9 @@ void *filter_iobuf_get(struct filter_obd *filter, struct obd_trans_info *oti)
  * 3 = flags: failover=f, failout=n
  * 4 = mount options
  */
-int filter_common_setup(struct obd_device *obd, obd_count len, void *buf,
+int filter_common_setup(struct obd_device *obd, struct lustre_cfg* lcfg,
                         void *option)
 {
-        struct lustre_cfg* lcfg = buf;
         struct filter_obd *filter = &obd->u.filter;
         struct vfsmount *mnt;
         struct lustre_mount_info *lmi;
@@ -1414,7 +1413,7 @@ int filter_common_setup(struct obd_device *obd, obd_count len, void *buf,
                 CERROR("Using old MDS mount method\n");
                 mnt = do_kern_mount(lustre_cfg_string(lcfg, 2),
                                     MS_NOATIME|MS_NODIRATIME,
-                                    lustre_cfg_string(lcfg, 1), option);    
+                                    lustre_cfg_string(lcfg, 1), option);
                 if (IS_ERR(mnt)) {
                         rc = PTR_ERR(mnt);
                         LCONSOLE_ERROR("Can't mount disk %s (%d)\n",
@@ -1554,10 +1553,9 @@ err_mntput:
         return rc;
 }
 
-static int filter_setup(struct obd_device *obd, obd_count len, void *buf)
+static int filter_setup(struct obd_device *obd, struct lustre_cfg* lcfg)
 {
         struct lprocfs_static_vars lvars;
-        struct lustre_cfg* lcfg = buf;
         unsigned long page;
         int rc;
 
@@ -1574,7 +1572,7 @@ static int filter_setup(struct obd_device *obd, obd_count len, void *buf)
 
         memcpy((void *)page, lustre_cfg_buf(lcfg, 4),
                LUSTRE_CFG_BUFLEN(lcfg, 4));
-        rc = filter_common_setup(obd, len, buf, (void *)page);
+        rc = filter_common_setup(obd, lcfg, (void *)page);
         free_page(page);
 
         lprocfs_init_vars(filter, &lvars);
@@ -1711,8 +1709,8 @@ static int filter_cleanup(struct obd_device *obd)
                 unlock_kernel();
                 must_relock++;
         }
-        
-        if (must_put) 
+
+        if (must_put)
                 /* In case we didn't mount with lustre_get_mount -- old method*/
                 mntput(filter->fo_vfsmnt);
         obd->u.obt.obt_sb = NULL;
@@ -1734,9 +1732,9 @@ static int filter_cleanup(struct obd_device *obd)
 static int filter_connect_internal(struct obd_export *exp,
                                    struct obd_connect_data *data)
 {
-        if (!data) 
+        if (!data)
                 RETURN(0);
-        
+
         CDEBUG(D_RPCTRACE, "%s: cli %s/%p ocd_connect_flags: "LPX64
                " ocd_version: %x ocd_grant: %d\n",
                exp->exp_obd->obd_name, exp->exp_client_uuid.uuid, exp,
@@ -1766,19 +1764,19 @@ static int filter_connect_internal(struct obd_export *exp,
                 struct filter_obd *filter = &exp->exp_obd->u.filter;
                 struct lr_server_data *lsd = filter->fo_fsd;
                 int index = le32_to_cpu(lsd->lsd_ost_index);
-                
+
                 if (!(lsd->lsd_feature_compat &
                       cpu_to_le32(OBD_COMPAT_OST))) {
                         /* this will only happen on the first connect */
                         lsd->lsd_ost_index = le32_to_cpu(data->ocd_index);
                         lsd->lsd_feature_compat |= cpu_to_le32(OBD_COMPAT_OST);
-                        filter_update_server_data(exp->exp_obd, 
+                        filter_update_server_data(exp->exp_obd,
                                                   filter->fo_rcvd_filp, lsd, 1);
                 } else if (index != data->ocd_index) {
                         LCONSOLE_ERROR("Connection from %s to index "
                                        "%u doesn't match actual OST "
                                        "index %u, bad configuration?\n",
-                                       obd_export_nid2str(exp), index, 
+                                       obd_export_nid2str(exp), index,
                                        data->ocd_index);
                         RETURN(-EBADF);
                 }
@@ -2234,7 +2232,7 @@ out_unlock:
                 unsigned int cur_ids[MAXQUOTAS] = {oa->o_uid, oa->o_gid};
                 int rc2 = lquota_adjust(quota_interface, exp->exp_obd, cur_ids,
                                         orig_ids, rc, FSFILT_OP_SETATTR);
-                CDEBUG(rc2 ? D_ERROR : D_QUOTA, 
+                CDEBUG(rc2 ? D_ERROR : D_QUOTA,
                        "filter adjust qunit. (rc:%d)\n", rc2);
         }
         return rc;
@@ -2462,7 +2460,7 @@ static int filter_statfs(struct obd_device *obd, struct obd_statfs *osfs,
         /* set EROFS to state field if FS is mounted as RDONLY. The goal is to
          * stop creating files on MDS if OST is not good shape to create
          * objects.*/
-        osfs->os_state = (filter->fo_obt.obt_sb->s_flags & MS_RDONLY) ? 
+        osfs->os_state = (filter->fo_obt.obt_sb->s_flags & MS_RDONLY) ?
                 EROFS : 0;
         RETURN(rc);
 }
@@ -2821,8 +2819,8 @@ cleanup:
         qcids[USRQUOTA] = oa->o_uid;
         qcids[GRPQUOTA] = oa->o_gid;
         rc2 = lquota_adjust(quota_interface, obd, qcids, NULL, rc,
-                            FSFILT_OP_UNLINK); 
-        CDEBUG(rc2 ? D_ERROR : D_QUOTA, 
+                            FSFILT_OP_UNLINK);
+        CDEBUG(rc2 ? D_ERROR : D_QUOTA,
                "filter adjust qunit! (rc:%d)\n", rc2);
         return rc;
 }
@@ -2843,7 +2841,7 @@ static int filter_truncate(struct obd_export *exp, struct obdo *oa,
 
         CDEBUG(D_INODE, "calling truncate for object "LPU64", valid = "LPX64
                ", o_size = "LPD64"\n", oa->o_id, oa->o_valid, start);
-        
+
         oa->o_size = start;
         rc = filter_setattr(exp, oa, NULL, oti);
         RETURN(rc);
@@ -2963,7 +2961,7 @@ static int filter_set_info(struct obd_export *exp, __u32 keylen,
         /* setup llog imports */
         ctxt = llog_get_context(obd, LLOG_MDS_OST_REPL_CTXT);
         rc = llog_receptor_accept(ctxt, exp->exp_imp_reverse);
-        
+
         lquota_setinfo(quota_interface, exp, obd);
 
         RETURN(rc);
@@ -3155,11 +3153,11 @@ static int __init obdfilter_init(void)
 out:
                 if (quota_interface)
                         PORTAL_SYMBOL_PUT(filter_quota_interface);
-                        
+
                 OBD_FREE(obdfilter_created_scratchpad,
                          OBDFILTER_CREATED_SCRATCHPAD_ENTRIES *
                          sizeof(*obdfilter_created_scratchpad));
-        } 
+        }
 
         return rc;
 }
@@ -3171,7 +3169,7 @@ static void __exit obdfilter_exit(void)
 
         class_unregister_type(LUSTRE_OSTSAN_NAME);
         class_unregister_type(LUSTRE_OST_NAME);
-        
+
         OBD_FREE(obdfilter_created_scratchpad,
                  OBDFILTER_CREATED_SCRATCHPAD_ENTRIES *
                  sizeof(*obdfilter_created_scratchpad));
index cf02053..9006728 100644 (file)
@@ -78,7 +78,7 @@ int filter_update_fidea(struct obd_export *exp, struct inode *inode,
 int filter_update_server_data(struct obd_device *, struct file *,
                               struct lr_server_data *, int force_sync);
 int filter_update_last_objid(struct obd_device *, obd_gr, int force_sync);
-int filter_common_setup(struct obd_device *, obd_count len, void *buf,
+int filter_common_setup(struct obd_device *, struct lustre_cfg *lcfg,
                         void *option);
 int filter_destroy(struct obd_export *exp, struct obdo *oa,
                    struct lov_stripe_md *md, struct obd_trans_info *,
@@ -145,7 +145,7 @@ int filter_recov_log_mds_ost_cb(struct llog_handle *llh,
                                struct llog_rec_hdr *rec, void *data);
 
 /* filter_san.c */
-int filter_san_setup(struct obd_device *obd, obd_count len, void *buf);
+int filter_san_setup(struct obd_device *obd, struct lustre_cfg *cfg);
 int filter_san_preprw(int cmd, struct obd_export *, struct obdo *, int objcount,
                       struct obd_ioobj *, int niocount, struct niobuf_remote *);
 
index f2749ce..7f83977 100644 (file)
@@ -38,9 +38,8 @@
 #include "filter_internal.h"
 
 /* sanobd setup methods - use a specific mount option */
-int filter_san_setup(struct obd_device *obd, obd_count len, void *buf)
+int filter_san_setup(struct obd_device *obd, struct lustre_cfg* lcfg)
 {
-        struct lustre_cfg* lcfg = buf;
         unsigned long page;
         int rc;
 
@@ -60,7 +59,7 @@ int filter_san_setup(struct obd_device *obd, obd_count len, void *buf)
         else
                 LBUG(); /* just a reminder */
 
-        rc = filter_common_setup(obd, len, buf, (void *)page);
+        rc = filter_common_setup(obd, lcfg, (void *)page);
         free_page(page);
 
         return rc;
index 3b76e2f..569132b 100644 (file)
@@ -55,9 +55,8 @@ static kdev_t path2dev(char *path)
         return dev;
 }
 
-int client_sanobd_setup(struct obd_device *obddev, obd_count len, void *buf)
+int client_sanobd_setup(struct obd_device *obddev, struct lustre_cfg* lcfg)
 {
-        struct lustre_cfg* lcfg = buf;
         struct client_obd *cli = &obddev->u.cli;
         ENTRY;
 
@@ -66,7 +65,7 @@ int client_sanobd_setup(struct obd_device *obddev, obd_count len, void *buf)
                 RETURN(-EINVAL);
         }
 
-        client_obd_setup(obddev, len, buf);
+        client_obd_setup(obddev, lcfg);
 
         cli->cl_sandev = path2dev(lustre_cfg_string(lcfg, 3));
         if (!kdev_t_to_nr(cli->cl_sandev)) {
index 0f6d847..5aecb18 100644 (file)
@@ -1208,7 +1208,7 @@ static int osc_brw(int cmd, struct obd_export *exp, struct obdo *oa,
                         }
                         *saved_oa = *oa;
                 }
-                
+
                 rc = osc_brw_internal(cmd, exp, oa, md, pages_per_brw, pga);
 
                 if (rc != 0)
@@ -3082,7 +3082,7 @@ static int osc_set_info(struct obd_export *exp, obd_count keylen,
 
                 RETURN(0);
         }
-        
+
         if (KEY_IS("unlinked")) {
                 struct osc_creator *oscc = &obd->u.cli.cl_oscc;
                 spin_lock(&oscc->oscc_lock);
@@ -3300,7 +3300,7 @@ static int osc_import_event(struct obd_device *obd,
         RETURN(rc);
 }
 
-int osc_setup(struct obd_device *obd, obd_count len, void *buf)
+int osc_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
 {
         int rc;
 
@@ -3308,7 +3308,7 @@ int osc_setup(struct obd_device *obd, obd_count len, void *buf)
         if (rc)
                 return rc;
 
-        rc = client_obd_setup(obd, len, buf);
+        rc = client_obd_setup(obd, lcfg);
         if (rc) {
                 ptlrpcd_decref();
         } else {
index 703578b..95efaef 100644 (file)
@@ -532,7 +532,7 @@ static int ost_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc,
         RETURN(0);
 }
 #endif
-                           
+
 static int ost_brw_lock_get(int mode, struct obd_export *exp,
                             struct obd_ioobj *obj, struct niobuf_remote *nb,
                             struct lustre_handle *lh)
@@ -1213,7 +1213,7 @@ static int ost_handle_quotacheck(struct ptlrpc_request *req)
 
         oqctl = lustre_swab_reqbuf(req, 0, sizeof(*oqctl),
                                    lustre_swab_obd_quotactl);
-        if (oqctl == NULL) 
+        if (oqctl == NULL)
                 RETURN(-EPROTO);
 
         rc = lustre_pack_reply(req, 0, NULL, NULL);
@@ -1603,7 +1603,7 @@ static int ost_thread_init(struct ptlrpc_thread *thread)
         RETURN(result);
 }
 
-static int ost_setup(struct obd_device *obd, obd_count len, void *buf)
+static int ost_setup(struct obd_device *obd, struct lustre_cfg* lcfg)
 {
         struct ost_obd *ost = &obd->u.ost;
         struct lprocfs_static_vars lvars;
index 0c88030..fb9618e 100644 (file)
@@ -153,10 +153,9 @@ static int quotacheck_test_cleanup(struct obd_device *obd)
         return 0;
 }
 
-static int quotacheck_test_setup(struct obd_device *obd, obd_count len, void *buf)
+static int quotacheck_test_setup(struct obd_device *obd, struct lustre_cfg* lcfg)
 {
         struct lprocfs_static_vars lvars;
-        struct lustre_cfg *lcfg = buf;
         struct obd_device *tgt;
         int rc;
         ENTRY;
index 0ac332c..31c08e0 100644 (file)
@@ -80,7 +80,7 @@ static int quotactl_test_2(struct obd_device *obd, struct super_block *sb)
         RETURN(0);
 }
 #endif
-       
+
 /* Test set/getquota */
 static int quotactl_test_3(struct obd_device *obd, struct super_block *sb)
 {
@@ -294,10 +294,9 @@ static int quotactl_test_cleanup(struct obd_device *obd)
         return 0;
 }
 
-static int quotactl_test_setup(struct obd_device *obd, obd_count len, void *buf)
+static int quotactl_test_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
 {
         struct lprocfs_static_vars lvars;
-        struct lustre_cfg *lcfg = buf;
         struct obd_device *tgt;
         int rc;
         ENTRY;