#include <linux/lustre_dlm.h>
#include <linux/obd_class.h>
+extern inline struct mds_obd *mds_req2mds(struct ptlrpc_request *req);
+
struct mds_client_info *mds_uuid_to_mci(struct mds_obd *mds, __u8 *uuid)
{
struct list_head *p;
static int mds_reint_setattr(struct mds_update_record *rec, int offset,
struct ptlrpc_request *req)
{
- struct mds_obd *mds = &req->rq_obd->u.mds;
+ struct mds_obd *mds = mds_req2mds(req);
struct dentry *de;
void *handle;
int rc = 0;
struct ptlrpc_request *req)
{
struct dentry *de = NULL;
- struct mds_obd *mds = &req->rq_obd->u.mds;
+ struct mds_obd *mds = mds_req2mds(req);
struct dentry *dchild = NULL;
struct inode *dir;
int rc = 0;
struct ptlrpc_request *req)
{
struct dentry *de = NULL;
- struct mds_obd *mds = &req->rq_obd->u.mds;
+ struct mds_obd *mds = mds_req2mds(req);
struct dentry *dchild = NULL;
struct inode *dir;
void *handle;
if (offset)
offset = 1;
- if (strcmp(req->rq_obd->obd_type->typ_name, "mds") != 0)
+ if (strcmp(req->rq_export->export_obd->obd_type->typ_name, "mds") != 0)
LBUG();
de = mds_fid2dentry(mds, rec->ur_fid1, NULL);
if (rc == 0) {
LDLM_DEBUG_NOLOCK("enqueue res %Lu", res_id[0]);
rc = ldlm_cli_enqueue(mds->mds_ldlm_client, mds->mds_ldlm_conn,
+ (struct lustre_handle *)&mds->mds_connh,
NULL, mds->mds_local_namespace, NULL,
res_id, LDLM_PLAIN, NULL, 0, lock_mode,
&flags, (void *)mds_lock_callback, NULL,
{
struct dentry *de = NULL;
struct dentry *dchild = NULL;
- struct mds_obd *mds = &req->rq_obd->u.mds;
+ struct mds_obd *mds = mds_req2mds(req);
struct obdo *obdo;
struct inode *dir, *inode;
int lock_mode, flags;
if (rc == 0) {
LDLM_DEBUG_NOLOCK("enqueue res %Lu", res_id[0]);
rc = ldlm_cli_enqueue(mds->mds_ldlm_client, mds->mds_ldlm_conn,
+ (struct lustre_handle *)&mds->mds_connh,
NULL, mds->mds_local_namespace, NULL,
res_id, LDLM_PLAIN, NULL, 0, lock_mode,
&flags, (void *)mds_lock_callback, NULL,
* locks. */
LDLM_DEBUG_NOLOCK("getting EX lock res %Lu", res_id[0]);
rc = ldlm_cli_enqueue(mds->mds_ldlm_client, mds->mds_ldlm_conn,
+ (struct lustre_handle *)&mds->mds_connh,
NULL, mds->mds_local_namespace, NULL,
res_id,
LDLM_PLAIN, NULL, 0, LCK_EX, &flags,
if (!rc) {
ldlm_lock_decref(&lockh, LCK_EX);
- rc = ldlm_cli_cancel(&lockh);
+ rc = ldlm_cli_cancel(&lockh, NULL);
if (rc < 0)
CERROR("failed to cancel child inode lock ino "
"%Ld: %d\n", res_id[0], rc);
struct dentry *de_src = NULL;
struct dentry *de_tgt_dir = NULL;
struct dentry *dchild = NULL;
- struct mds_obd *mds = &req->rq_obd->u.mds;
+ struct mds_obd *mds = mds_req2mds(req);
void *handle;
int rc = 0;
int err;
struct dentry *de_tgtdir = NULL;
struct dentry *de_old = NULL;
struct dentry *de_new = NULL;
- struct mds_obd *mds = &req->rq_obd->u.mds;
+ struct mds_obd *mds = mds_req2mds(req);
void *handle;
int rc = 0;
int err;
int mds_reint_rec(struct mds_update_record *rec, int offset,
struct ptlrpc_request *req)
{
- struct mds_obd *mds = &req->rq_obd->u.mds;
+ struct mds_obd *mds = mds_req2mds(req);
struct obd_run_ctxt saved;
int rc;