aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/lustre/lustre/mdc/mdc_locks.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/lustre/lustre/mdc/mdc_locks.c')
-rw-r--r--drivers/staging/lustre/lustre/mdc/mdc_locks.c47
1 files changed, 7 insertions, 40 deletions
diff --git a/drivers/staging/lustre/lustre/mdc/mdc_locks.c b/drivers/staging/lustre/lustre/mdc/mdc_locks.c
index bcb6c00c49ff..d4bf34b61f3a 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_locks.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_locks.c
@@ -322,12 +322,6 @@ static struct ptlrpc_request *mdc_intent_open_pack(struct obd_export *exp,
return ERR_PTR(-ENOMEM);
}
- /* parent capability */
- mdc_set_capa_size(req, &RMF_CAPA1, op_data->op_capa1);
- /* child capability, reserve the size according to parent capa, it will
- * be filled after we get the reply */
- mdc_set_capa_size(req, &RMF_CAPA2, op_data->op_capa1);
-
req_capsule_set_size(&req->rq_pill, &RMF_NAME, RCL_CLIENT,
op_data->op_namelen + 1);
req_capsule_set_size(&req->rq_pill, &RMF_EADATA, RCL_CLIENT,
@@ -369,15 +363,11 @@ mdc_intent_getxattr_pack(struct obd_export *exp,
int rc, count = 0, maxdata;
LIST_HEAD(cancels);
-
-
req = ptlrpc_request_alloc(class_exp2cliimp(exp),
&RQF_LDLM_INTENT_GETXATTR);
if (req == NULL)
return ERR_PTR(-ENOMEM);
- mdc_set_capa_size(req, &RMF_CAPA1, op_data->op_capa1);
-
rc = ldlm_prep_enqueue_req(exp, req, &cancels, count);
if (rc) {
ptlrpc_request_free(req);
@@ -391,8 +381,8 @@ mdc_intent_getxattr_pack(struct obd_export *exp,
maxdata = class_exp2cliimp(exp)->imp_connect_data.ocd_max_easize;
/* pack the intended request */
- mdc_pack_body(req, &op_data->op_fid1, op_data->op_capa1,
- op_data->op_valid, maxdata, -1, 0);
+ mdc_pack_body(req, &op_data->op_fid1, op_data->op_valid, maxdata, -1,
+ 0);
req_capsule_set_size(&req->rq_pill, &RMF_EADATA,
RCL_SERVER, maxdata);
@@ -422,7 +412,6 @@ static struct ptlrpc_request *mdc_intent_unlink_pack(struct obd_export *exp,
if (req == NULL)
return ERR_PTR(-ENOMEM);
- mdc_set_capa_size(req, &RMF_CAPA1, op_data->op_capa1);
req_capsule_set_size(&req->rq_pill, &RMF_NAME, RCL_CLIENT,
op_data->op_namelen + 1);
@@ -455,7 +444,7 @@ static struct ptlrpc_request *mdc_intent_getattr_pack(struct obd_export *exp,
struct obd_device *obddev = class_exp2obd(exp);
u64 valid = OBD_MD_FLGETATTR | OBD_MD_FLEASIZE |
OBD_MD_FLMODEASIZE | OBD_MD_FLDIREA |
- OBD_MD_FLMDSCAPA | OBD_MD_MEA |
+ OBD_MD_MEA |
(client_is_remote(exp) ?
OBD_MD_FLRMTPERM : OBD_MD_FLACL);
struct ldlm_intent *lit;
@@ -467,7 +456,6 @@ static struct ptlrpc_request *mdc_intent_getattr_pack(struct obd_export *exp,
if (req == NULL)
return ERR_PTR(-ENOMEM);
- mdc_set_capa_size(req, &RMF_CAPA1, op_data->op_capa1);
req_capsule_set_size(&req->rq_pill, &RMF_NAME, RCL_CLIENT,
op_data->op_namelen + 1);
@@ -705,27 +693,6 @@ static int mdc_finish_enqueue(struct obd_export *exp,
if (perm == NULL)
return -EPROTO;
}
- if (body->valid & OBD_MD_FLMDSCAPA) {
- struct lustre_capa *capa, *p;
-
- capa = req_capsule_server_get(pill, &RMF_CAPA1);
- if (capa == NULL)
- return -EPROTO;
-
- if (it->it_op & IT_OPEN) {
- /* client fid capa will be checked in replay */
- p = req_capsule_client_get(pill, &RMF_CAPA2);
- LASSERT(p);
- *p = *capa;
- }
- }
- if (body->valid & OBD_MD_FLOSSCAPA) {
- struct lustre_capa *capa;
-
- capa = req_capsule_server_get(pill, &RMF_CAPA2);
- if (capa == NULL)
- return -EPROTO;
- }
} else if (it->it_op & IT_LAYOUT) {
/* maybe the lock was granted right away and layout
* is packed into RMF_DLM_LVB of req */
@@ -826,7 +793,7 @@ resend:
LASSERT(lmm && lmmsize == 0);
LASSERTF(einfo->ei_type == LDLM_FLOCK, "lock type %d\n",
einfo->ei_type);
- policy = (ldlm_policy_data_t *)lmm;
+ policy = lmm;
res_id.name[3] = LDLM_FLOCK;
req = NULL;
} else if (it->it_op & IT_OPEN) {
@@ -864,7 +831,7 @@ resend:
if (resends) {
req->rq_generation_set = 1;
req->rq_import_generation = generation;
- req->rq_sent = get_seconds() + resends;
+ req->rq_sent = ktime_get_real_seconds() + resends;
}
/* It is important to obtain rpc_lock first (if applicable), so that
@@ -918,7 +885,7 @@ resend:
/* Retry the create infinitely when we get -EINPROGRESS from
* server. This is required by the new quota design. */
- if (it && it->it_op & IT_CREAT &&
+ if (it->it_op & IT_CREAT &&
(int)lockrep->lock_policy_res2 == -EINPROGRESS) {
mdc_clear_replay_flag(req, rc);
ptlrpc_req_finished(req);
@@ -1307,7 +1274,7 @@ int mdc_intent_getattr_async(struct obd_export *exp,
ga->ga_einfo = einfo;
req->rq_interpret_reply = mdc_intent_getattr_async_interpret;
- ptlrpcd_add_req(req, PDL_POLICY_LOCAL, -1);
+ ptlrpcd_add_req(req);
return 0;
}