1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 * Copyright (c) 2003 Cluster File Systems, Inc.
6 * This file is part of Lustre, http://www.lustre.org.
8 * Lustre is free software; you can redistribute it and/or
9 * modify it under the terms of version 2 of the GNU General Public
10 * License as published by the Free Software Foundation.
12 * Lustre is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Lustre; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #ifndef MDC_INTERNAL_H
22 #define MDC_INTERNAL_H
24 void mdc_getattr_pack(struct lustre_msg *msg, int valid, int offset,
25 int flags, struct mdc_op_data *data);
26 void mdc_open_pack(struct lustre_msg *msg, int offset,
27 struct mdc_op_data *op_data, __u32 mode, __u64 rdev,
28 __u32 flags, const void *lmm, int lmmlen);
29 void mdc_pack_req_body(struct ptlrpc_request *);
30 void mdc_pack_rep_body(struct ptlrpc_request *);
31 void mdc_readdir_pack(struct ptlrpc_request *req, __u64 offset, __u32 size,
32 struct ll_fid *mdc_fid);
33 void mdc_close_pack(struct ptlrpc_request *req, int offset, struct obdo *oa,
34 int valid, struct obd_client_handle *och);
36 struct mdc_open_data {
37 struct obd_client_handle *mod_och;
38 struct ptlrpc_request *mod_open_req;
39 struct ptlrpc_request *mod_close_req;
43 struct semaphore rpcl_sem;
44 struct lookup_intent *rpcl_it;
47 static inline void mdc_init_rpc_lock(struct mdc_rpc_lock *lck)
49 sema_init(&lck->rpcl_sem, 1);
53 static inline void mdc_get_rpc_lock(struct mdc_rpc_lock *lck,
54 struct lookup_intent *it)
63 static inline void mdc_put_rpc_lock(struct mdc_rpc_lock *lck,
64 struct lookup_intent *it)
68 LASSERT(it == lck->rpcl_it);
73 LASSERT(it == lck->rpcl_it);
79 #endif /* MDC_INTERNAL_H */