1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 * This file is part of Lustre, http://www.lustre.org
6 * MDC internal definitions.
9 #include <lustre_mds.h>
11 void lprocfs_mdc_init_vars(struct lprocfs_static_vars *lvars);
13 static inline void lprocfs_mdc_init_vars(struct lprocfs_static_vars *lvars)
15 memset(lvars, 0, sizeof(*lvars));
18 void mdc_pack_req_body(struct ptlrpc_request *req, int offset,
19 __u64 valid, struct ll_fid *fid, int ea_size, int flags);
20 void mdc_pack_rep_body(struct ptlrpc_request *);
21 void mdc_readdir_pack(struct ptlrpc_request *req, int offset, __u64 pg_off,
22 __u32 size, struct ll_fid *mdc_fid);
23 void mdc_getattr_pack(struct ptlrpc_request *req, int offset, __u64 valid,
24 int flags, struct mdc_op_data *data);
25 void mdc_setattr_pack(struct ptlrpc_request *req, int offset,
26 struct mdc_op_data *data,
27 struct iattr *iattr, void *ea, int ealen,
28 void *ea2, int ea2len);
29 void mdc_create_pack(struct ptlrpc_request *req, int offset,
30 struct mdc_op_data *op_data, const void *data, int datalen,
31 __u32 mode, __u32 uid, __u32 gid, __u32 cap_effective,
33 void mdc_open_pack(struct ptlrpc_request *req, int offset,
34 struct mdc_op_data *op_data, __u32 mode, __u64 rdev,
35 __u32 flags, const void *data, int datalen);
36 void mdc_join_pack(struct ptlrpc_request *req, int offset,
37 struct mdc_op_data *op_data, __u64 head_size);
38 void mdc_unlink_pack(struct ptlrpc_request *req, int offset,
39 struct mdc_op_data *data);
40 void mdc_link_pack(struct ptlrpc_request *req, int offset,
41 struct mdc_op_data *data);
42 void mdc_rename_pack(struct ptlrpc_request *req, int offset,
43 struct mdc_op_data *data,
44 const char *old, int oldlen, const char *new, int newlen);
45 void mdc_close_pack(struct ptlrpc_request *req, int offset, struct obdo *oa,
46 __u64 valid, struct obd_client_handle *och);
47 void mdc_exit_request(struct client_obd *cli);
48 void mdc_enter_request(struct client_obd *cli);
50 struct mdc_open_data {
51 struct obd_client_handle *mod_och;
52 struct ptlrpc_request *mod_open_req;
53 struct ptlrpc_request *mod_close_req;
57 struct semaphore rpcl_sem;
58 struct lookup_intent *rpcl_it;
61 static inline void mdc_init_rpc_lock(struct mdc_rpc_lock *lck)
63 sema_init(&lck->rpcl_sem, 1);
67 static inline void mdc_get_rpc_lock(struct mdc_rpc_lock *lck,
68 struct lookup_intent *it)
71 if (!it || (it->it_op != IT_GETATTR && it->it_op != IT_LOOKUP)) {
73 LASSERT(lck->rpcl_it == NULL);
78 static inline void mdc_put_rpc_lock(struct mdc_rpc_lock *lck,
79 struct lookup_intent *it)
81 if (!it || (it->it_op != IT_GETATTR && it->it_op != IT_LOOKUP)) {
82 LASSERT(it == lck->rpcl_it);