1 #ifndef _LMV_INTERNAL_H_
2 #define _LMV_INTERNAL_H_
4 #define LL_IT2STR(it) \
5 ((it) ? ldlm_it2str((it)->it_op) : "0")
7 #define MEA_SIZE_LMV(lmv) \
8 ((lmv)->desc.ld_tgt_count * \
9 sizeof(struct ll_fid) + sizeof(struct mea))
12 struct ll_fid fid; /* fid of dirobj */
13 unsigned long size; /* slave size value */
17 #define O_FREEING (1 << 0)
20 struct list_head list;
21 struct semaphore guard;
22 int state; /* object state. */
23 atomic_t count; /* ref counter. */
24 struct ll_fid fid; /* master fid of dir */
25 void *update; /* bitmap of status (uptodate) */
26 int objcount; /* number of slaves */
27 struct lmv_inode *objs; /* array of dirobjs */
28 struct obd_device *obd; /* pointer to LMV itself */
36 lmv_lock_obj(struct lmv_obj *obj)
43 lmv_unlock_obj(struct lmv_obj *obj)
49 void lmv_add_obj(struct lmv_obj *obj);
50 void lmv_del_obj(struct lmv_obj *obj);
52 void lmv_put_obj(struct lmv_obj *obj);
53 void lmv_free_obj(struct lmv_obj *obj);
55 int lmv_setup_mgr(struct obd_device *obd);
56 void lmv_cleanup_mgr(struct obd_device *obd);
57 int lmv_check_connect(struct obd_device *obd);
59 struct lmv_obj *lmv_get_obj(struct lmv_obj *obj);
61 struct lmv_obj *lmv_grab_obj(struct obd_device *obd,
64 struct lmv_obj *lmv_alloc_obj(struct obd_device *obd,
68 struct lmv_obj *lmv_create_obj(struct obd_export *exp,
72 int lmv_delete_obj(struct obd_export *exp, struct ll_fid *fid);
74 int lmv_intent_lock(struct obd_export *, struct ll_uctxt *,
75 struct ll_fid *, const char *, int, void *, int,
76 struct ll_fid *, struct lookup_intent *, int,
77 struct ptlrpc_request **, ldlm_blocking_callback);
79 int lmv_intent_lookup(struct obd_export *, struct ll_uctxt *,
80 struct ll_fid *, const char *, int, void *, int,
81 struct ll_fid *, struct lookup_intent *, int,
82 struct ptlrpc_request **, ldlm_blocking_callback);
84 int lmv_intent_getattr(struct obd_export *, struct ll_uctxt *,
85 struct ll_fid *, const char *, int, void *, int,
86 struct ll_fid *, struct lookup_intent *, int,
87 struct ptlrpc_request **, ldlm_blocking_callback);
89 int lmv_intent_open(struct obd_export *, struct ll_uctxt *,
90 struct ll_fid *, const char *, int, void *, int,
91 struct ll_fid *, struct lookup_intent *, int,
92 struct ptlrpc_request **, ldlm_blocking_callback);
94 int lmv_revalidate_slaves(struct obd_export *, struct ptlrpc_request **,
95 struct ll_fid *, struct lookup_intent *, int,
96 ldlm_blocking_callback cb_blocking);
98 int lmv_get_mea_and_update_object(struct obd_export *, struct ll_fid *);
99 int lmv_dirobj_blocking_ast(struct ldlm_lock *, struct ldlm_lock_desc *,
102 static inline struct mea *
103 body_of_splitted_dir(struct ptlrpc_request *req, int offset)
105 struct mds_body *body;
110 body = lustre_msg_buf(req->rq_repmsg, offset, sizeof(*body));
112 if (!body || !S_ISDIR(body->mode) || !body->eadatasize)
115 mea = lustre_msg_buf(req->rq_repmsg,
116 offset + 1, body->eadatasize);
119 if (mea->mea_count == 0)
126 fid_equal(struct ll_fid *fid1, struct ll_fid *fid2)
128 if (fid1->mds != fid2->mds)
130 if (fid1->id != fid2->id)
132 if (fid1->generation != fid2->generation)