1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 * Copyright (C) 2006 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.
23 #ifndef _CMM_MDC_INTERNAL_H
24 #define _CMM_MDC_INTERNAL_H
26 #if defined(__KERNEL__)
28 #include <lustre_net.h>
30 #include <md_object.h>
33 struct obd_connect_data cl_conn_data;
34 struct obd_uuid cl_cli_uuid;
35 struct obd_export *cl_exp;
39 struct md_device mc_md_dev;
40 /* other MD servers in cluster */
41 struct list_head mc_linkage;
43 struct mdc_cli_desc mc_desc;
47 struct mdc_thread_info {
48 const struct lu_context *mci_ctxt;
49 struct md_op_data mci_opdata;
50 struct ptlrpc_request *mci_req;
55 struct md_object mco_obj;
58 static inline struct lu_device *mdc2lu_dev(struct mdc_device *mc)
60 return (&mc->mc_md_dev.md_lu_dev);
63 static inline struct mdc_device *md2mdc_dev(struct md_device *md)
65 return container_of0(md, struct mdc_device, mc_md_dev);
68 static inline struct mdc_device *mdc_obj2dev(struct mdc_object *mco)
70 return (md2mdc_dev(md_device_get(&mco->mco_obj)));
73 static inline struct mdc_object *lu2mdc_obj(struct lu_object *lo)
75 return container_of0(lo, struct mdc_object, mco_obj.mo_lu);
78 static inline struct mdc_object *md2mdc_obj(struct md_object *mo)
80 return container_of0(mo, struct mdc_object, mco_obj);
83 static inline struct mdc_device *lu2mdc_dev(struct lu_device *ld)
85 return container_of0(ld, struct mdc_device, mc_md_dev.md_lu_dev);
88 struct lu_object *mdc_object_alloc(const struct lu_context *,
89 const struct lu_object_header *,
91 #endif /* __KERNEL__ */
92 #endif /* _CMM_MDC_INTERNAL_H */