1 #ifndef _LMV_INTERNAL_H_
2 #define _LMV_INTERNAL_H_
4 #define LL_IT2STR(it) ((it) ? ldlm_it2str((it)->it_op) : "0")
5 #define MEA_SIZE_LMV(lmv) \
6 ((lmv)->desc.ld_tgt_count * sizeof(struct ll_fid) + sizeof(struct mea))
9 struct ll_fid fid; /* fid of dirobj */
15 struct list_head list;
17 struct ll_fid fid; /* master fid of dir */
18 void *update; /* bitmap of status (uptodate) */
20 struct lmv_inode *objs; /* array of dirobjs */
21 struct obd_device *obd; /* pointer to LMV itself */
24 int lmv_dirobj_blocking_ast(struct ldlm_lock *,
25 struct ldlm_lock_desc *,
28 void lmv_put_obj(struct lmv_obj *obj);
29 struct lmv_obj *lmv_get_obj(struct lmv_obj *obj);
31 int lmv_setup_mgr(struct obd_device *obd);
32 void lmv_cleanup_mgr(struct obd_device *obd);
34 struct lmv_obj *lmv_grab_obj(struct obd_device *obd,
37 int lmv_create_obj(struct obd_export *exp, struct ll_fid *fid,
40 int lmv_intent_lock(struct obd_export *, struct ll_uctxt *,
41 struct ll_fid *, const char *, int, void *, int,
42 struct ll_fid *, struct lookup_intent *, int,
43 struct ptlrpc_request **, ldlm_blocking_callback);
44 int lmv_intent_lookup(struct obd_export *, struct ll_uctxt *,
45 struct ll_fid *, const char *, int, void *, int,
46 struct ll_fid *, struct lookup_intent *, int,
47 struct ptlrpc_request **, ldlm_blocking_callback);
48 int lmv_intent_getattr(struct obd_export *, struct ll_uctxt *,
49 struct ll_fid *, const char *, int, void *, int,
50 struct ll_fid *, struct lookup_intent *, int,
51 struct ptlrpc_request **, ldlm_blocking_callback);
52 int lmv_intent_open(struct obd_export *, struct ll_uctxt *,
53 struct ll_fid *, const char *, int, void *, int,
54 struct ll_fid *, struct lookup_intent *, int,
55 struct ptlrpc_request **, ldlm_blocking_callback);
57 int lmv_check_connect(struct obd_device *obd);
58 int lmv_revalidate_slaves(struct obd_export *, struct ptlrpc_request **,
59 struct ll_fid *, struct lookup_intent *, int,
60 ldlm_blocking_callback cb_blocking);
62 int lmv_get_mea_and_update_object(struct obd_export *, struct ll_fid *);
64 static inline struct mea *
65 is_body_of_splitted_dir(struct ptlrpc_request *req, int offset)
67 struct mds_body *body;
72 body = lustre_msg_buf(req->rq_repmsg, offset, sizeof(*body));
74 if (!body || !S_ISDIR(body->mode) || !body->eadatasize)
77 mea = lustre_msg_buf(req->rq_repmsg, offset + 1, body->eadatasize);
80 if (mea->mea_count == 0)
86 static inline int fid_equal(struct ll_fid *fid1, struct ll_fid *fid2)
88 if (fid1->mds != fid2->mds)
90 if (fid1->id != fid2->id)
92 if (fid1->generation != fid2->generation)