From: yury Date: Fri, 14 Apr 2006 15:05:26 +0000 (+0000) Subject: - basic lmv to new fids adaptation. X-Git-Tag: v1_8_0_110~486^2~2012 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=add7d0bb6308b653f4e21adf81f97db52f945e50;p=fs%2Flustre-release.git - basic lmv to new fids adaptation. --- diff --git a/lustre/include/linux/lustre_idl.h b/lustre/include/linux/lustre_idl.h index 5b7774a..d91363b 100644 --- a/lustre/include/linux/lustre_idl.h +++ b/lustre/include/linux/lustre_idl.h @@ -652,6 +652,9 @@ static inline __u64 fid_num(const struct lu_fid *fid) return f_ver | fid_oid(fid); } +#define fid_equals(fid1, fid2) \ + (memcmp(fid1, fid2, sizeof(*fid1)) == 0) + #define DFID3 "["LPU64"/%u:%u]" #define PFID3(fid) \ diff --git a/lustre/llite/llite_internal.h b/lustre/llite/llite_internal.h index 132755f..c006cff 100644 --- a/lustre/llite/llite_internal.h +++ b/lustre/llite/llite_internal.h @@ -61,7 +61,6 @@ struct ll_inode_info { struct semaphore lli_size_sem; void *lli_size_sem_owner; struct semaphore lli_open_sem; - struct lov_stripe_md *lli_smd; char *lli_symlink_name; __u64 lli_maxbytes; __u64 lli_io_epoch; @@ -91,7 +90,9 @@ struct ll_inode_info { struct inode lli_vfs_inode; #endif + /* indexing fields for both metadata and data stacks. */ struct lu_fid lli_fid; + struct lov_stripe_md *lli_smd; }; /* diff --git a/lustre/lmv/Makefile.in b/lustre/lmv/Makefile.in index 8018baf..1b5a5bb 100644 --- a/lustre/lmv/Makefile.in +++ b/lustre/lmv/Makefile.in @@ -1,4 +1,4 @@ MODULES := lmv -lmv-objs := lmv_obd.o lmv_intent.o lmv_objmgr.o lproc_lmv.o +lmv-objs := lmv_obd.o lmv_intent.o llmv_fld.o mv_objmgr.o lproc_lmv.o @INCLUDE_RULES@ diff --git a/lustre/lmv/autoMakefile.am b/lustre/lmv/autoMakefile.am index 5de6b65..aafe1d5 100644 --- a/lustre/lmv/autoMakefile.am +++ b/lustre/lmv/autoMakefile.am @@ -5,7 +5,7 @@ if LIBLUSTRE noinst_LIBRARIES = liblmv.a -liblmv_a_SOURCES = lmv_obd.c lmv_intent.c lmv_objmgr.c +liblmv_a_SOURCES = lmv_obd.c lmv_intent.c lmv_objmgr.c lmv_fld.c liblmv_a_CPPFLAGS = $(LLCPPFLAGS) liblmv_a_CFLAGS = $(LLCFLAGS) endif diff --git a/lustre/lmv/lmv_fld.c b/lustre/lmv/lmv_fld.c new file mode 100644 index 0000000..45ca74d --- /dev/null +++ b/lustre/lmv/lmv_fld.c @@ -0,0 +1,52 @@ +/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- + * vim:expandtab:shiftwidth=8:tabstop=8: + * + * Copyright (C) 2006 Cluster File Systems, Inc. + * + * This file is part of Lustre, http://www.lustre.org. + * + * Lustre is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public + * License as published by the Free Software Foundation. + * + * Lustre is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Lustre; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef EXPORT_SYMTAB +# define EXPORT_SYMTAB +#endif +#define DEBUG_SUBSYSTEM S_LMV +#ifdef __KERNEL__ +#include +#include +#include +#include +#include +#include +#include +#else +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include "lmv_internal.h" + +/* dummy function for a while */ +int lmv_fld_lookup(struct obd_device *obd, struct lu_fid *fid) +{ + ENTRY; + RETUR(-ENOTSUPP); +} diff --git a/lustre/lmv/lmv_intent.c b/lustre/lmv/lmv_intent.c index c1f7a95..08ac381 100644 --- a/lustre/lmv/lmv_intent.c +++ b/lustre/lmv/lmv_intent.c @@ -64,10 +64,10 @@ int lmv_intent_remote(struct obd_export *exp, void *lmm, struct obd_device *obd = exp->exp_obd; struct lmv_obd *lmv = &obd->u.lmv; struct ptlrpc_request *req = NULL; - struct mds_body *body = NULL; + struct mdt_body *body = NULL; struct lustre_handle plock; - struct lustre_id nid; - int pmode, rc = 0; + struct lu_fid nid; + int pmode, i, rc = 0; ENTRY; body = lustre_msg_buf((*reqp)->rq_repmsg, 1, sizeof(*body)); @@ -99,9 +99,10 @@ int lmv_intent_remote(struct obd_export *exp, void *lmm, LASSERT((body->valid & OBD_MD_FID) != 0); - nid = body->id1; + nid = body->fid1; LUSTRE_IT(it)->it_disposition &= ~DISP_ENQ_COMPLETE; - rc = md_intent_lock(lmv->tgts[id_group(&nid)].ltd_exp, &nid, + i = lmv_fld_lookup(obd, &nid); + rc = md_intent_lock(lmv->tgts[i].ltd_exp, &nid, NULL, 0, lmm, lmmsize, NULL, it, flags, &req, cb_blocking); @@ -124,16 +125,16 @@ int lmv_intent_remote(struct obd_export *exp, void *lmm, RETURN(rc); } -int lmv_intent_open(struct obd_export *exp, struct lustre_id *pid, +int lmv_intent_open(struct obd_export *exp, struct lu_fid *pid, const char *name, int len, void *lmm, int lmmsize, - struct lustre_id *cid, struct lookup_intent *it, + struct lu_fid *cid, struct lookup_intent *it, int flags, struct ptlrpc_request **reqp, ldlm_blocking_callback cb_blocking) { struct obd_device *obd = exp->exp_obd; struct lmv_obd *lmv = &obd->u.lmv; - struct mds_body *body = NULL; - struct lustre_id rpid = *pid; + struct mdt_body *body = NULL; + struct lu_fid rpid = *pid; int rc, mds, loop = 0; struct lmv_obj *obj; struct mea *mea; @@ -144,7 +145,7 @@ int lmv_intent_open(struct obd_export *exp, struct lustre_id *pid, repeat: LASSERT(++loop <= 2); - mds = id_group(&rpid); + mds = lmv_fld_lookup(obd, &rpid); obj = lmv_grab_obj(obd, &rpid); if (obj) { /* directory is already splitted, so we have to forward @@ -152,18 +153,19 @@ repeat: mds = raw_name2idx(obj->hashtype, obj->objcount, (char *)name, len); - CDEBUG(D_OTHER, "forward to MDS #%u ("DLID4")\n", - mds, OLID4(&rpid)); - rpid = obj->objs[mds].id; + CDEBUG(D_OTHER, "forward to MDS #%u ("DFID3")\n", + mds, PFID3(&rpid)); + rpid = obj->objs[mds].lo_fid; lmv_put_obj(obj); } - rc = md_intent_lock(lmv->tgts[id_group(&rpid)].ltd_exp, &rpid, name, + mds = lmv_fld_lookup(obd, &rpid); + rc = md_intent_lock(lmv->tgts[mds].ltd_exp, &rpid, name, len, lmm, lmmsize, cid, it, flags, reqp, cb_blocking); if (rc == -ERESTART) { /* directory got splitted. time to update local object and * repeat the request with proper MDS */ - LASSERT(id_equal_fid(pid, &rpid)); + LASSERT(fid_equals(pid, &rpid)); rc = lmv_get_mea_and_update_object(exp, &rpid); if (rc == 0) { ptlrpc_req_finished(*reqp); @@ -185,14 +187,14 @@ repeat: * this is "usual" situation, we should not print error here, * only debug info. */ - CDEBUG(D_OTHER, "can't handle remote %s: dir "DLID4"("DLID4"):" - "%*s: %d\n", LL_IT2STR(it), OLID4(pid), OLID4(&rpid), + CDEBUG(D_OTHER, "can't handle remote %s: dir "DFID3"("DFID3"):" + "%*s: %d\n", LL_IT2STR(it), PFID3(pid), PFID3(&rpid), len, name, rc); RETURN(rc); } /* - * nothing is found, do not access body->id1 as it is zero and thus + * nothing is found, do not access body->fid1 as it is zero and thus * pointless. */ if ((LUSTRE_IT(it)->it_disposition & DISP_LOOKUP_NEG) && @@ -209,25 +211,25 @@ repeat: if (!(body->valid & OBD_MD_FID)) RETURN(0); - cid = &body->id1; + cid = &body->fid1; obj = lmv_grab_obj(obd, cid); if (!obj && (mea = lmv_splitted_dir_body(*reqp, 1))) { /* wow! this is splitted dir, we'd like to handle it */ - obj = lmv_create_obj(exp, &body->id1, mea); + obj = lmv_create_obj(exp, &body->fid1, mea); if (IS_ERR(obj)) RETURN(PTR_ERR(obj)); } if (obj) { /* this is splitted dir and we'd want to get attrs */ - CDEBUG(D_OTHER, "attrs from slaves for "DLID4"\n", - OLID4(cid)); + CDEBUG(D_OTHER, "attrs from slaves for "DFID3"\n", + PFID3(cid)); rc = lmv_revalidate_slaves(exp, reqp, cid, it, 1, cb_blocking); } else if (S_ISDIR(body->mode)) { - CDEBUG(D_OTHER, "object "DLID4" has not lmv obj?\n", - OLID4(cid)); + CDEBUG(D_OTHER, "object "DFID3" has not lmv obj?\n", + PFID3(cid)); } if (obj) @@ -236,16 +238,16 @@ repeat: RETURN(rc); } -int lmv_intent_getattr(struct obd_export *exp, struct lustre_id *pid, +int lmv_intent_getattr(struct obd_export *exp, struct lu_fid *pid, const char *name, int len, void *lmm, int lmmsize, - struct lustre_id *cid, struct lookup_intent *it, + struct lu_fid *cid, struct lookup_intent *it, int flags, struct ptlrpc_request **reqp, ldlm_blocking_callback cb_blocking) { struct obd_device *obd = exp->exp_obd; struct lmv_obd *lmv = &obd->u.lmv; - struct mds_body *body = NULL; - struct lustre_id rpid = *pid; + struct mdt_body *body = NULL; + struct lu_fid rpid = *pid; struct lmv_obj *obj = NULL, *obj2 = NULL; struct mea *mea; int rc = 0, mds; @@ -254,35 +256,35 @@ int lmv_intent_getattr(struct obd_export *exp, struct lustre_id *pid, if (cid) { /* caller wants to revalidate attrs of obj we have to revalidate * slaves if requested object is splitted directory */ - CDEBUG(D_OTHER, "revalidate attrs for "DLID4"\n", OLID4(cid)); - mds = id_group(cid); + CDEBUG(D_OTHER, "revalidate attrs for "DFID3"\n", PFID3(cid)); + mds = lmv_fld_lookup(obd, cid); #if 0 obj = lmv_grab_obj(obd, cid); if (obj) { /* in fact, we need not this with current intent_lock(), * but it may change some day */ - if (!id_equal_fid(pid, cid)){ - rpid = obj->objs[mds].id; - mds = id_group(&rpid); + if (!fid_equals(pid, cid)){ + rpid = obj->objs[mds].lo_fid; + mds = lmv_fld_lookup(obd, &rpid); } lmv_put_obj(obj); } #endif } else { - CDEBUG(D_OTHER, "INTENT getattr for %*s on "DLID4"\n", - len, name, OLID4(pid)); - mds = id_group(pid); + CDEBUG(D_OTHER, "INTENT getattr for %*s on "DFID3"\n", + len, name, PFID3(pid)); + mds = lmv_fld_lookup(obd, pid); obj = lmv_grab_obj(obd, pid); if (obj && len) { /* directory is already splitted. calculate mds */ mds = raw_name2idx(obj->hashtype, obj->objcount, (char *)name, len); - rpid = obj->objs[mds].id; - mds = id_group(&rpid); + rpid = obj->objs[mds].lo_fid; + mds = lmv_fld_lookup(obd, &rpid); lmv_put_obj(obj); - CDEBUG(D_OTHER, "forward to MDS #%u (slave "DLID4")\n", - mds, OLID4(&rpid)); + CDEBUG(D_OTHER, "forward to MDS #%u (slave "DFID3")\n", + mds, PFID3(&rpid)); } } @@ -300,8 +302,8 @@ int lmv_intent_getattr(struct obd_export *exp, struct lustre_id *pid, * be fine if we don't. this means that nobody should * use UPDATE lock to notify about object * removal */ CDEBUG(D_OTHER, - "revalidate slaves for "DLID4", rc %d\n", - OLID4(cid), rc); + "revalidate slaves for "DFID3", rc %d\n", + PFID3(cid), rc); LASSERT(cid != 0); rc = lmv_revalidate_slaves(exp, reqp, cid, it, rc, @@ -320,7 +322,7 @@ int lmv_intent_getattr(struct obd_export *exp, struct lustre_id *pid, RETURN(rc); /* - * nothing is found, do not access body->id1 as it is zero and thus + * nothing is found, do not access body->fid1 as it is zero and thus * pointless. */ if (LUSTRE_IT(it)->it_disposition & DISP_LOOKUP_NEG) @@ -333,7 +335,7 @@ int lmv_intent_getattr(struct obd_export *exp, struct lustre_id *pid, if (!(body->valid & OBD_MD_FID)) RETURN(0); - cid = &body->id1; + cid = &body->fid1; obj2 = lmv_grab_obj(obd, cid); if (!obj2 && (mea = lmv_splitted_dir_body(*reqp, 1))) { @@ -341,15 +343,15 @@ int lmv_intent_getattr(struct obd_export *exp, struct lustre_id *pid, body = lustre_msg_buf((*reqp)->rq_repmsg, 1, sizeof(*body)); LASSERT(body != NULL); - obj2 = lmv_create_obj(exp, &body->id1, mea); + obj2 = lmv_create_obj(exp, &body->fid1, mea); if (IS_ERR(obj2)) RETURN(PTR_ERR(obj2)); } if (obj2) { /* this is splitted dir and we'd want to get attrs */ - CDEBUG(D_OTHER, "attrs from slaves for "DLID4", rc %d\n", - OLID4(cid), rc); + CDEBUG(D_OTHER, "attrs from slaves for "DFID3", rc %d\n", + PFID3(cid), rc); rc = lmv_revalidate_slaves(exp, reqp, cid, it, 1, cb_blocking); @@ -358,7 +360,7 @@ int lmv_intent_getattr(struct obd_export *exp, struct lustre_id *pid, RETURN(rc); } -void lmv_update_body_from_obj(struct mds_body *body, struct lmv_inode *obj) +void lmv_update_body_from_obj(struct mdt_body *body, struct lmv_inode *obj) { /* update size */ body->size += obj->size; @@ -368,10 +370,10 @@ int lmv_lookup_slaves(struct obd_export *exp, struct ptlrpc_request **reqp) { struct obd_device *obd = exp->exp_obd; struct lmv_obd *lmv = &obd->u.lmv; - struct mds_body *body = NULL; + struct mdt_body *body = NULL; struct lustre_handle *lockh; struct ldlm_lock *lock; - struct mds_body *body2; + struct mdt_body *body2; struct lmv_obj *obj; int i, rc = 0; ENTRY; @@ -393,24 +395,25 @@ int lmv_lookup_slaves(struct obd_export *exp, struct ptlrpc_request **reqp) LASSERT(body != NULL); LASSERT((body->valid & OBD_MD_FID) != 0); - obj = lmv_grab_obj(obd, &body->id1); + obj = lmv_grab_obj(obd, &body->fid1); LASSERT(obj != NULL); - CDEBUG(D_OTHER, "lookup slaves for "DLID4"\n", - OLID4(&body->id1)); + CDEBUG(D_OTHER, "lookup slaves for "DFID3"\n", + PFID3(&body->fid1)); lmv_lock_obj(obj); for (i = 0; i < obj->objcount; i++) { - struct lustre_id id = obj->objs[i].id; + struct lu_fid fid = obj->objs[i].lo_fid; struct ptlrpc_request *req = NULL; struct lookup_intent it; + int mds; - if (id_equal_fid(&id, &obj->id)) + if (fid_equals(&fid, &obj->lo_fid)) /* skip master obj */ continue; - CDEBUG(D_OTHER, "lookup slave "DLID4"\n", OLID4(&id)); + CDEBUG(D_OTHER, "lookup slave "DFID3"\n", PFID3(&id)); /* is obj valid? */ memset(&it, 0, sizeof(it)); @@ -419,7 +422,8 @@ int lmv_lookup_slaves(struct obd_export *exp, struct ptlrpc_request **reqp) if (!it.d.fs_data) GOTO(cleanup, rc = -ENOMEM); - rc = md_intent_lock(lmv->tgts[id_group(&id)].ltd_exp, &id, + mds = lmv_fld_lookup(obd, &fid); + rc = md_intent_lock(lmv->tgts[mds].ltd_exp, &id, NULL, 0, NULL, 0, &id, &it, 0, &req, lmv_dirobj_blocking_ast); @@ -468,16 +472,16 @@ cleanup: return rc; } -int lmv_intent_lookup(struct obd_export *exp, struct lustre_id *pid, +int lmv_intent_lookup(struct obd_export *exp, struct lu_fid *pid, const char *name, int len, void *lmm, int lmmsize, - struct lustre_id *cid, struct lookup_intent *it, + struct lu_fid *cid, struct lookup_intent *it, int flags, struct ptlrpc_request **reqp, ldlm_blocking_callback cb_blocking) { struct obd_device *obd = exp->exp_obd; struct lmv_obd *lmv = &obd->u.lmv; - struct mds_body *body = NULL; - struct lustre_id rpid = *pid; + struct mdt_body *body = NULL; + struct lu_fid rpid = *pid; struct lmv_obj *obj; struct mea *mea; int rc, mds, loop = 0; @@ -499,16 +503,16 @@ int lmv_intent_lookup(struct obd_export *exp, struct lustre_id *pid, if (obj) { mds = raw_name2idx(obj->hashtype, obj->objcount, (char *)name, len); - rpid = obj->objs[mds].id; + rpid = obj->objs[mds].lo_fid; lmv_put_obj(obj); } - mds = id_group(&rpid); + mds = lmv_fld_lookup(obd, &rpid); - CDEBUG(D_OTHER, "revalidate lookup for "DLID4" to %d MDS\n", - OLID4(cid), mds); + CDEBUG(D_OTHER, "revalidate lookup for "DFID3" to %d MDS\n", + PFID3(cid), mds); } else { - mds = id_group(pid); + mds = lmv_fld_lookup(obd, pid); repeat: LASSERT(++loop <= 2); @@ -522,8 +526,8 @@ repeat: /* directory is already splitted. calculate mds */ mds = raw_name2idx(obj->hashtype, obj->objcount, (char *)name, len); - rpid = obj->objs[mds].id; - mds = id_group(&rpid); + rpid = obj->objs[mds].lo_fid; + mds = lmv_fld_lookup(obd, &rpid); } lmv_put_obj(obj); } @@ -538,16 +542,16 @@ repeat: if (rc > 0) { /* very interesting. it seems object is still valid but for some * reason llite calls lookup, not revalidate */ - CDEBUG(D_OTHER, "lookup for "DLID4" and data should be uptodate\n", - OLID4(&rpid)); + CDEBUG(D_OTHER, "lookup for "DFID3" and data should be uptodate\n", + PFID3(&rpid)); LASSERT(*reqp == NULL); RETURN(rc); } if (rc == 0 && *reqp == NULL) { /* once again, we're asked for lookup, not revalidate */ - CDEBUG(D_OTHER, "lookup for "DLID4" and data should be uptodate\n", - OLID4(&rpid)); + CDEBUG(D_OTHER, "lookup for "DFID3" and data should be uptodate\n", + PFID3(&rpid)); RETURN(rc); } @@ -578,9 +582,9 @@ repeat: LASSERT(body != NULL); LASSERT((body->valid & OBD_MD_FID) != 0); - obj = lmv_grab_obj(obd, &body->id1); + obj = lmv_grab_obj(obd, &body->fid1); if (!obj) { - obj = lmv_create_obj(exp, &body->id1, mea); + obj = lmv_create_obj(exp, &body->fid1, mea); if (IS_ERR(obj)) RETURN(PTR_ERR(obj)); } @@ -590,22 +594,22 @@ repeat: RETURN(rc); } -int lmv_intent_lock(struct obd_export *exp, struct lustre_id *pid, +int lmv_intent_lock(struct obd_export *exp, struct lu_fid *pid, const char *name, int len, void *lmm, int lmmsize, - struct lustre_id *cid, struct lookup_intent *it, + struct lu_fid *cid, struct lookup_intent *it, int flags, struct ptlrpc_request **reqp, ldlm_blocking_callback cb_blocking) { struct obd_device *obd = exp->exp_obd; - int rc = 0; + int rc, i = 0; ENTRY; LASSERT(it); LASSERT(pid); - CDEBUG(D_OTHER, "INTENT LOCK '%s' for '%*s' on %lu/%lu -> %lu\n", - LL_IT2STR(it), len, name, (unsigned long)id_ino(pid), - (unsigned long)id_gen(pid), (unsigned long)id_group(pid)); + i = lmv_fld_lookup(obd, pid); + CDEBUG(D_OTHER, "INTENT LOCK '%s' for '%*s' on "DFID3" -> %d\n", + LL_IT2STR(it), len, name, PFID3(pid), i); rc = lmv_check_connect(obd); if (rc) @@ -629,7 +633,7 @@ int lmv_intent_lock(struct obd_export *exp, struct lustre_id *pid, } int lmv_revalidate_slaves(struct obd_export *exp, struct ptlrpc_request **reqp, - struct lustre_id *mid, struct lookup_intent *oit, + struct lu_fid *mid, struct lookup_intent *oit, int master_valid, ldlm_blocking_callback cb_blocking) { struct obd_device *obd = exp->exp_obd; @@ -638,10 +642,10 @@ int lmv_revalidate_slaves(struct obd_export *exp, struct ptlrpc_request **reqp, struct lustre_handle master_lockh; struct ldlm_lock *lock; unsigned long size = 0; - struct mds_body *body; + struct mdt_body *body; struct lmv_obj *obj; int master_lock_mode; - int i, rc = 0; + int i, mds, rc = 0; ENTRY; /* we have to loop over the subobjects, check validity and update them @@ -657,15 +661,15 @@ int lmv_revalidate_slaves(struct obd_export *exp, struct ptlrpc_request **reqp, lmv_lock_obj(obj); for (i = 0; i < obj->objcount; i++) { - struct lustre_id id = obj->objs[i].id; + struct lu_fid fid = obj->objs[i].lo_fid; struct lustre_handle *lockh = NULL; struct ptlrpc_request *req = NULL; ldlm_blocking_callback cb; struct lookup_intent it; int master = 0; - CDEBUG(D_OTHER, "revalidate subobj "DLID4"\n", - OLID4(&id)); + CDEBUG(D_OTHER, "revalidate subobj "DFID3"\n", + PFID3(&id)); memset(&it, 0, sizeof(it)); it.it_op = IT_GETATTR; @@ -676,7 +680,7 @@ int lmv_revalidate_slaves(struct obd_export *exp, struct ptlrpc_request **reqp, if (!it.d.fs_data) GOTO(cleanup, rc = -ENOMEM); - if (id_equal_fid(&id, &obj->id)) { + if (fid_equals(&fid, &obj->lo_fid)) { if (master_valid) { /* lmv_intent_getattr() already checked * validness and took the lock */ @@ -699,7 +703,8 @@ int lmv_revalidate_slaves(struct obd_export *exp, struct ptlrpc_request **reqp, /* is obj valid? */ - rc = md_intent_lock(lmv->tgts[id_group(&id)].ltd_exp, + mds = lmv_fld_lookup(obd, &fid); + rc = md_intent_lock(lmv->tgts[mds].ltd_exp, &id, NULL, 0, NULL, 0, &id, &it, 0, &req, cb); lockh = (struct lustre_handle *) &LUSTRE_IT(&it)->it_lock_handle; @@ -771,12 +776,12 @@ release_lock: body->size = size; if (mreq == NULL) { - /* very important to maintain id_group(lli->lli_id) the + /* very important to maintain mds num the * same because of revalidation. mreq == NULL means that * caller has no reply and the only attr we can return * is size */ body->valid = OBD_MD_FLSIZE; -// body->mds = id_group(&obj->id); +// body->mds = lmv_fld_lookup(obd, &obj->lo_fid); } if (master_valid == 0) { memcpy(&LUSTRE_IT(oit)->it_lock_handle, diff --git a/lustre/lmv/lmv_internal.h b/lustre/lmv/lmv_internal.h index 76055cb..c90d8e7 100644 --- a/lustre/lmv/lmv_internal.h +++ b/lustre/lmv/lmv_internal.h @@ -32,27 +32,27 @@ #define MEA_SIZE_LMV(lmv) \ ((lmv)->desc.ld_tgt_count * \ - sizeof(struct lustre_id) + sizeof(struct mea)) + sizeof(struct lu_fid) + sizeof(struct mea)) struct lmv_inode { - struct lustre_id id; /* id of dirobj */ - unsigned long size; /* slave size value */ - int flags; + struct lu_fid li_fid; /* id of dirobj */ + unsigned long li_size; /* slave size value */ + int li_flags; }; #define O_FREEING (1 << 0) struct lmv_obj { - struct list_head list; - struct semaphore guard; - int state; /* object state. */ - atomic_t count; /* ref counter. */ - struct lustre_id id; /* master id of dir */ - void *update; /* bitmap of status (up-to-date) */ - __u32 hashtype; - int objcount; /* number of slaves */ - struct lmv_inode *objs; /* array of dirobjs */ - struct obd_device *obd; /* pointer to LMV itself */ + struct list_head lo_list; + struct semaphore lo_guard; + int lo_state; /* object state. */ + atomic_t lo_count; /* ref counter. */ + struct lu_fid lo_fid; /* master id of dir */ + void *lo_update; /* bitmap of status (up-to-date) */ + __u32 lo_hashtype; + int lo_objcount; /* number of slaves */ + struct lmv_inode *lo_objs; /* array of dirobjs */ + struct obd_device *lo_obd; /* pointer to LMV itself */ }; static inline void @@ -82,49 +82,50 @@ int lmv_check_connect(struct obd_device *obd); struct lmv_obj *lmv_get_obj(struct lmv_obj *obj); struct lmv_obj *lmv_grab_obj(struct obd_device *obd, - struct lustre_id *id); + struct lu_fid *fid); struct lmv_obj *lmv_alloc_obj(struct obd_device *obd, - struct lustre_id *id, + struct lu_fid *fid, struct mea *mea); struct lmv_obj *lmv_create_obj(struct obd_export *exp, - struct lustre_id *id, + struct lu_fid *fid, struct mea *mea); -int lmv_delete_obj(struct obd_export *exp, struct lustre_id *id); +int lmv_delete_obj(struct obd_export *exp, struct lu_fid *fid); -int lmv_intent_lock(struct obd_export *, struct lustre_id *, +int lmv_intent_lock(struct obd_export *, struct lu_fid *, const char *, int, void *, int, - struct lustre_id *, struct lookup_intent *, int, + struct lu_fid *, struct lookup_intent *, int, struct ptlrpc_request **, ldlm_blocking_callback); -int lmv_intent_lookup(struct obd_export *, struct lustre_id *, +int lmv_intent_lookup(struct obd_export *, struct lu_fid *, const char *, int, void *, int, - struct lustre_id *, struct lookup_intent *, int, + struct lu_fid *, struct lookup_intent *, int, struct ptlrpc_request **, ldlm_blocking_callback); -int lmv_intent_getattr(struct obd_export *, struct lustre_id *, +int lmv_intent_getattr(struct obd_export *, struct lu_fid *, const char *, int, void *, int, - struct lustre_id *, struct lookup_intent *, int, + struct lu_fid *, struct lookup_intent *, int, struct ptlrpc_request **, ldlm_blocking_callback); -int lmv_intent_open(struct obd_export *, struct lustre_id *, const char *, - int, void *, int, struct lustre_id *, struct lookup_intent *, +int lmv_intent_open(struct obd_export *, struct lu_fid *, const char *, + int, void *, int, struct lu_fid *, struct lookup_intent *, int, struct ptlrpc_request **, ldlm_blocking_callback); int lmv_revalidate_slaves(struct obd_export *, struct ptlrpc_request **, - struct lustre_id *, struct lookup_intent *, int, + struct lu_fid *, struct lookup_intent *, int, ldlm_blocking_callback cb_blocking); -int lmv_get_mea_and_update_object(struct obd_export *, struct lustre_id *); +int lmv_get_mea_and_update_object(struct obd_export *, struct lu_fid *); int lmv_dirobj_blocking_ast(struct ldlm_lock *, struct ldlm_lock_desc *, void *, int); +int lmv_fld_lookup(struct obd_device *obd, struct lu_fid *fid) static inline struct mea * lmv_splitted_dir_body(struct ptlrpc_request *req, int offset) { - struct mds_body *body; + struct mdt_body *body; struct mea *mea; LASSERT(req); diff --git a/lustre/lmv/lmv_obd.c b/lustre/lmv/lmv_obd.c index deed06f..b8c3d96 100644 --- a/lustre/lmv/lmv_obd.c +++ b/lustre/lmv/lmv_obd.c @@ -469,7 +469,7 @@ int lmv_add_mdc(struct obd_device *obd, struct obd_uuid *tgt_uuid) } else { int easize = sizeof(struct mea) + lmv->desc.ld_tgt_count * - sizeof(struct lustre_id); + sizeof(struct lu_fid); lmv_init_ea_size(obd->obd_self_export, easize, 0); } } @@ -514,7 +514,7 @@ int lmv_check_connect(struct obd_device *obd) lmv_set_timeouts(obd); class_export_put(lmv->exp); lmv->connected = 1; - easize = lmv->desc.ld_tgt_count * sizeof(struct lustre_id) + + easize = lmv->desc.ld_tgt_count * sizeof(struct lu_fid) + sizeof(struct mea); lmv_init_ea_size(obd->obd_self_export, easize, 0); lmv_init_unlock(lmv); @@ -786,7 +786,7 @@ out_free_temp: return rc; } -static int lmv_getstatus(struct obd_export *exp, struct lustre_id *id) +static int lmv_getstatus(struct obd_export *exp, struct lu_fid *fid) { struct obd_device *obd = exp->exp_obd; struct lmv_obd *lmv = &obd->u.lmv; @@ -797,13 +797,12 @@ static int lmv_getstatus(struct obd_export *exp, struct lustre_id *id) if (rc) RETURN(rc); - rc = md_getstatus(lmv->tgts[0].ltd_exp, id); - id_group(id) = 0; + rc = md_getstatus(lmv->tgts[0].ltd_exp, fid); RETURN(rc); } -static int lmv_getattr(struct obd_export *exp, struct lustre_id *id, +static int lmv_getattr(struct obd_export *exp, struct lu_fid *fid, __u64 valid, const char *xattr_name, const void *xattr_data, unsigned int xattr_datalen, unsigned int ea_size, struct obd_capa *ocapa, @@ -811,27 +810,27 @@ static int lmv_getattr(struct obd_export *exp, struct lustre_id *id, { struct obd_device *obd = exp->exp_obd; struct lmv_obd *lmv = &obd->u.lmv; - int rc, i = id_group(id); struct lmv_obj *obj; + int rc, i; ENTRY; rc = lmv_check_connect(obd); if (rc) RETURN(rc); + i = lmv_fld_lookup(obd, fid); LASSERT(i < lmv->desc.ld_tgt_count); - - rc = md_getattr(lmv->tgts[i].ltd_exp, id, valid, + rc = md_getattr(lmv->tgts[i].ltd_exp, fid, valid, xattr_name, xattr_data, xattr_datalen, ea_size, ocapa, request); if (rc) RETURN(rc); - obj = lmv_grab_obj(obd, id); + obj = lmv_grab_obj(obd, fid); - CDEBUG(D_OTHER, "GETATTR for "DLID4" %s\n", - OLID4(id), obj ? "(splitted)" : ""); + CDEBUG(D_OTHER, "GETATTR for "DFID3" %s\n", + PFID3(fid), obj ? "(splitted)" : ""); /* * if object is splitted, then we loop over all the slaves and gather @@ -841,7 +840,7 @@ static int lmv_getattr(struct obd_export *exp, struct lustre_id *id, * but... */ if (obj) { - struct mds_body *body; + struct mdt_body *body; if (*request == NULL) { lmv_put_obj(obj); @@ -863,7 +862,7 @@ static int lmv_getattr(struct obd_export *exp, struct lustre_id *id, } /* skip master obj. */ - if (id_equal_fid(&obj->id, &obj->objs[i].id)) + if (fid_equals(&obj->lo_fid, &obj->objs[i].lo_fid)) continue; body->size += obj->objs[i].size; @@ -877,12 +876,12 @@ static int lmv_getattr(struct obd_export *exp, struct lustre_id *id, } static int lmv_access_check(struct obd_export *exp, - struct lustre_id *id, + struct lu_fid *fid, struct ptlrpc_request **request) { struct obd_device *obd = exp->exp_obd; struct lmv_obd *lmv = &obd->u.lmv; - int rc, i = id_group(id); + int rc, i; ENTRY; rc = lmv_check_connect(obd); @@ -890,12 +889,12 @@ static int lmv_access_check(struct obd_export *exp, RETURN(rc); LASSERT(i < lmv->desc.ld_tgt_count); - rc = md_access_check(lmv->tgts[i].ltd_exp, id, request); + rc = md_access_check(lmv->tgts[i].ltd_exp, fid, request); RETURN(rc); } static int lmv_change_cbdata(struct obd_export *exp, - struct lustre_id *id, + struct lu_fid *fid, ldlm_iterator_t it, void *data) { @@ -908,70 +907,74 @@ static int lmv_change_cbdata(struct obd_export *exp, if (rc) RETURN(rc); - CDEBUG(D_OTHER, "CBDATA for "DLID4"\n", OLID4(id)); - LASSERT(id_group(id) < lmv->desc.ld_tgt_count); + CDEBUG(D_OTHER, "CBDATA for "DFID3"\n", PFID3(fid)); + i = lmv_fld_lookup(obd, fid); + LASSERT(i < lmv->desc.ld_tgt_count); /* with CMD every object can have two locks in different * namespaces: lookup lock in space of mds storing direntry * and update/open lock in space of mds storing inode */ for (i = 0; i < lmv->desc.ld_tgt_count; i++) - md_change_cbdata(lmv->tgts[i].ltd_exp, id, it, data); + md_change_cbdata(lmv->tgts[i].ltd_exp, fid, it, data); RETURN(0); } static int lmv_change_cbdata_name(struct obd_export *exp, - struct lustre_id *pid, + struct lu_fid *pid, char *name, int len, - struct lustre_id *cid, + struct lu_fid *cid, ldlm_iterator_t it, void *data) { struct obd_device *obd = exp->exp_obd; struct lmv_obd *lmv = &obd->u.lmv; - struct lustre_id rcid = *cid; + struct lu_fid rcid = *cid; struct lmv_obj *obj; - int rc = 0, mds; + int i, rc = 0, mds; ENTRY; rc = lmv_check_connect(obd); if (rc) RETURN(rc); - LASSERT(id_group(pid) < lmv->desc.ld_tgt_count); - LASSERT(id_group(cid) < lmv->desc.ld_tgt_count); + i = lmv_fld_lookup(obd, pid); + LASSERT(i < lmv->desc.ld_tgt_count); + i = lmv_fld_lookup(obd, cid); + LASSERT(i < lmv->desc.ld_tgt_count); - CDEBUG(D_OTHER, "CBDATA for "DLID4":%*s -> "DLID4"\n", - OLID4(pid), len, name, OLID4(cid)); + CDEBUG(D_OTHER, "CBDATA for "DFID3":%*s -> "DFID3"\n", + PFID3(pid), len, name, PFID3(cid)); /* this is default mds for directory name belongs to. */ - mds = id_group(pid); + mds = lmv_fld_lookup(obd, pid); obj = lmv_grab_obj(obd, pid); if (obj) { /* directory is splitted. look for right mds for this name. */ mds = raw_name2idx(obj->hashtype, obj->objcount, name, len); - rcid = obj->objs[mds].id; - mds = id_group(&rcid); + rcid = obj->objs[mds].lo_fid; + mds = lmv_fld_lookup(obd, &rcid); lmv_put_obj(obj); } rc = md_change_cbdata(lmv->tgts[mds].ltd_exp, &rcid, it, data); RETURN(rc); } -static int lmv_valid_attrs(struct obd_export *exp, struct lustre_id *id) +static int lmv_valid_attrs(struct obd_export *exp, struct lu_fid *fid) { struct obd_device *obd = exp->exp_obd; struct lmv_obd *lmv = &obd->u.lmv; - int rc = 0; + int i, rc = 0; ENTRY; rc = lmv_check_connect(obd); if (rc) RETURN(rc); - CDEBUG(D_OTHER, "validate "DLID4"\n", OLID4(id)); - LASSERT(id_group(id) < lmv->desc.ld_tgt_count); - rc = md_valid_attrs(lmv->tgts[id_group(id)].ltd_exp, id); + CDEBUG(D_OTHER, "validate "DFID3"\n", PFID3(fid)); + i = lmv_fld_lookup(obd, fid); + LASSERT(i < lmv->desc.ld_tgt_count); + rc = md_valid_attrs(lmv->tgts[i].ltd_exp, fid); RETURN(rc); } @@ -981,28 +984,29 @@ static int lmv_close(struct obd_export *exp, struct mdc_op_data *op_data, { struct obd_device *obd = exp->exp_obd; struct lmv_obd *lmv = &obd->u.lmv; - int rc, i = id_group(&op_data->id1); + int rc, i; ENTRY; rc = lmv_check_connect(obd); if (rc) RETURN(rc); + i = lmv_fld_lookup(obd, &op_data->fid1); LASSERT(i < lmv->desc.ld_tgt_count); - CDEBUG(D_OTHER, "CLOSE "DLID4"\n", OLID4(&op_data->id1)); + CDEBUG(D_OTHER, "CLOSE "DFID3"\n", PFID3(&op_data->fid1)); rc = md_close(lmv->tgts[i].ltd_exp, op_data, och, request); RETURN(rc); } int lmv_get_mea_and_update_object(struct obd_export *exp, - struct lustre_id *id) + struct lu_fid *fid) { struct obd_device *obd = exp->exp_obd; struct lmv_obd *lmv = &obd->u.lmv; struct ptlrpc_request *req = NULL; struct lmv_obj *obj; struct lustre_md md; - int mealen, rc; + int mealen, rc, i; __u64 valid; ENTRY; @@ -1012,7 +1016,8 @@ int lmv_get_mea_and_update_object(struct obd_export *exp, valid = OBD_MD_FLEASIZE | OBD_MD_FLDIREA | OBD_MD_MEA; /* time to update mea of parent id */ - rc = md_getattr(lmv->tgts[id_group(id)].ltd_exp, + i = lmv_fld_lookup(obd, fid); + rc = md_getattr(lmv->tgts[i].ltd_exp, id, valid, NULL, NULL, 0, mealen, NULL, &req); if (rc) { CERROR("md_getattr() failed, error %d\n", rc); @@ -1028,7 +1033,7 @@ int lmv_get_mea_and_update_object(struct obd_export *exp, if (md.mea == NULL) GOTO(cleanup, rc = -ENODATA); - obj = lmv_create_obj(exp, id, md.mea); + obj = lmv_create_obj(exp, fid, md.mea); if (IS_ERR(obj)) rc = PTR_ERR(obj); else @@ -1049,7 +1054,7 @@ int lmv_create(struct obd_export *exp, struct mdc_op_data *op_data, { struct obd_device *obd = exp->exp_obd; struct lmv_obd *lmv = &obd->u.lmv; - struct mds_body *body; + struct mdt_body *body; struct lmv_obj *obj; int rc, mds, loop = 0; ENTRY; @@ -1062,18 +1067,19 @@ int lmv_create(struct obd_export *exp, struct mdc_op_data *op_data, RETURN(-EIO); repeat: LASSERT(++loop <= 2); - obj = lmv_grab_obj(obd, &op_data->id1); + obj = lmv_grab_obj(obd, &op_data->fid1); if (obj) { mds = raw_name2idx(obj->hashtype, obj->objcount, op_data->name, op_data->namelen); - op_data->id1 = obj->objs[mds].id; + op_data->fid1 = obj->objs[mds].lo_fid; lmv_put_obj(obj); } - CDEBUG(D_OTHER, "CREATE '%*s' on "DLID4"\n", op_data->namelen, - op_data->name, OLID4(&op_data->id1)); + CDEBUG(D_OTHER, "CREATE '%*s' on "DFID3"\n", op_data->namelen, + op_data->name, PFID3(&op_data->fid1)); - rc = md_create(lmv->tgts[id_group(&op_data->id1)].ltd_exp, + mds = lmv_fld_lookup(obd, &op_data->fid1); + rc = md_create(lmv->tgts[mds].ltd_exp, op_data, data, datalen, mode, uid, gid, rdev, request); if (rc == 0) { @@ -1085,13 +1091,13 @@ repeat: if (body == NULL) RETURN(-ENOMEM); - CDEBUG(D_OTHER, "created. "DLID4"\n", OLID4(&op_data->id1)); + CDEBUG(D_OTHER, "created. "DFID3"\n", PFID3(&op_data->fid1)); } else if (rc == -ERESTART) { /* * directory got splitted. time to update local object and * repeat the request with proper MDS. */ - rc = lmv_get_mea_and_update_object(exp, &op_data->id1); + rc = lmv_get_mea_and_update_object(exp, &op_data->fid1); if (rc == 0) { ptlrpc_req_finished(*request); goto repeat; @@ -1138,8 +1144,8 @@ lmv_enqueue_slaves(struct obd_export *exp, int locktype, LASSERT(mea != NULL); for (i = 0; i < mea->mea_count; i++) { memset(data2, 0, sizeof(*data2)); - data2->id1 = mea->mea_ids[i]; - mds = id_group(&data2->id1); + data2->fid1 = mea->mea_ids[i]; + mds = lmv_fld_lookup(obd, &data2->fid1); if (lmv->tgts[mds].ltd_exp == NULL) continue; @@ -1148,8 +1154,8 @@ lmv_enqueue_slaves(struct obd_export *exp, int locktype, lockmode, data2, lockh + i, lmm, lmmsize, cb_compl, cb_blocking, cb_data); - CDEBUG(D_OTHER, "take lock on slave "DLID4" -> %d/%d\n", - OLID4(&mea->mea_ids[i]), rc, LUSTRE_IT(it)->it_status); + CDEBUG(D_OTHER, "take lock on slave "DFID3" -> %d/%d\n", + PFID3(&mea->mea_ids[i]), rc, LUSTRE_IT(it)->it_status); if (rc) GOTO(cleanup, rc); if (LUSTRE_IT(it)->it_data) { @@ -1188,8 +1194,8 @@ lmv_enqueue_remote(struct obd_export *exp, int lock_type, struct lmv_obd *lmv = &obd->u.lmv; struct lustre_handle plock; struct mdc_op_data rdata; - struct mds_body *body = NULL; - int rc = 0, pmode; + struct mdt_body *body = NULL; + int i, rc = 0, pmode; ENTRY; body = lustre_msg_buf(req->rq_repmsg, 1, sizeof(*body)); @@ -1198,8 +1204,8 @@ lmv_enqueue_remote(struct obd_export *exp, int lock_type, if (!(body->valid & OBD_MD_MDS)) RETURN(0); - CDEBUG(D_OTHER, "ENQUEUE '%s' on "DLID4" -> "DLID4"\n", - LL_IT2STR(it), OLID4(&data->id1), OLID4(&body->id1)); + CDEBUG(D_OTHER, "ENQUEUE '%s' on "DFID3" -> "DFID3"\n", + LL_IT2STR(it), PFID3(&data->fid1), PFID3(&body->fid1)); /* we got LOOKUP lock, but we really need attrs */ pmode = LUSTRE_IT(it)->it_lock_mode; @@ -1210,14 +1216,15 @@ lmv_enqueue_remote(struct obd_export *exp, int lock_type, LASSERT((body->valid & OBD_MD_FID) != 0); memcpy(&rdata, data, sizeof(rdata)); - rdata.id1 = body->id1; + rdata.fid1 = body->fid1; rdata.name = NULL; rdata.namelen = 0; LUSTRE_IT(it)->it_disposition &= ~DISP_ENQ_COMPLETE; ptlrpc_req_finished(req); - rc = md_enqueue(lmv->tgts[id_group(&rdata.id1)].ltd_exp, + i = lmv_fld_lookup(obd, &rdata.fid1); + rc = md_enqueue(lmv->tgts[i].ltd_exp, lock_type, it, lock_mode, &rdata, lockh, lmm, lmmsize, cb_compl, cb_blocking, cb_data); ldlm_lock_decref(&plock, pmode); @@ -1249,20 +1256,21 @@ lmv_enqueue(struct obd_export *exp, int lock_type, } if (data->namelen) { - obj = lmv_grab_obj(obd, &data->id1); + obj = lmv_grab_obj(obd, &data->fid1); if (obj) { /* directory is splitted. look for right mds for this * name */ mds = raw_name2idx(obj->hashtype, obj->objcount, (char *)data->name, data->namelen); - data->id1 = obj->objs[mds].id; + data->fid1 = obj->objs[mds].lo_fid; lmv_put_obj(obj); } } - CDEBUG(D_OTHER, "ENQUEUE '%s' on "DLID4"\n", LL_IT2STR(it), - OLID4(&data->id1)); + CDEBUG(D_OTHER, "ENQUEUE '%s' on "DFID3"\n", LL_IT2STR(it), + PFID3(&data->fid1)); - rc = md_enqueue(lmv->tgts[id_group(&data->id1)].ltd_exp, + mds = lmv_fld_lookup(obd, &data->fid1); + rc = md_enqueue(lmv->tgts[mds].ltd_exp, lock_type, it, lock_mode, data, lockh, lmm, lmmsize, cb_compl, cb_blocking, cb_data); if (rc == 0 && it->it_op == IT_OPEN) @@ -1273,36 +1281,39 @@ lmv_enqueue(struct obd_export *exp, int lock_type, } static int -lmv_getattr_lock(struct obd_export *exp, struct lustre_id *id, +lmv_getattr_lock(struct obd_export *exp, struct lu_fid *fid, 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; struct lmv_obd *lmv = &obd->u.lmv; - struct lustre_id rid = *id; - struct mds_body *body; + struct lu_fid rid = *fid; + int rc, mds, loop = 0; + struct mdt_body *body; struct lmv_obj *obj; ENTRY; rc = lmv_check_connect(obd); if (rc) RETURN(rc); + + mds = lmv_fld_lookup(obd, fid); repeat: LASSERT(++loop <= 2); - obj = lmv_grab_obj(obd, id); + obj = lmv_grab_obj(obd, fid); if (obj) { /* directory is splitted. look for right mds for this name */ mds = raw_name2idx(obj->hashtype, obj->objcount, filename, namelen - 1); - rid = obj->objs[mds].id; + rid = obj->objs[mds].lo_fid; lmv_put_obj(obj); } - CDEBUG(D_OTHER, "getattr_lock for %*s on "DLID4" -> "DLID4"\n", - namelen, filename, OLID4(id), OLID4(&rid)); + CDEBUG(D_OTHER, "getattr_lock for %*s on "DFID3" -> "DFID3"\n", + namelen, filename, PFID3(fid), PFID3(&rid)); - rc = md_getattr_lock(lmv->tgts[id_group(&rid)].ltd_exp, + mds = lmv_fld_lookup(obd, &rid); + rc = md_getattr_lock(lmv->tgts[mds].ltd_exp, &rid, filename, namelen, valid == OBD_MD_FLID ? valid : valid | OBD_MD_FID, ea_size, request); @@ -1320,10 +1331,11 @@ repeat: if (body->valid & OBD_MD_MDS) { struct ptlrpc_request *req = NULL; - rid = body->id1; - CDEBUG(D_OTHER, "request attrs for "DLID4"\n", OLID4(&rid)); + rid = body->fid1; + CDEBUG(D_OTHER, "request attrs for "DFID3"\n", PFID3(&rid)); - rc = md_getattr_lock(lmv->tgts[id_group(&rid)].ltd_exp, + mds = lmv_fld_lookup(obd, &rid); + rc = md_getattr_lock(lmv->tgts[mds].ltd_exp, &rid, NULL, 1, valid, ea_size, &req); ptlrpc_req_finished(*request); *request = req; @@ -1341,8 +1353,8 @@ repeat: } /* - * llite passes id of an target inode in data->id1 and id of directory in - * data->id2 + * llite passes id of an target inode in data->fid1 and id of directory in + * data->fid2 */ static int lmv_link(struct obd_export *exp, struct mdc_op_data *data, struct ptlrpc_request **request) @@ -1359,29 +1371,29 @@ static int lmv_link(struct obd_export *exp, struct mdc_op_data *data, if (data->namelen != 0) { /* usual link request */ - obj = lmv_grab_obj(obd, &data->id2); + obj = lmv_grab_obj(obd, &data->fid2); if (obj) { rc = raw_name2idx(obj->hashtype, obj->objcount, data->name, data->namelen); - data->id2 = obj->objs[rc].id; + data->fid2 = obj->objs[rc].lo_fid; lmv_put_obj(obj); } - mds = id_group(&data->id2); - - CDEBUG(D_OTHER,"link "DLID4":%*s to "DLID4"\n", - OLID4(&data->id2), data->namelen, data->name, - OLID4(&data->id1)); + mds = lmv_fld_lookup(obd, &data->fid2); + + CDEBUG(D_OTHER,"link "DFID3":%*s to "DFID3"\n", + PFID3(&data->fid2), data->namelen, data->name, + PFID3(&data->fid1)); } else { - mds = id_group(&data->id1); + mds = id_group(&data->fid1); /* request from MDS to acquire i_links for inode by id1 */ - CDEBUG(D_OTHER, "inc i_nlinks for "DLID4"\n", - OLID4(&data->id1)); + CDEBUG(D_OTHER, "inc i_nlinks for "DFID3"\n", + PFID3(&data->fid1)); } - CDEBUG(D_OTHER, "forward to MDS #%u ("DLID4")\n", - mds, OLID4(&data->id1)); + CDEBUG(D_OTHER, "forward to MDS #%u ("DFID3")\n", + mds, PFID3(&data->fid1)); rc = md_link(lmv->tgts[mds].ltd_exp, data, request); RETURN(rc); @@ -1397,9 +1409,9 @@ static int lmv_rename(struct obd_export *exp, struct mdc_op_data *data, int rc, mds; ENTRY; - CDEBUG(D_OTHER, "rename %*s in "DLID4" to %*s in "DLID4"\n", - oldlen, old, OLID4(&data->id1), newlen, new, - OLID4(&data->id2)); + CDEBUG(D_OTHER, "rename %*s in "DFID3" to %*s in "DFID3"\n", + oldlen, old, PFID3(&data->fid1), newlen, new, + PFID3(&data->fid2)); rc = lmv_check_connect(obd); if (rc) @@ -1411,29 +1423,29 @@ static int lmv_rename(struct obd_export *exp, struct mdc_op_data *data, * there. */ CDEBUG(D_OTHER, - "create %*s(%d/%d) in "DLID4" pointing " - "to "DLID4"\n", newlen, new, oldlen, newlen, - OLID4(&data->id2), OLID4(&data->id1)); + "create %*s(%d/%d) in "DFID3" pointing " + "to "DFID3"\n", newlen, new, oldlen, newlen, + PFID3(&data->fid2), PFID3(&data->fid1)); - mds = id_group(&data->id2); + mds = lmv_fld_lookup(obd, &data->fid2); /* * target directory can be splitted, sowe should forward request * to the right MDS. */ - obj = lmv_grab_obj(obd, &data->id2); + obj = lmv_grab_obj(obd, &data->fid2); if (obj) { mds = raw_name2idx(obj->hashtype, obj->objcount, (char *)new, newlen); - data->id2 = obj->objs[mds].id; - CDEBUG(D_OTHER, "forward to MDS #%u ("DLID4")\n", mds, - OLID4(&data->id2)); + data->fid2 = obj->objs[mds].lo_fid; + CDEBUG(D_OTHER, "forward to MDS #%u ("DFID3")\n", mds, + PFID3(&data->fid2)); lmv_put_obj(obj); } goto request; } - obj = lmv_grab_obj(obd, &data->id1); + obj = lmv_grab_obj(obd, &data->fid1); if (obj) { /* * directory is already splitted, so we have to forward request @@ -1441,13 +1453,13 @@ static int lmv_rename(struct obd_export *exp, struct mdc_op_data *data, */ mds = raw_name2idx(obj->hashtype, obj->objcount, (char *)old, oldlen); - data->id1 = obj->objs[mds].id; - CDEBUG(D_OTHER, "forward to MDS #%u ("DLID4")\n", mds, - OLID4(&data->id1)); + data->fid1 = obj->objs[mds].lo_fid; + CDEBUG(D_OTHER, "forward to MDS #%u ("DFID3")\n", mds, + PFID3(&data->fid1)); lmv_put_obj(obj); } - obj = lmv_grab_obj(obd, &data->id2); + obj = lmv_grab_obj(obd, &data->fid2); if (obj) { /* * directory is already splitted, so we have to forward request @@ -1456,18 +1468,18 @@ static int lmv_rename(struct obd_export *exp, struct mdc_op_data *data, mds = raw_name2idx(obj->hashtype, obj->objcount, (char *)new, newlen); - data->id2 = obj->objs[mds].id; - CDEBUG(D_OTHER, "forward to MDS #%u ("DLID4")\n", mds, - OLID4(&data->id2)); + data->fid2 = obj->objs[mds].lo_fid; + CDEBUG(D_OTHER, "forward to MDS #%u ("DFID3")\n", mds, + PFID3(&data->fid2)); lmv_put_obj(obj); } - mds = id_group(&data->id1); + mds = lmv_fld_lookup(obd, &data->fid1); request: - if (id_group(&data->id1) != id_group(&data->id2)) { - CDEBUG(D_OTHER,"cross-node rename "DLID4"/%*s to "DLID4"/%*s\n", - OLID4(&data->id1), oldlen, old, OLID4(&data->id2), + if (mds != lmv_fld_lookup(obd, &data->fid2)) { + CDEBUG(D_OTHER,"cross-node rename "DFID3"/%*s to "DFID3"/%*s\n", + PFID3(&data->fid1), oldlen, old, PFID3(&data->fid2), newlen, new); } @@ -1484,29 +1496,30 @@ static int lmv_setattr(struct obd_export *exp, struct mdc_op_data *data, struct obd_device *obd = exp->exp_obd; struct lmv_obd *lmv = &obd->u.lmv; struct ptlrpc_request *req; - struct mds_body *body; + struct mdt_body *body; struct lmv_obj *obj; - int rc = 0, i; + int rc = 0, i, mds; ENTRY; rc = lmv_check_connect(obd); if (rc) RETURN(rc); - obj = lmv_grab_obj(obd, &data->id1); + obj = lmv_grab_obj(obd, &data->fid1); - CDEBUG(D_OTHER, "SETATTR for "DLID4", valid 0x%x%s\n", - OLID4(&data->id1), iattr->ia_valid, obj ? ", splitted" : ""); + CDEBUG(D_OTHER, "SETATTR for "DFID3", valid 0x%x%s\n", + PFID3(&data->fid1), iattr->ia_valid, obj ? ", splitted" : ""); if (obj) { for (i = 0; i < obj->objcount; i++) { - data->id1 = obj->objs[i].id; + data->fid1 = obj->objs[i].lo_fid; - rc = md_setattr(lmv->tgts[id_group(&data->id1)].ltd_exp, + mds = lmv_fld_lookup(obd, &data->fid1); + rc = md_setattr(lmv->tgts[mds].ltd_exp, data, iattr, ea, ealen, ea2, ea2len, ea3, ea3len, &req); - if (id_equal_fid(&obj->id, &obj->objs[i].id)) { + if (fid_equals(&obj->lo_fid, &obj->objs[i].lo_fid)) { /* * this is master object and this request should * be returned back to llite. @@ -1521,8 +1534,9 @@ static int lmv_setattr(struct obd_export *exp, struct mdc_op_data *data, } lmv_put_obj(obj); } else { - LASSERT(id_group(&data->id1) < lmv->desc.ld_tgt_count); - rc = md_setattr(lmv->tgts[id_group(&data->id1)].ltd_exp, + mds = lmv_fld_lookup(obd, &data->fid1); + LASSERT(mds < lmv->desc.ld_tgt_count); + rc = md_setattr(lmv->tgts[mds].ltd_exp, data, iattr, ea, ealen, ea2, ea2len, ea3, ea3len, request); if (rc == 0) { @@ -1530,26 +1544,26 @@ static int lmv_setattr(struct obd_export *exp, struct mdc_op_data *data, sizeof(*body)); LASSERT(body != NULL); LASSERT((body->valid & OBD_MD_FID) != 0); - LASSERT(id_group(&body->id1) == id_group(&data->id1)); } } RETURN(rc); } -static int lmv_sync(struct obd_export *exp, struct lustre_id *id, +static int lmv_sync(struct obd_export *exp, struct lu_fid *fid, struct ptlrpc_request **request) { struct obd_device *obd = exp->exp_obd; struct lmv_obd *lmv = &obd->u.lmv; - int rc; + int i, rc; ENTRY; rc = lmv_check_connect(obd); if (rc) RETURN(rc); - rc = md_sync(lmv->tgts[id_group(id)].ltd_exp, - id, request); + i = lmv_fld_lookup(obd, fid); + rc = md_sync(lmv->tgts[i].ltd_exp, + fid, request); RETURN(rc); } @@ -1576,12 +1590,12 @@ int lmv_dirobj_blocking_ast(struct ldlm_lock *lock, obj = lock->l_ast_data; if (obj) { CDEBUG(D_OTHER, "cancel %s on "LPU64"/"LPU64 - ", master "DLID4"\n", + ", master "DFID3"\n", lock->l_resource->lr_name.name[3] == 1 ? "LOOKUP" : "UPDATE", lock->l_resource->lr_name.name[0], lock->l_resource->lr_name.name[1], - OLID4(&obj->id)); + PFID3(&obj->lo_fid)); lmv_put_obj(obj); } break; @@ -1608,13 +1622,13 @@ static void lmv_remove_dots(struct page *page) } } -static int lmv_readpage(struct obd_export *exp, struct lustre_id *id, +static int lmv_readpage(struct obd_export *exp, struct lu_fid *fid, __u64 offset, struct page *page, struct ptlrpc_request **request) { struct obd_device *obd = exp->exp_obd; struct lmv_obd *lmv = &obd->u.lmv; - struct lustre_id rid = *id; + struct lu_fid rid = *fid; struct lmv_obj *obj; int rc, i; ENTRY; @@ -1623,11 +1637,12 @@ static int lmv_readpage(struct obd_export *exp, struct lustre_id *id, if (rc) RETURN(rc); - LASSERT(id_group(id) < lmv->desc.ld_tgt_count); - CDEBUG(D_OTHER, "READPAGE at %llu from "DLID4"\n", - offset, OLID4(&rid)); + i = lmv_fld_lookup(obd, fid); + LASSERT(i < lmv->desc.ld_tgt_count); + CDEBUG(D_OTHER, "READPAGE at %llu from "DFID3"\n", + offset, PFID3(&rid)); - obj = lmv_grab_obj(obd, id); + obj = lmv_grab_obj(obd, fid); if (obj) { lmv_lock_obj(obj); @@ -1637,18 +1652,19 @@ static int lmv_readpage(struct obd_export *exp, struct lustre_id *id, break; offset -= obj->objs[i].size; } - rid = obj->objs[i].id; + rid = obj->objs[i].lo_fid; lmv_unlock_obj(obj); lmv_put_obj(obj); - CDEBUG(D_OTHER, "forward to "DLID4" with offset %lu\n", - OLID4(&rid), (unsigned long)offset); + CDEBUG(D_OTHER, "forward to "DFID3" with offset %lu\n", + PFID3(&rid), (unsigned long)offset); } - rc = md_readpage(lmv->tgts[id_group(&rid)].ltd_exp, &rid, + i = lmv_fld_lookup(obd, rid); + rc = md_readpage(lmv->tgts[i].ltd_exp, &rid, offset, page, request); - if (rc == 0 && !id_equal_fid(&rid, id)) + if (rc == 0 && !fid_equals(&rid, fid)) /* this page isn't from master object. To avoid "." and ".." * duplication in directory, we have to remove them from all * slave objects */ @@ -1664,7 +1680,7 @@ static int lmv_unlink_slaves(struct obd_export *exp, struct mdc_op_data *data, struct lmv_obd *lmv = &obd->u.lmv; struct mea *mea = data->mea1; struct mdc_op_data *data2; - int i, rc = 0; + int i, mds, rc = 0; ENTRY; OBD_ALLOC(data2, sizeof(*data2)); @@ -1674,17 +1690,18 @@ static int lmv_unlink_slaves(struct obd_export *exp, struct mdc_op_data *data, LASSERT(mea != NULL); for (i = 0; i < mea->mea_count; i++) { memset(data2, 0, sizeof(*data2)); - data2->id1 = mea->mea_ids[i]; + data2->fid1 = mea->mea_ids[i]; data2->create_mode = MDS_MODE_DONT_LOCK | S_IFDIR; - if (lmv->tgts[id_group(&data2->id1)].ltd_exp == NULL) + mds = lmv_fld_lookup(obd, &data2->fid1); + if (lmv->tgts[mds].ltd_exp == NULL) continue; - rc = md_unlink(lmv->tgts[id_group(&data2->id1)].ltd_exp, + rc = md_unlink(lmv->tgts[mds].ltd_exp, data2, req); - CDEBUG(D_OTHER, "unlink slave "DLID4" -> %d\n", - OLID4(&mea->mea_ids[i]), rc); + CDEBUG(D_OTHER, "unlink slave "DFID3" -> %d\n", + PFID3(&mea->mea_ids[i]), rc); if (*req) { ptlrpc_req_finished(*req); @@ -1697,14 +1714,14 @@ static int lmv_unlink_slaves(struct obd_export *exp, struct mdc_op_data *data, RETURN(rc); } -static int lmv_delete_inode(struct obd_export *exp, struct lustre_id *id) +static int lmv_delete_inode(struct obd_export *exp, struct lu_fid *fid) { ENTRY; - LASSERT(exp && id); - if (lmv_delete_obj(exp, id)) { - CDEBUG(D_OTHER, "lmv object "DLID4" is destroyed.\n", - OLID4(id)); + LASSERT(exp && fid); + if (lmv_delete_obj(exp, fid)) { + CDEBUG(D_OTHER, "lmv object "DFID3" is destroyed.\n", + PFID3(id)); } RETURN(0); } @@ -1730,37 +1747,38 @@ static int lmv_unlink(struct obd_export *exp, struct mdc_op_data *data, if (data->namelen != 0) { struct lmv_obj *obj; - obj = lmv_grab_obj(obd, &data->id1); + obj = lmv_grab_obj(obd, &data->fid1); if (obj) { i = raw_name2idx(obj->hashtype, obj->objcount, data->name, data->namelen); - data->id1 = obj->objs[i].id; + data->fid1 = obj->objs[i].lo_fid; lmv_put_obj(obj); } - CDEBUG(D_OTHER, "unlink '%*s' in "DLID4" -> %u\n", - data->namelen, data->name, OLID4(&data->id1), + CDEBUG(D_OTHER, "unlink '%*s' in "DFID3" -> %u\n", + data->namelen, data->name, PFID3(&data->fid1), i); } else { - CDEBUG(D_OTHER, "drop i_nlink on "DLID4"\n", - OLID4(&data->id1)); + CDEBUG(D_OTHER, "drop i_nlink on "DFID3"\n", + PFID3(&data->fid1)); } - rc = md_unlink(lmv->tgts[id_group(&data->id1)].ltd_exp, - data, request); + i = lmv_fld_lookup(obd, &data->fid1); + rc = md_unlink(lmv->tgts[i].ltd_exp, data, request); RETURN(rc); } static struct obd_device *lmv_get_real_obd(struct obd_export *exp, - struct lustre_id *id) + struct lu_fid *fid) { struct obd_device *obd = exp->exp_obd; struct lmv_obd *lmv = &obd->u.lmv; - int rc; + int rc, i; ENTRY; rc = lmv_check_connect(obd); if (rc) RETURN(ERR_PTR(rc)); - obd = lmv->tgts[id_group(id)].ltd_exp->exp_obd; + i = lmv_fld_lookup(obd, fid); + obd = lmv->tgts[i].ltd_exp->exp_obd; EXIT; return obd; @@ -1797,7 +1815,7 @@ int lmv_obd_create(struct obd_export *exp, struct obdo *oa, { struct obd_device *obd = exp->exp_obd; struct lmv_obd *lmv = &obd->u.lmv; - struct lustre_id mid; + struct lu_fid mid; int i, c, rc = 0; struct mea *mea; ENTRY; @@ -1964,7 +1982,7 @@ static int lmv_get_info(struct obd_export *exp, __u32 keylen, if (keylen == strlen("mdsize") && !strcmp(key, "mdsize")) { __u32 *mdsize = val; *vallen = sizeof(__u32); - *mdsize = sizeof(struct lustre_id) * lmv->desc.ld_tgt_count + *mdsize = sizeof(struct lu_fid) * lmv->desc.ld_tgt_count + sizeof(struct mea); RETURN(0); } else if (keylen == strlen("mdsnum") && !strcmp(key, "mdsnum")) { @@ -2139,13 +2157,15 @@ int lmv_set_info(struct obd_export *exp, obd_count keylen, } if (keylen == strlen("ids") && memcmp(key, "ids", keylen) == 0) { - struct lustre_id *id = (struct lustre_id *)val; + struct lu_fid *fid = (struct lu_fid *)val; + int i; rc = lmv_check_connect(obd); if (rc) RETURN(rc); - rc = obd_set_info(lmv->tgts[id_group(id)].ltd_exp, + i = lmv_fld_lookup(obd, fid); + rc = obd_set_info(lmv->tgts[i].ltd_exp, keylen, key, vallen, val); RETURN(rc); } @@ -2168,7 +2188,7 @@ int lmv_packmd(struct obd_export *exp, struct lov_mds_md **lmmp, int mea_size, i; ENTRY; - mea_size = (sizeof(struct lustre_id) * + mea_size = (sizeof(struct lu_fid) * lmv->desc.ld_tgt_count) + sizeof(struct mea); if (!lmmp) RETURN(mea_size); @@ -2218,7 +2238,7 @@ int lmv_unpackmd(struct obd_export *exp, struct lov_stripe_md **lsmp, __u32 magic; ENTRY; - mea_size = sizeof(struct lustre_id) * + mea_size = sizeof(struct lu_fid) * lmv->desc.ld_tgt_count + sizeof(struct mea); if (lsmp == NULL) @@ -2245,7 +2265,7 @@ int lmv_unpackmd(struct obd_export *exp, struct lov_stripe_md **lsmp, } else { struct mea_old *old = (struct mea_old *)lmm; - mea_size = sizeof(struct lustre_id) * old->mea_count + + mea_size = sizeof(struct lu_fid) * old->mea_count + sizeof(struct mea_old); if (old->mea_count > 256 || old->mea_master > 256 || diff --git a/lustre/lmv/lmv_objmgr.c b/lustre/lmv/lmv_objmgr.c index 78f21fb..ca72df3 100644 --- a/lustre/lmv/lmv_objmgr.c +++ b/lustre/lmv/lmv_objmgr.c @@ -40,11 +40,8 @@ #include #include #include -//#include #include -//#include #include -//#include #include "lmv_internal.h" /* objects cache. */ @@ -58,7 +55,7 @@ static spinlock_t obj_list_lock = SPIN_LOCK_UNLOCKED; /* creates new obj on passed @id and @mea. */ struct lmv_obj * lmv_alloc_obj(struct obd_device *obd, - struct lustre_id *id, + struct lu_fid *fid, struct mea *mea) { int i; @@ -76,7 +73,7 @@ lmv_alloc_obj(struct obd_device *obd, atomic_inc(&obj_cache_count); - obj->id = *id; + obj->lo_fid = *fid; obj->obd = obd; obj->state = 0; obj->hashtype = mea->mea_magic; @@ -96,11 +93,10 @@ lmv_alloc_obj(struct obd_device *obd, /* put all ids in */ for (i = 0; i < mea->mea_count; i++) { - CDEBUG(D_OTHER, "subobj "DLID4"\n", - OLID4(&mea->mea_ids[i])); + CDEBUG(D_OTHER, "subobj "DFID3"\n", + PFID3(&mea->mea_ids[i])); obj->objs[i].id = mea->mea_ids[i]; - LASSERT(id_ino(&obj->objs[i].id)); - LASSERT(id_fid(&obj->objs[i].id)); + LASSERT(fid_num(&obj->objs[i].lo_fid)); } return obj; @@ -180,9 +176,9 @@ __put_obj(struct lmv_obj *obj) LASSERT(obj); if (atomic_dec_and_test(&obj->count)) { - struct lustre_id *id = &obj->id; - CDEBUG(D_OTHER, "last reference to "DLID4" - " - "destroying\n", OLID4(id)); + struct lu_fid *fid = &obj->lo_fid; + CDEBUG(D_OTHER, "last reference to "DFID3" - " + "destroying\n", PFID3(id)); __del_obj(obj); } } @@ -196,7 +192,7 @@ lmv_put_obj(struct lmv_obj *obj) } static struct lmv_obj * -__grab_obj(struct obd_device *obd, struct lustre_id *id) +__grab_obj(struct obd_device *obd, struct lu_fid *fid) { struct lmv_obj *obj; struct list_head *cur; @@ -220,7 +216,7 @@ __grab_obj(struct obd_device *obd, struct lustre_id *id) continue; /* check if this is what we're looking for. */ - if (id_equal_fid(&obj->id, id)) + if (fid_equals(&obj->lo_fid, fid)) return __get_obj(obj); } @@ -228,13 +224,13 @@ __grab_obj(struct obd_device *obd, struct lustre_id *id) } struct lmv_obj * -lmv_grab_obj(struct obd_device *obd, struct lustre_id *id) +lmv_grab_obj(struct obd_device *obd, struct lu_fid *fid) { struct lmv_obj *obj; ENTRY; spin_lock(&obj_list_lock); - obj = __grab_obj(obd, id); + obj = __grab_obj(obd, fid); spin_unlock(&obj_list_lock); RETURN(obj); @@ -243,7 +239,7 @@ lmv_grab_obj(struct obd_device *obd, struct lustre_id *id) /* looks in objects list for an object that matches passed @id. If it is not * found -- creates it using passed @mea and puts onto list. */ static struct lmv_obj * -__create_obj(struct obd_device *obd, struct lustre_id *id, struct mea *mea) +__create_obj(struct obd_device *obd, struct lu_fid *fid, struct mea *mea) { struct lmv_obj *new, *obj; ENTRY; @@ -273,8 +269,8 @@ __create_obj(struct obd_device *obd, struct lustre_id *id, struct mea *mea) spin_unlock(&obj_list_lock); - CDEBUG(D_OTHER, "new obj in lmv cache: "DLID4"\n", - OLID4(id)); + CDEBUG(D_OTHER, "new obj in lmv cache: "DFID3"\n", + PFID3(id)); RETURN(new); @@ -283,18 +279,18 @@ __create_obj(struct obd_device *obd, struct lustre_id *id, struct mea *mea) /* creates object from passed @id and @mea. If @mea is NULL, it will be * obtained from correct MDT and used for constructing the object. */ struct lmv_obj * -lmv_create_obj(struct obd_export *exp, struct lustre_id *id, struct mea *mea) +lmv_create_obj(struct obd_export *exp, struct lu_fid *fid, struct mea *mea) { struct obd_device *obd = exp->exp_obd; struct lmv_obd *lmv = &obd->u.lmv; struct ptlrpc_request *req = NULL; struct lmv_obj *obj; struct lustre_md md; - int mealen, rc; + int mealen, rc, mds; ENTRY; - CDEBUG(D_OTHER, "get mea for "DLID4" and create lmv obj\n", - OLID4(id)); + CDEBUG(D_OTHER, "get mea for "DFID3" and create lmv obj\n", + PFID3(id)); md.mea = NULL; @@ -308,8 +304,10 @@ lmv_create_obj(struct obd_export *exp, struct lustre_id *id, struct mea *mea) md.mea = NULL; valid = OBD_MD_FLEASIZE | OBD_MD_FLDIREA | OBD_MD_MEA; - rc = md_getattr(lmv->tgts[id_group(id)].ltd_exp, - id, valid, NULL, NULL, 0, mealen, NULL, &req); + mds = lmv_fld_lookup(obd, fid); + + rc = md_getattr(lmv->tgts[mds].ltd_exp, + fid, valid, NULL, NULL, 0, mealen, NULL, &req); if (rc) { CERROR("md_getattr() failed, error %d\n", rc); GOTO(cleanup, obj = ERR_PTR(rc)); @@ -330,8 +328,8 @@ lmv_create_obj(struct obd_export *exp, struct lustre_id *id, struct mea *mea) /* got mea, now create obj for it. */ obj = __create_obj(obd, id, mea); if (!obj) { - CERROR("Can't create new object "DLID4"\n", - OLID4(id)); + CERROR("Can't create new object "DFID3"\n", + PFID3(id)); GOTO(cleanup, obj = ERR_PTR(-ENOMEM)); } @@ -352,7 +350,7 @@ cleanup: * for subsequent callers of lmv_grab_obj(). */ int -lmv_delete_obj(struct obd_export *exp, struct lustre_id *id) +lmv_delete_obj(struct obd_export *exp, struct lu_fid *fid) { struct obd_device *obd = exp->exp_obd; struct lmv_obj *obj; @@ -403,8 +401,8 @@ lmv_cleanup_mgr(struct obd_device *obd) obj->state |= O_FREEING; if (atomic_read(&obj->count) > 1) { - CERROR("obj "DLID4" has count > 1 (%d)\n", - OLID4(&obj->id), atomic_read(&obj->count)); + CERROR("obj "DFID3" has count > 1 (%d)\n", + PFID3(&obj->lo_fid), atomic_read(&obj->count)); } __put_obj(obj); } diff --git a/lustre/mgs/mgs_fs.c b/lustre/mgs/mgs_fs.c index d18bae1..8100bbe 100644 --- a/lustre/mgs/mgs_fs.c +++ b/lustre/mgs/mgs_fs.c @@ -97,8 +97,8 @@ static struct dentry *mgs_fid2dentry(struct mgs_obd *mgs, RETURN(result); } -static struct dentry *mgs_lvfs_fid2dentry(__u64 id, __u32 gen, __u64 gr, - void *data) +static struct dentry *mgs_lvfs_fid2dentry(__u64 id, __u32 gen, + __u64 gr, void *data) { struct obd_device *obd = data; return mgs_fid2dentry(&obd->u.mgs, id, gen);