From 998ac9cbb91a5e1b5f7e02027015d204208ed6aa Mon Sep 17 00:00:00 2001 From: yury Date: Tue, 12 Jul 2005 13:05:52 +0000 Subject: [PATCH] - many cleanups with case like foo (). Replaced by foo() - in cmobd fixed init of EA size for LOV with multiple OSTs as master. As there is no another way MD layer is getting asked for correct lovdesc, as it is needed in some cases. Thus, added handler for "lovdesc" nfo key to all MD devices.For instance, cmobd asks LMV for lov desc, it asks first MDS and MDS has it from LOV anyway. - fixed possible LMV obd corruption in cmobd_init_ea_size() where it unconditionaly accessed u.cli things abd modified them whereas here was LMV. - removed obd_getready() as it is not needed anymore. It was needed earlier for CMOBD to get LMV ready before asking rootid, etc. Currently alternative way is found. lmv_get_info() is just taking care of LMV targets readiness it self. - fixed layering violations and possible oopses in cmobd data code where master export was unconditionaly expected as LOV and accessed as LOV what could be wrong in the case of using OSC. OSC using with no LOV is deprecated, but in principle is possible. - in LMV module many functions are added by static specificator as they are not used outside of their object files. --- lustre/cmobd/cm_obd.c | 99 ++++++----- lustre/cmobd/cm_oss_reint.c | 43 +---- lustre/cmobd/cm_write.c | 12 +- lustre/include/linux/lustre_idl.h | 13 +- lustre/include/linux/obd.h | 5 +- lustre/include/linux/obd_class.h | 11 -- lustre/lmv/lmv_obd.c | 136 +++++++------- lustre/mdc/mdc_request.c | 12 ++ lustre/mds/handler.c | 9 +- lustre/obdclass/lprocfs_status.c | 1 - lustre/ptlrpc/pack_generic.c | 366 +++++++++++++++++++------------------- 11 files changed, 352 insertions(+), 355 deletions(-) diff --git a/lustre/cmobd/cm_obd.c b/lustre/cmobd/cm_obd.c index a7ed17c..e8124a7 100644 --- a/lustre/cmobd/cm_obd.c +++ b/lustre/cmobd/cm_obd.c @@ -69,25 +69,45 @@ static inline int cmobd_dt_obd(struct obd_device *obd) return 0; } -static void cmobd_init_ea_size(struct obd_device *obd) +static int cmobd_init_dt_desc(struct obd_device *obd) { - int ost_count = 1, easize, cookiesize; struct cm_obd *cmobd = &obd->u.cm; + __u32 valsize; + int rc = 0; ENTRY; + + /* as CMOBD is stand alone device, that is has not to be connected, we + * have no other way to init EAs correctly but ask master device about + * it. Thus both, DT and MD layers should be able to answer with correct + * lov_desc. LOV knows it explicitly and LMV/MDC have to ask MDS server + * of it. */ + valsize = sizeof(cmobd->master_desc); + memset(&cmobd->master_desc, 0, sizeof(cmobd->master_desc)); + + rc = obd_get_info(cmobd->master_exp, strlen("lovdesc") + 1, + "lovdesc", &valsize, &cmobd->master_desc); + RETURN(rc); +} + +static int cmobd_init_ea_size(struct obd_device *obd) +{ + int rc = 0, tgt_count, easize, cookiesize; + struct cm_obd *cmobd = &obd->u.cm; + ENTRY; + + if (!cmobd->master_exp) + RETURN(-EINVAL); - /* - * here we should also take into account that there is possible to have - * few OSTs. --umka - */ - easize = lov_mds_md_size(ost_count); - cookiesize = ost_count * sizeof(struct llog_cookie); + tgt_count = cmobd->master_desc.ld_tgt_count; - obd_init_ea_size(cmobd->master_exp, easize, cookiesize); + /* no EA setup is needed as there is single OST with no LOV */ + if (tgt_count == 0) + RETURN(0); - cmobd->master_exp->exp_obd->u.cli.cl_max_mds_easize = easize; - cmobd->master_exp->exp_obd->u.cli.cl_max_mds_cookiesize = cookiesize; - - EXIT; + easize = lov_mds_md_size(tgt_count); + cookiesize = tgt_count * sizeof(struct llog_cookie); + rc = obd_init_ea_size(cmobd->master_exp, easize, cookiesize); + RETURN(rc); } static char *types[] = { @@ -169,6 +189,16 @@ static int cmobd_setup(struct obd_device *obd, obd_count len, void *buf) if (rc) GOTO(put_master, rc); cmobd->cache_exp = class_conn2export(&conn); + + /* initialing DT desc. Both, data and metadata layers should be able to + * serve this call. */ + rc = cmobd_init_dt_desc(obd); + if (rc != 0 && rc != -EPROTO) { + CERROR("cannot get DT layer desc from master device %s, " + "err %d.\n", cmobd->master_exp->exp_obd->obd_name, + rc); + GOTO(put_cache, rc); + } if (cmobd_dt_obd(cmobd->master_exp->exp_obd)) { /* for master dt device remove the recovery flag. */ @@ -180,34 +210,19 @@ static int cmobd_setup(struct obd_device *obd, obd_count len, void *buf) rc = cmobd_init_write_srv(obd); if (rc) GOTO(put_cache, rc); - } else { - cmobd_init_ea_size(obd); - cmobd->write_srv = NULL; } if (cmobd_md_obd(cmobd->master_exp->exp_obd)) { - /* - * making sure, that both obds are ready. This is especially - * important in the case of using LMV as master. - */ - rc = obd_getready(cmobd->master_exp); + rc = cmobd_init_ea_size(obd); if (rc) { - CERROR("can't get %s obd ready.\n", - master_uuid.uuid); + CERROR("can't init MD layer EA size, " + "err %d\n", rc); GOTO(put_cache, rc); } - - rc = obd_getready(cmobd->cache_exp); - if (rc) { - CERROR("can't get %s obd ready.\n", - cache_uuid.uuid); - GOTO(put_cache, rc); - } - - /* - * requesting master obd to have its root inode store cookie to - * be able to save it to local root inode EA. - */ + cmobd->write_srv = NULL; + + /* requesting master obd to have its root inode store cookie to + * be able to save it to local root inode EA. */ valsize = sizeof(struct lustre_id); rc = obd_get_info(cmobd->master_exp, strlen("rootid"), @@ -218,10 +233,8 @@ static int cmobd_setup(struct obd_device *obd, obd_count len, void *buf) GOTO(put_cache, rc); } - /* - * getting rootid from cache MDS. It is needed to update local - * (cache) root inode by rootid value from master obd. - */ + /* getting rootid from cache MDS. It is needed to update local + * (cache) root inode by rootid value from master obd. */ rc = obd_get_info(cmobd->cache_exp, strlen("rootid"), "rootid", &valsize, &lid); if (rc) { @@ -263,14 +276,14 @@ static int cmobd_cleanup(struct obd_device *obd, int flags) rc = obd_disconnect(cmobd->master_exp, flags); if (rc) { - CERROR("error disconnecting master, err %d\n", - rc); + CERROR("error disconnecting master %s, err %d\n", + cmobd->master_exp->exp_obd->obd_name, rc); } rc = class_disconnect(cmobd->cache_exp, flags); if (rc) { - CERROR("error disconnecting cache, err %d\n", - rc); + CERROR("error disconnecting cache %s, err %d\n", + cmobd->cache_exp->exp_obd->obd_name, rc); } RETURN(0); diff --git a/lustre/cmobd/cm_oss_reint.c b/lustre/cmobd/cm_oss_reint.c index fc9a9b9..81b616a 100644 --- a/lustre/cmobd/cm_oss_reint.c +++ b/lustre/cmobd/cm_oss_reint.c @@ -78,23 +78,15 @@ void cmobd_free_lsm(struct lov_stripe_md **lsmp) /* reintegration functions */ static int cmobd_setattr_reint(struct obd_device *obd, void *rec) { - struct obdo *oa = (struct obdo*)rec; + int rc = 0; + struct lov_stripe_md *lsm; struct cm_obd *cmobd = &obd->u.cm; struct obd_export *exp = cmobd->master_exp; - struct lov_stripe_md *lsm; - struct lov_obd *lov; - int rc; + struct obdo *oa = (struct obdo *)rec; ENTRY; - /* - * nevertheless ost is not used anymore and lov should be always present - * as a object storage export, using ost is still possible (just - * deprecated) and we should make sure here, that this is really - * lov. --umka. - */ - lov = &cmobd->master_exp->exp_obd->u.lov; - rc = cmobd_dummy_lsm(&lsm, lov->desc.ld_tgt_count, oa, - (__u32)lov->desc.ld_default_stripe_size); + rc = cmobd_dummy_lsm(&lsm, cmobd->master_desc.ld_tgt_count, oa, + (__u32)cmobd->master_desc.ld_default_stripe_size); if (rc) GOTO(out, rc); @@ -112,19 +104,11 @@ static int cmobd_create_reint(struct obd_device *obd, void *rec) struct obd_export *exp = cmobd->master_exp; struct lov_stripe_md *lsm; struct obd_trans_info oti = { 0 }; - struct lov_obd *lov; int rc; ENTRY; - /* - * nevertheless ost is not used anymore and lov should be always present - * as a object storage export, using ost is still possible (just - * deprecated) and we should make sure here, that this is really - * lov. --umka. - */ - lov = &cmobd->master_exp->exp_obd->u.lov; - rc = cmobd_dummy_lsm(&lsm, lov->desc.ld_tgt_count, oa, - (__u32)lov->desc.ld_default_stripe_size); + rc = cmobd_dummy_lsm(&lsm, cmobd->master_desc.ld_tgt_count, oa, + (__u32)cmobd->master_desc.ld_default_stripe_size); if (rc) GOTO(out, rc); if (cmobd->master_group != oa->o_gr) { @@ -226,7 +210,6 @@ static int cmobd_write_extents(struct obd_device *obd, struct obdo *oa, ldlm_policy_data_t policy; struct lov_stripe_md *lsm; int flags = 0, err, rc = 0; - struct lov_obd *lov; ENTRY; /* XXX for debug write replay without smfs and kml */ @@ -243,14 +226,6 @@ static int cmobd_write_extents(struct obd_device *obd, struct obdo *oa, if (rc != ELDLM_OK) RETURN(rc); - /* - * nevertheless ost is not used anymore and lov should be always present - * as a object storage export, using ost is still possible (just - * deprecated) and we should make sure here, that this is really - * lov. --umka. - */ - lov = &cmobd->master_exp->exp_obd->u.lov; - /* construct the pseudo lsm */ /* @@ -258,8 +233,8 @@ static int cmobd_write_extents(struct obd_device *obd, struct obdo *oa, * layering violation. It should be accessed via some interface method, * like llite does. --umka */ - rc = cmobd_dummy_lsm(&lsm, lov->desc.ld_tgt_count, oa, - (__u32)lov->desc.ld_default_stripe_size); + rc = cmobd_dummy_lsm(&lsm, cmobd->master_desc.ld_tgt_count, oa, + (__u32)cmobd->master_desc.ld_default_stripe_size); if (rc) GOTO(out_lock, rc); diff --git a/lustre/cmobd/cm_write.c b/lustre/cmobd/cm_write.c index 201b199..4f0cdca 100644 --- a/lustre/cmobd/cm_write.c +++ b/lustre/cmobd/cm_write.c @@ -657,22 +657,14 @@ int cmobd_replay_write(struct obd_device *obd, struct obdo *oa, struct l_wait_info lwi = { 0 }; struct list_head *pos, *n; struct cmobd_async_page *cmap; - struct lov_obd *lov; unsigned long flags; obd_count i, buf_count; obd_off start; int rc = 0; ENTRY; - /* - * nevertheless ost is not used anymore and lov should be always present - * as a object storage export, using ost is still possible (just - * deprecated) and we should make sure here, that this is really - * lov. --umka. - */ - lov = &cmobd->master_exp->exp_obd->u.lov; - rc = cmobd_dummy_lsm(&lsm, lov->desc.ld_tgt_count, oa, - (__u32)lov->desc.ld_default_stripe_size); + rc = cmobd_dummy_lsm(&lsm, cmobd->master_desc.ld_tgt_count, oa, + (__u32)cmobd->master_desc.ld_default_stripe_size); if (rc) RETURN(-ENOMEM); diff --git a/lustre/include/linux/lustre_idl.h b/lustre/include/linux/lustre_idl.h index 298a71c..5441eb7 100644 --- a/lustre/include/linux/lustre_idl.h +++ b/lustre/include/linux/lustre_idl.h @@ -644,11 +644,6 @@ struct mds_status_req { __u32 repbuf; }; -extern void lustre_swab_lustre_id(struct lustre_id *id); -extern void lustre_swab_lustre_stc(struct lustre_stc *stc); -extern void lustre_swab_lustre_fid(struct lustre_fid *fid); -extern void lustre_swab_mds_status_req (struct mds_status_req *r); - #define MDS_BFLAG_UNCOMMITTED_WRITES 0x1 struct mds_body { @@ -812,8 +807,6 @@ struct lmv_desc { struct obd_uuid ld_uuid; }; -extern void lustre_swab_lov_desc (struct lov_desc *ld); - /* * LDLM requests: */ @@ -1181,4 +1174,10 @@ typedef enum { } sec_cmd_t; #define SEC_FIRST_OPC SEC_INIT +extern void lustre_swab_lustre_id(struct lustre_id *id); +extern void lustre_swab_lov_desc(struct lov_desc *desc); +extern void lustre_swab_lustre_stc(struct lustre_stc *stc); +extern void lustre_swab_lustre_fid(struct lustre_fid *fid); +extern void lustre_swab_mds_status_req(struct mds_status_req *r); + #endif diff --git a/lustre/include/linux/obd.h b/lustre/include/linux/obd.h index 91bd1a7..deca7ec 100644 --- a/lustre/include/linux/obd.h +++ b/lustre/include/linux/obd.h @@ -484,6 +484,7 @@ struct cm_obd { struct obd_device *master_obd; int master_group; struct cmobd_write_service *write_srv; + struct lov_desc master_desc; /* master device lovdesc */ }; struct conf_obd { @@ -872,10 +873,6 @@ struct obd_ops { int (*o_notify)(struct obd_device *obd, struct obd_device *watched, int active, void *data); - /* this method is needed for cmobd to make say to LMV "get ready" when - * master obd is LMV. This is needed, because LMV is initialized in - * "defered" manner to let all MDSs to be set up first. */ - int (*o_getready)(struct obd_export *exp); int (*o_init_ea_size)(struct obd_export *, int, int); /* diff --git a/lustre/include/linux/obd_class.h b/lustre/include/linux/obd_class.h index f96ae3a..6554d4f 100644 --- a/lustre/include/linux/obd_class.h +++ b/lustre/include/linux/obd_class.h @@ -641,17 +641,6 @@ static inline int obd_disconnect(struct obd_export *exp, RETURN(rc); } -static inline int obd_getready(struct obd_export *exp) -{ - int rc; - ENTRY; - - if (!OBP(exp->exp_obd, getready)) - RETURN(0); - rc = OBP(exp->exp_obd, getready)(exp); - RETURN(rc); -} - static inline int obd_init_export(struct obd_export *exp) { int rc = 0; diff --git a/lustre/lmv/lmv_obd.c b/lustre/lmv/lmv_obd.c index 31066d8..86f3035 100644 --- a/lustre/lmv/lmv_obd.c +++ b/lustre/lmv/lmv_obd.c @@ -162,7 +162,7 @@ static int lmv_notify(struct obd_device *obd, struct obd_device *watched, RETURN(rc); } -int lmv_attach(struct obd_device *dev, obd_count len, void *data) +static int lmv_attach(struct obd_device *dev, obd_count len, void *data) { struct lprocfs_static_vars lvars; int rc; @@ -185,7 +185,7 @@ int lmv_attach(struct obd_device *dev, obd_count len, void *data) RETURN (rc); } -int lmv_detach(struct obd_device *dev) +static int lmv_detach(struct obd_device *dev) { return lprocfs_obd_detach(dev); } @@ -257,7 +257,7 @@ static int lmv_connect(struct lustre_handle *conn, struct obd_device *obd, RETURN(rc); } -void lmv_set_timeouts(struct obd_device *obd) +static void lmv_set_timeouts(struct obd_device *obd) { struct lmv_tgt_desc *tgts; struct lmv_obd *lmv; @@ -830,9 +830,9 @@ static int lmv_valid_attrs(struct obd_export *exp, struct lustre_id *id) RETURN(rc); } -int lmv_close(struct obd_export *exp, struct obdo *obdo, - struct obd_client_handle *och, - struct ptlrpc_request **request) +static int lmv_close(struct obd_export *exp, struct obdo *obdo, + struct obd_client_handle *och, + struct ptlrpc_request **request) { struct obd_device *obd = exp->exp_obd; struct lmv_obd *lmv = &obd->u.lmv; @@ -956,7 +956,7 @@ repeat: RETURN(rc); } -int lmv_done_writing(struct obd_export *exp, struct obdo *obdo) +static int lmv_done_writing(struct obd_export *exp, struct obdo *obdo) { struct obd_device *obd = exp->exp_obd; struct lmv_obd *lmv = &obd->u.lmv; @@ -973,11 +973,12 @@ int lmv_done_writing(struct obd_export *exp, struct obdo *obdo) RETURN(rc); } -int lmv_enqueue_slaves(struct obd_export *exp, int locktype, - struct lookup_intent *it, int lockmode, - struct mdc_op_data *data, struct lustre_handle *lockh, - void *lmm, int lmmsize, ldlm_completion_callback cb_compl, - ldlm_blocking_callback cb_blocking, void *cb_data) +static int +lmv_enqueue_slaves(struct obd_export *exp, int locktype, + struct lookup_intent *it, int lockmode, + struct mdc_op_data *data, struct lustre_handle *lockh, + void *lmm, int lmmsize, ldlm_completion_callback cb_compl, + ldlm_blocking_callback cb_blocking, void *cb_data) { struct obd_device *obd = exp->exp_obd; struct lmv_obd *lmv = &obd->u.lmv; @@ -1031,11 +1032,12 @@ cleanup: return rc; } -int lmv_enqueue_remote(struct obd_export *exp, int lock_type, - struct lookup_intent *it, int lock_mode, - struct mdc_op_data *data, struct lustre_handle *lockh, - void *lmm, int lmmsize, ldlm_completion_callback cb_compl, - ldlm_blocking_callback cb_blocking, void *cb_data) +static int +lmv_enqueue_remote(struct obd_export *exp, int lock_type, + struct lookup_intent *it, int lock_mode, + struct mdc_op_data *data, struct lustre_handle *lockh, + void *lmm, int lmmsize, ldlm_completion_callback cb_compl, + ldlm_blocking_callback cb_blocking, void *cb_data) { struct ptlrpc_request *req = LUSTRE_IT(it)->it_data; struct obd_device *obd = exp->exp_obd; @@ -1078,11 +1080,12 @@ int lmv_enqueue_remote(struct obd_export *exp, int lock_type, RETURN(rc); } -int lmv_enqueue(struct obd_export *exp, int lock_type, - struct lookup_intent *it, int lock_mode, - struct mdc_op_data *data, struct lustre_handle *lockh, - void *lmm, int lmmsize, ldlm_completion_callback cb_compl, - ldlm_blocking_callback cb_blocking, void *cb_data) +static int +lmv_enqueue(struct obd_export *exp, int lock_type, + struct lookup_intent *it, int lock_mode, + struct mdc_op_data *data, struct lustre_handle *lockh, + void *lmm, int lmmsize, ldlm_completion_callback cb_compl, + ldlm_blocking_callback cb_blocking, void *cb_data) { struct obd_device *obd = exp->exp_obd; struct lmv_obd *lmv = &obd->u.lmv; @@ -1125,9 +1128,10 @@ int lmv_enqueue(struct obd_export *exp, int lock_type, RETURN(rc); } -int lmv_getattr_lock(struct obd_export *exp, struct lustre_id *id, - char *filename, int namelen, __u64 valid, - unsigned int ea_size, struct ptlrpc_request **request) +static int +lmv_getattr_lock(struct obd_export *exp, struct lustre_id *id, + char *filename, int namelen, __u64 valid, + unsigned int ea_size, struct ptlrpc_request **request) { int rc, mds = id_group(id), loop = 0; struct obd_device *obd = exp->exp_obd; @@ -1196,8 +1200,8 @@ repeat: * llite passes id of an target inode in data->id1 and id of directory in * data->id2 */ -int lmv_link(struct obd_export *exp, struct mdc_op_data *data, - struct ptlrpc_request **request) +static int lmv_link(struct obd_export *exp, struct mdc_op_data *data, + struct ptlrpc_request **request) { struct obd_device *obd = exp->exp_obd; struct lmv_obd *lmv = &obd->u.lmv; @@ -1239,9 +1243,9 @@ int lmv_link(struct obd_export *exp, struct mdc_op_data *data, RETURN(rc); } -int lmv_rename(struct obd_export *exp, struct mdc_op_data *data, - const char *old, int oldlen, const char *new, int newlen, - struct ptlrpc_request **request) +static int lmv_rename(struct obd_export *exp, struct mdc_op_data *data, + const char *old, int oldlen, const char *new, int newlen, + struct ptlrpc_request **request) { struct obd_device *obd = exp->exp_obd; struct lmv_obd *lmv = &obd->u.lmv; @@ -1328,9 +1332,9 @@ request: RETURN(rc); } -int lmv_setattr(struct obd_export *exp, struct mdc_op_data *data, - struct iattr *iattr, void *ea, int ealen, void *ea2, - int ea2len, struct ptlrpc_request **request) +static int lmv_setattr(struct obd_export *exp, struct mdc_op_data *data, + struct iattr *iattr, void *ea, int ealen, void *ea2, + int ea2len, struct ptlrpc_request **request) { struct obd_device *obd = exp->exp_obd; struct lmv_obd *lmv = &obd->u.lmv; @@ -1385,8 +1389,8 @@ int lmv_setattr(struct obd_export *exp, struct mdc_op_data *data, RETURN(rc); } -int lmv_sync(struct obd_export *exp, struct lustre_id *id, - struct ptlrpc_request **request) +static int lmv_sync(struct obd_export *exp, struct lustre_id *id, + struct ptlrpc_request **request) { struct obd_device *obd = exp->exp_obd; struct lmv_obd *lmv = &obd->u.lmv; @@ -1440,7 +1444,7 @@ int lmv_dirobj_blocking_ast(struct ldlm_lock *lock, RETURN(0); } -void lmv_remove_dots(struct page *page) +static void lmv_remove_dots(struct page *page) { unsigned limit = PAGE_CACHE_SIZE; char *kaddr = page_address(page); @@ -1457,9 +1461,9 @@ void lmv_remove_dots(struct page *page) } } -int lmv_readpage(struct obd_export *exp, struct lustre_id *id, - __u64 offset, struct page *page, - struct ptlrpc_request **request) +static int lmv_readpage(struct obd_export *exp, struct lustre_id *id, + __u64 offset, struct page *page, + struct ptlrpc_request **request) { struct obd_device *obd = exp->exp_obd; struct lmv_obd *lmv = &obd->u.lmv; @@ -1507,8 +1511,8 @@ int lmv_readpage(struct obd_export *exp, struct lustre_id *id, RETURN(rc); } -int lmv_unlink_slaves(struct obd_export *exp, struct mdc_op_data *data, - struct ptlrpc_request **req) +static int lmv_unlink_slaves(struct obd_export *exp, struct mdc_op_data *data, + struct ptlrpc_request **req) { struct obd_device *obd = exp->exp_obd; struct lmv_obd *lmv = &obd->u.lmv; @@ -1547,7 +1551,7 @@ int lmv_unlink_slaves(struct obd_export *exp, struct mdc_op_data *data, RETURN(rc); } -int lmv_delete_inode(struct obd_export *exp, struct lustre_id *id) +static int lmv_delete_inode(struct obd_export *exp, struct lustre_id *id) { ENTRY; @@ -1559,8 +1563,8 @@ int lmv_delete_inode(struct obd_export *exp, struct lustre_id *id) RETURN(0); } -int lmv_unlink(struct obd_export *exp, struct mdc_op_data *data, - struct ptlrpc_request **request) +static int lmv_unlink(struct obd_export *exp, struct mdc_op_data *data, + struct ptlrpc_request **request) { struct obd_device *obd = exp->exp_obd; struct lmv_obd *lmv = &obd->u.lmv; @@ -1599,8 +1603,8 @@ int lmv_unlink(struct obd_export *exp, struct mdc_op_data *data, RETURN(rc); } -struct obd_device *lmv_get_real_obd(struct obd_export *exp, - struct lustre_id *id) +static struct obd_device *lmv_get_real_obd(struct obd_export *exp, + struct lustre_id *id) { struct obd_device *obd = exp->exp_obd; struct lmv_obd *lmv = &obd->u.lmv; @@ -1616,8 +1620,8 @@ struct obd_device *lmv_get_real_obd(struct obd_export *exp, return obd; } -int lmv_init_ea_size(struct obd_export *exp, int easize, - int cookiesize) +static int lmv_init_ea_size(struct obd_export *exp, int easize, + int cookiesize) { struct obd_device *obd = exp->exp_obd; struct lmv_obd *lmv = &obd->u.lmv; @@ -1654,9 +1658,10 @@ int lmv_init_ea_size(struct obd_export *exp, int easize, RETURN(rc); } -int lmv_obd_create_single(struct obd_export *exp, struct obdo *oa, - void *acl, int acl_size, - struct lov_stripe_md **ea, struct obd_trans_info *oti) +static int lmv_obd_create_single(struct obd_export *exp, struct obdo *oa, + void *acl, int acl_size, + struct lov_stripe_md **ea, + struct obd_trans_info *oti) { struct obd_device *obd = exp->exp_obd; struct lmv_obd *lmv = &obd->u.lmv; @@ -1674,16 +1679,6 @@ int lmv_obd_create_single(struct obd_export *exp, struct obdo *oa, RETURN(rc); } -int lmv_getready(struct obd_export *exp) -{ - struct obd_device *obd = exp->exp_obd; - int rc = 0; - - ENTRY; - rc = lmv_check_connect(obd); - RETURN(rc); -} - /* * to be called from MDS only. @oa should have correct store cookie and o_fid * values for "master" object, as it will be used. @@ -1868,6 +1863,10 @@ static int lmv_get_info(struct obd_export *exp, __u32 keylen, } LASSERT(0); } else if (keylen == 6 && memcmp(key, "rootid", 6) == 0) { + rc = lmv_check_connect(obd); + if (rc) + RETURN(rc); + /* getting rootid from first MDS. */ rc = obd_get_info(lmv->tgts[0].ltd_exp, keylen, key, vallen, val); @@ -1881,6 +1880,10 @@ static int lmv_get_info(struct obd_export *exp, __u32 keylen, struct lmv_tgt_desc *tgts; int i; + rc = lmv_check_connect(obd); + if (rc) + RETURN(rc); + LASSERT(*vallen == sizeof(__u32)); for (i = 0, tgts = lmv->tgts; i < lmv->desc.ld_tgt_count; i++, tgts++) { @@ -1896,6 +1899,16 @@ static int lmv_get_info(struct obd_export *exp, __u32 keylen, RETURN(0); } RETURN(-EINVAL); + } else if (keylen >= strlen("lovdesc") && strcmp(key, "lovdesc") == 0) { + rc = lmv_check_connect(obd); + if (rc) + RETURN(rc); + + /* forwarding this request to first MDS, it should know LOV + * desc. */ + rc = obd_get_info(lmv->tgts[0].ltd_exp, keylen, key, + vallen, val); + RETURN(rc); } CDEBUG(D_IOCTL, "invalid key\n"); @@ -2162,7 +2175,6 @@ struct obd_ops lmv_obd_ops = { .o_init_ea_size = lmv_init_ea_size, .o_notify = lmv_notify, .o_iocontrol = lmv_iocontrol, - .o_getready = lmv_getready, .o_cancel_unused = lmv_cancel_unused, }; diff --git a/lustre/mdc/mdc_request.c b/lustre/mdc/mdc_request.c index dab2bb2..fc4dc6d 100644 --- a/lustre/mdc/mdc_request.c +++ b/lustre/mdc/mdc_request.c @@ -1242,6 +1242,18 @@ static int mdc_get_info(struct obd_export *exp, __u32 keylen, } *(struct lustre_id *)val = *reply; + } else if (keylen >= strlen("lovdesc") && !strcmp(key, "lovdesc")) { + struct lov_desc *reply; + + reply = lustre_swab_repbuf(req, 0, sizeof(*reply), + lustre_swab_lov_desc); + if (reply == NULL) { + CERROR("Can't unpack %s\n", (char *)key); + GOTO(out_req, rc = -EPROTO); + } + + *(struct lov_desc *)val = *reply; + RETURN(0); } else { __u32 *reply; diff --git a/lustre/mds/handler.c b/lustre/mds/handler.c index eb4eead..c534ab4 100644 --- a/lustre/mds/handler.c +++ b/lustre/mds/handler.c @@ -4197,11 +4197,18 @@ static int mds_get_info(struct obd_export *exp, __u32 keylen, if (keylen >= strlen("rootid") && strcmp(key, "rootid") == 0) { struct lustre_id *rootid = val; - *valsize = sizeof(struct lustre_id); + *valsize = sizeof(*rootid); *rootid = mds->mds_rootid; RETURN(0); } + if (keylen >= strlen("lovdesc") && strcmp(key, "lovdesc") == 0) { + struct lov_desc *desc = val; + *valsize = sizeof(*desc); + *desc = mds->mds_dt_desc; + RETURN(0); + } + CDEBUG(D_IOCTL, "invalid key\n"); RETURN(-EINVAL); diff --git a/lustre/obdclass/lprocfs_status.c b/lustre/obdclass/lprocfs_status.c index 812d6af..4ae4bf5 100644 --- a/lustre/obdclass/lprocfs_status.c +++ b/lustre/obdclass/lprocfs_status.c @@ -663,7 +663,6 @@ int lprocfs_alloc_obd_stats(struct obd_device *obd, LPROCFS_OBD_OP_INIT(num_private_stats, stats, unpin); LPROCFS_OBD_OP_INIT(num_private_stats, stats, import_event); LPROCFS_OBD_OP_INIT(num_private_stats, stats, notify); - LPROCFS_OBD_OP_INIT(num_private_stats, stats, getready); LPROCFS_OBD_OP_INIT(num_private_stats, stats, init_ea_size); for (i = num_private_stats; i < num_stats; i++) { diff --git a/lustre/ptlrpc/pack_generic.c b/lustre/ptlrpc/pack_generic.c index 5c784f7..1074465 100644 --- a/lustre/ptlrpc/pack_generic.c +++ b/lustre/ptlrpc/pack_generic.c @@ -53,7 +53,8 @@ int lustre_msg_check_version(struct lustre_msg *msg, __u32 version) return (__swab32(msg->version) & LUSTRE_VERSION_MASK) != version; } -void lustre_init_msg (struct lustre_msg *msg, int count, int *lens, char **bufs) +void lustre_init_msg(struct lustre_msg *msg, int count, + int *lens, char **bufs) { char *ptr; int i; @@ -126,8 +127,8 @@ void lustre_pack_secdesc(struct ptlrpc_request *req, int size) #endif } -int lustre_pack_request (struct ptlrpc_request *req, - int count, int *lens, char **bufs) +int lustre_pack_request(struct ptlrpc_request *req, + int count, int *lens, char **bufs) { int rc; ENTRY; @@ -167,8 +168,8 @@ do { \ # define PTLRPC_RS_DEBUG_LRU_DEL(rs) do {} while(0) #endif -int lustre_pack_reply (struct ptlrpc_request *req, - int count, int *lens, char **bufs) +int lustre_pack_reply(struct ptlrpc_request *req, + int count, int *lens, char **bufs) { struct ptlrpc_reply_state *rs; int rc; @@ -200,20 +201,20 @@ int lustre_pack_reply (struct ptlrpc_request *req, RETURN (0); } -void lustre_free_reply_state (struct ptlrpc_reply_state *rs) +void lustre_free_reply_state(struct ptlrpc_reply_state *rs) { struct ptlrpc_svcsec *svcsec = rs->rs_svcsec; PTLRPC_RS_DEBUG_LRU_DEL(rs); - LASSERT (!rs->rs_difficult || rs->rs_handled); - LASSERT (!rs->rs_on_net); - LASSERT (!rs->rs_scheduled); - LASSERT (rs->rs_export == NULL); - LASSERT (rs->rs_nlocks == 0); - LASSERT (list_empty(&rs->rs_exp_list)); - LASSERT (list_empty(&rs->rs_obd_list)); - LASSERT (svcsec); + LASSERT(!rs->rs_difficult || rs->rs_handled); + LASSERT(!rs->rs_on_net); + LASSERT(!rs->rs_scheduled); + LASSERT(rs->rs_export == NULL); + LASSERT(rs->rs_nlocks == 0); + LASSERT(list_empty(&rs->rs_exp_list)); + LASSERT(list_empty(&rs->rs_obd_list)); + LASSERT(svcsec); if (svcsec->free_repbuf) svcsec->free_repbuf(svcsec, rs); @@ -250,10 +251,10 @@ int lustre_unpack_msg(struct lustre_msg *m, int len) * rather than a short message. * */ - required_len = MAX (offsetof (struct lustre_msg, version) + - sizeof (m->version), - offsetof (struct lustre_msg, magic) + - sizeof (m->magic)); + required_len = MAX(offsetof(struct lustre_msg, version) + + sizeof(m->version), + offsetof(struct lustre_msg, magic) + + sizeof(m->magic)); if (len < required_len) { /* can't even look inside the message */ CERROR ("message length %d too small for magic/version check\n", @@ -263,34 +264,34 @@ int lustre_unpack_msg(struct lustre_msg *m, int len) flipped = lustre_msg_swabbed(m); if (flipped) - __swab32s (&m->version); + __swab32s(&m->version); else if (m->magic != PTLRPC_MSG_MAGIC) { CERROR("wrong lustre_msg magic %#08x\n", m->magic); - RETURN (-EINVAL); + RETURN(-EINVAL); } if ((m->version & ~LUSTRE_VERSION_MASK) != PTLRPC_MSG_VERSION) { CERROR("wrong lustre_msg version %#08x\n", m->version); - RETURN (-EINVAL); + RETURN(-EINVAL); } /* Now we know the sender speaks my language (but possibly flipped)...*/ required_len = HDR_SIZE(0); if (len < required_len) { /* can't even look inside the message */ - CERROR ("message length %d too small for lustre_msg\n", len); - RETURN (-EINVAL); + CERROR("message length %d too small for lustre_msg\n", len); + RETURN(-EINVAL); } if (flipped) { - __swab32s (&m->type); - __swab32s (&m->opc); - __swab64s (&m->last_xid); - __swab64s (&m->last_committed); - __swab64s (&m->transno); - __swab32s (&m->status); - __swab32s (&m->bufcount); - __swab32s (&m->flags); + __swab32s(&m->type); + __swab32s(&m->opc); + __swab64s(&m->last_xid); + __swab64s(&m->last_committed); + __swab64s(&m->transno); + __swab32s(&m->status); + __swab32s(&m->bufcount); + __swab32s(&m->flags); } required_len = HDR_SIZE(m->bufcount); @@ -350,10 +351,10 @@ void *lustre_msg_buf(struct lustre_msg *m, int n, int min_size) return (char *)m + offset; } -char *lustre_msg_string (struct lustre_msg *m, int index, int max_len) +char *lustre_msg_string(struct lustre_msg *m, int index, int max_len) { /* max_len == 0 means the string should fill the buffer */ - char *str = lustre_msg_buf (m, index, 0); + char *str = lustre_msg_buf(m, index, 0); int slen; int blen; @@ -363,7 +364,7 @@ char *lustre_msg_string (struct lustre_msg *m, int index, int max_len) } blen = m->buflens[index]; - slen = strnlen (str, blen); + slen = strnlen(str, blen); if (slen == blen) { /* not NULL terminated */ CERROR ("can't unpack non-NULL terminated string in " @@ -424,33 +425,33 @@ void *lustre_swab_repbuf(struct ptlrpc_request *req, int index, int min_size, void lustre_swab_connect(struct obd_connect_data *ocd) { - __swab64s (&ocd->ocd_connect_flags); - __swab32s (&ocd->ocd_nllu[0]); - __swab32s (&ocd->ocd_nllu[1]); -} - -void lustre_swab_obdo (struct obdo *o) -{ - __swab64s (&o->o_id); - __swab64s (&o->o_gr); - __swab64s (&o->o_atime); - __swab64s (&o->o_mtime); - __swab64s (&o->o_ctime); - __swab64s (&o->o_size); - __swab64s (&o->o_blocks); - __swab64s (&o->o_grant); - __swab32s (&o->o_blksize); - __swab32s (&o->o_mode); - __swab32s (&o->o_uid); - __swab32s (&o->o_gid); - __swab32s (&o->o_flags); - __swab32s (&o->o_nlink); - __swab32s (&o->o_generation); - __swab64s (&o->o_valid); - __swab32s (&o->o_misc); - __swab32s (&o->o_easize); - __swab32s (&o->o_mds); - __swab64s (&o->o_fid); + __swab64s(&ocd->ocd_connect_flags); + __swab32s(&ocd->ocd_nllu[0]); + __swab32s(&ocd->ocd_nllu[1]); +} + +void lustre_swab_obdo(struct obdo *o) +{ + __swab64s(&o->o_id); + __swab64s(&o->o_gr); + __swab64s(&o->o_atime); + __swab64s(&o->o_mtime); + __swab64s(&o->o_ctime); + __swab64s(&o->o_size); + __swab64s(&o->o_blocks); + __swab64s(&o->o_grant); + __swab32s(&o->o_blksize); + __swab32s(&o->o_mode); + __swab32s(&o->o_uid); + __swab32s(&o->o_gid); + __swab32s(&o->o_flags); + __swab32s(&o->o_nlink); + __swab32s(&o->o_generation); + __swab64s(&o->o_valid); + __swab32s(&o->o_misc); + __swab32s(&o->o_easize); + __swab32s(&o->o_mds); + __swab64s(&o->o_fid); /* o_inline is opaque */ } @@ -583,37 +584,37 @@ void *mdc_rename_pack(struct lustre_msg *msg, int offset, return (void*)tmp; } -void lustre_swab_obd_statfs (struct obd_statfs *os) +void lustre_swab_obd_statfs(struct obd_statfs *os) { - __swab64s (&os->os_type); - __swab64s (&os->os_blocks); - __swab64s (&os->os_bfree); - __swab64s (&os->os_bavail); - __swab64s (&os->os_ffree); + __swab64s(&os->os_type); + __swab64s(&os->os_blocks); + __swab64s(&os->os_bfree); + __swab64s(&os->os_bavail); + __swab64s(&os->os_ffree); /* no need to swap os_fsid */ - __swab32s (&os->os_bsize); - __swab32s (&os->os_namelen); + __swab32s(&os->os_bsize); + __swab32s(&os->os_namelen); /* no need to swap os_spare */ } -void lustre_swab_obd_ioobj (struct obd_ioobj *ioo) +void lustre_swab_obd_ioobj(struct obd_ioobj *ioo) { - __swab64s (&ioo->ioo_id); - __swab64s (&ioo->ioo_gr); - __swab32s (&ioo->ioo_type); - __swab32s (&ioo->ioo_bufcnt); + __swab64s(&ioo->ioo_id); + __swab64s(&ioo->ioo_gr); + __swab32s(&ioo->ioo_type); + __swab32s(&ioo->ioo_bufcnt); } -void lustre_swab_niobuf_remote (struct niobuf_remote *nbr) +void lustre_swab_niobuf_remote(struct niobuf_remote *nbr) { - __swab64s (&nbr->offset); - __swab32s (&nbr->len); - __swab32s (&nbr->flags); + __swab64s(&nbr->offset); + __swab32s(&nbr->len); + __swab32s(&nbr->flags); } -void lustre_swab_ost_body (struct ost_body *b) +void lustre_swab_ost_body(struct ost_body *b) { - lustre_swab_obdo (&b->oa); + lustre_swab_obdo(&b->oa); } void lustre_swab_ost_last_id(obd_id *id) @@ -637,28 +638,28 @@ void lustre_swab_ost_lvb(struct ost_lvb *lvb) void lustre_swab_lustre_stc (struct lustre_stc *stc) { - __swab64s (&stc->u.e3s.l3s_ino); - __swab32s (&stc->u.e3s.l3s_gen); - __swab32s (&stc->u.e3s.l3s_type); + __swab64s(&stc->u.e3s.l3s_ino); + __swab32s(&stc->u.e3s.l3s_gen); + __swab32s(&stc->u.e3s.l3s_type); } void lustre_swab_lustre_fid(struct lustre_fid *fid) { - __swab64s (&fid->lf_id); - __swab64s (&fid->lf_group); + __swab64s(&fid->lf_id); + __swab64s(&fid->lf_group); /*__swab32s (&fid->lf_version);*/ } -void lustre_swab_lustre_id (struct lustre_id *id) +void lustre_swab_lustre_id(struct lustre_id *id) { lustre_swab_lustre_stc(&id->li_stc); lustre_swab_lustre_fid(&id->li_fid); } -void lustre_swab_mds_status_req (struct mds_status_req *r) +void lustre_swab_mds_status_req(struct mds_status_req *r) { - __swab32s (&r->flags); - __swab32s (&r->repbuf); + __swab32s(&r->flags); + __swab32s(&r->repbuf); } /* @@ -707,159 +708,159 @@ struct mds_req_sec_desc *lustre_swab_mds_secdesc(struct ptlrpc_request *req, return rsd; } -void lustre_swab_mds_body (struct mds_body *b) +void lustre_swab_mds_body(struct mds_body *b) { - lustre_swab_lustre_id (&b->id1); - lustre_swab_lustre_id (&b->id2); + lustre_swab_lustre_id(&b->id1); + lustre_swab_lustre_id(&b->id2); /* handle is opaque */ - __swab64s (&b->size); - __swab64s (&b->blocks); - __swab64s (&b->valid); - __swab32s (&b->mode); - __swab32s (&b->uid); - __swab32s (&b->gid); - __swab32s (&b->mtime); - __swab32s (&b->ctime); - __swab32s (&b->atime); - __swab32s (&b->flags); - __swab32s (&b->rdev); - __swab32s (&b->nlink); - __swab32s (&b->eadatasize); + __swab64s(&b->size); + __swab64s(&b->blocks); + __swab64s(&b->valid); + __swab32s(&b->mode); + __swab32s(&b->uid); + __swab32s(&b->gid); + __swab32s(&b->mtime); + __swab32s(&b->ctime); + __swab32s(&b->atime); + __swab32s(&b->flags); + __swab32s(&b->rdev); + __swab32s(&b->nlink); + __swab32s(&b->eadatasize); } -void lustre_swab_mds_rec_setattr (struct mds_rec_setattr *sa) +void lustre_swab_mds_rec_setattr(struct mds_rec_setattr *sa) { - __swab32s (&sa->sa_opcode); - __swab32s (&sa->sa_valid); - lustre_swab_lustre_id (&sa->sa_id); - __swab32s (&sa->sa_mode); - __swab32s (&sa->sa_uid); - __swab32s (&sa->sa_gid); - __swab32s (&sa->sa_attr_flags); - __swab64s (&sa->sa_size); - __swab64s (&sa->sa_atime); - __swab64s (&sa->sa_mtime); - __swab64s (&sa->sa_ctime); + __swab32s(&sa->sa_opcode); + __swab32s(&sa->sa_valid); + lustre_swab_lustre_id(&sa->sa_id); + __swab32s(&sa->sa_mode); + __swab32s(&sa->sa_uid); + __swab32s(&sa->sa_gid); + __swab32s(&sa->sa_attr_flags); + __swab64s(&sa->sa_size); + __swab64s(&sa->sa_atime); + __swab64s(&sa->sa_mtime); + __swab64s(&sa->sa_ctime); } -void lustre_swab_mds_rec_create (struct mds_rec_create *cr) +void lustre_swab_mds_rec_create(struct mds_rec_create *cr) { - __swab32s (&cr->cr_opcode); - __swab32s (&cr->cr_flags); /* for use with open */ - __swab32s (&cr->cr_mode); - lustre_swab_lustre_id (&cr->cr_id); - lustre_swab_lustre_id (&cr->cr_replayid); - __swab64s (&cr->cr_time); - __swab64s (&cr->cr_rdev); + __swab32s(&cr->cr_opcode); + __swab32s(&cr->cr_flags); /* for use with open */ + __swab32s(&cr->cr_mode); + lustre_swab_lustre_id(&cr->cr_id); + lustre_swab_lustre_id(&cr->cr_replayid); + __swab64s(&cr->cr_time); + __swab64s(&cr->cr_rdev); } -void lustre_swab_mds_rec_link (struct mds_rec_link *lk) +void lustre_swab_mds_rec_link(struct mds_rec_link *lk) { - __swab32s (&lk->lk_opcode); - lustre_swab_lustre_id (&lk->lk_id1); - lustre_swab_lustre_id (&lk->lk_id2); + __swab32s(&lk->lk_opcode); + lustre_swab_lustre_id(&lk->lk_id1); + lustre_swab_lustre_id(&lk->lk_id2); } -void lustre_swab_mds_rec_unlink (struct mds_rec_unlink *ul) +void lustre_swab_mds_rec_unlink(struct mds_rec_unlink *ul) { - __swab32s (&ul->ul_opcode); - __swab32s (&ul->ul_mode); - lustre_swab_lustre_id (&ul->ul_id1); - lustre_swab_lustre_id (&ul->ul_id2); + __swab32s(&ul->ul_opcode); + __swab32s(&ul->ul_mode); + lustre_swab_lustre_id(&ul->ul_id1); + lustre_swab_lustre_id(&ul->ul_id2); } void lustre_swab_mds_rec_rename (struct mds_rec_rename *rn) { - __swab32s (&rn->rn_opcode); - lustre_swab_lustre_id (&rn->rn_id1); - lustre_swab_lustre_id (&rn->rn_id2); + __swab32s(&rn->rn_opcode); + lustre_swab_lustre_id(&rn->rn_id1); + lustre_swab_lustre_id(&rn->rn_id2); } -void lustre_swab_lov_desc (struct lov_desc *ld) +void lustre_swab_lov_desc(struct lov_desc *ld) { - __swab32s (&ld->ld_tgt_count); - __swab32s (&ld->ld_active_tgt_count); - __swab32s (&ld->ld_default_stripe_count); - __swab64s (&ld->ld_default_stripe_size); - __swab64s (&ld->ld_default_stripe_offset); - __swab32s (&ld->ld_pattern); + __swab32s(&ld->ld_tgt_count); + __swab32s(&ld->ld_active_tgt_count); + __swab32s(&ld->ld_default_stripe_count); + __swab64s(&ld->ld_default_stripe_size); + __swab64s(&ld->ld_default_stripe_offset); + __swab32s(&ld->ld_pattern); /* uuid endian insensitive */ } -void lustre_swab_ldlm_res_id (struct ldlm_res_id *id) +void lustre_swab_ldlm_res_id(struct ldlm_res_id *id) { int i; for (i = 0; i < RES_NAME_SIZE; i++) - __swab64s (&id->name[i]); + __swab64s(&id->name[i]); } -void lustre_swab_ldlm_policy_data (ldlm_policy_data_t *d) +void lustre_swab_ldlm_policy_data(ldlm_policy_data_t *d) { /* the lock data is a union and the first three fields of both EXTENT * and FLOCK types are __u64, so it's ok to swab them in the same way */ - __swab64s (&d->l_flock.start); - __swab64s (&d->l_flock.end); - __swab64s (&d->l_flock.pid); - __swab64s (&d->l_flock.blocking_pid); + __swab64s(&d->l_flock.start); + __swab64s(&d->l_flock.end); + __swab64s(&d->l_flock.pid); + __swab64s(&d->l_flock.blocking_pid); } -void lustre_swab_ldlm_intent (struct ldlm_intent *i) +void lustre_swab_ldlm_intent(struct ldlm_intent *i) { - __swab64s (&i->opc); + __swab64s(&i->opc); } -void lustre_swab_ldlm_resource_desc (struct ldlm_resource_desc *r) +void lustre_swab_ldlm_resource_desc(struct ldlm_resource_desc *r) { - __swab32s (&r->lr_type); - lustre_swab_ldlm_res_id (&r->lr_name); + __swab32s(&r->lr_type); + lustre_swab_ldlm_res_id(&r->lr_name); } -void lustre_swab_ldlm_lock_desc (struct ldlm_lock_desc *l) +void lustre_swab_ldlm_lock_desc(struct ldlm_lock_desc *l) { - lustre_swab_ldlm_resource_desc (&l->l_resource); - __swab32s (&l->l_req_mode); - __swab32s (&l->l_granted_mode); - lustre_swab_ldlm_policy_data (&l->l_policy_data); + lustre_swab_ldlm_resource_desc(&l->l_resource); + __swab32s(&l->l_req_mode); + __swab32s(&l->l_granted_mode); + lustre_swab_ldlm_policy_data(&l->l_policy_data); } -void lustre_swab_ldlm_request (struct ldlm_request *rq) +void lustre_swab_ldlm_request(struct ldlm_request *rq) { - __swab32s (&rq->lock_flags); - lustre_swab_ldlm_lock_desc (&rq->lock_desc); + __swab32s(&rq->lock_flags); + lustre_swab_ldlm_lock_desc(&rq->lock_desc); /* lock_handle1 opaque */ /* lock_handle2 opaque */ } -void lustre_swab_ldlm_reply (struct ldlm_reply *r) +void lustre_swab_ldlm_reply(struct ldlm_reply *r) { - __swab32s (&r->lock_flags); - lustre_swab_ldlm_lock_desc (&r->lock_desc); + __swab32s(&r->lock_flags); + lustre_swab_ldlm_lock_desc(&r->lock_desc); /* lock_handle opaque */ - __swab64s (&r->lock_policy_res1); - __swab64s (&r->lock_policy_res2); + __swab64s(&r->lock_policy_res1); + __swab64s(&r->lock_policy_res2); } -void lustre_swab_ptlbd_op (struct ptlbd_op *op) +void lustre_swab_ptlbd_op(struct ptlbd_op *op) { - __swab16s (&op->op_cmd); - __swab16s (&op->op_lun); - __swab16s (&op->op_niob_cnt); + __swab16s(&op->op_cmd); + __swab16s(&op->op_lun); + __swab16s(&op->op_niob_cnt); /* ignore op__padding */ - __swab32s (&op->op_block_cnt); + __swab32s(&op->op_block_cnt); } -void lustre_swab_ptlbd_niob (struct ptlbd_niob *n) +void lustre_swab_ptlbd_niob(struct ptlbd_niob *n) { - __swab64s (&n->n_xid); - __swab64s (&n->n_block_nr); - __swab32s (&n->n_offset); - __swab32s (&n->n_length); + __swab64s(&n->n_xid); + __swab64s(&n->n_block_nr); + __swab32s(&n->n_offset); + __swab32s(&n->n_length); } -void lustre_swab_ptlbd_rsp (struct ptlbd_rsp *r) +void lustre_swab_ptlbd_rsp(struct ptlbd_rsp *r) { - __swab16s (&r->r_status); - __swab16s (&r->r_error_cnt); + __swab16s(&r->r_status); + __swab16s(&r->r_error_cnt); } /* no one calls this */ @@ -871,6 +872,7 @@ int llog_log_swabbed(struct llog_log_hdr *hdr) return 0; return -1; } + void lustre_assert_wire_constants(void) { } -- 1.8.3.1