1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 * lustre/cmm/cmm_internal.h
5 * Lustre Cluster Metadata Manager (cmm),
8 * Copyright (C) 2006 Cluster File Systems, Inc.
9 * Author: Mike Pershin <tappro@clusterfs.com>
11 * This file is part of the Lustre file system, http://www.lustre.org
12 * Lustre is a trademark of Cluster File Systems, Inc.
14 * You may have signed or agreed to another license before downloading
15 * this software. If so, you are bound by the terms and conditions
16 * of that agreement, and the following does not apply to you. See the
17 * LICENSE file included with this distribution for more information.
19 * If you did not agree to a different license, then this copy of Lustre
20 * is open source software; you can redistribute it and/or modify it
21 * under the terms of version 2 of the GNU General Public License as
22 * published by the Free Software Foundation.
24 * In either case, Lustre is distributed in the hope that it will be
25 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
26 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 * license text for more details.
30 #ifndef _CMM_MDC_INTERNAL_H
31 #define _CMM_MDC_INTERNAL_H
33 #if defined(__KERNEL__)
35 #include <lustre_net.h>
37 #include <md_object.h>
40 struct lustre_handle cl_conn;
41 /* uuid of remote MDT to connect */
42 struct obd_uuid cl_srv_uuid;
44 struct obd_uuid cl_cli_uuid;
45 /* export of mdc obd */
46 struct obd_export *cl_exp;
50 struct md_device mc_md_dev;
51 /* other MD servers in cluster */
52 struct list_head mc_linkage;
54 struct mdc_cli_desc mc_desc;
57 struct mdc_thread_info {
58 struct md_op_data mci_opdata;
59 struct ptlrpc_request *mci_req;
63 struct md_object mco_obj;
66 static inline struct lu_device *mdc2lu_dev(struct mdc_device *mc)
68 return (&mc->mc_md_dev.md_lu_dev);
71 static inline struct mdc_device *md2mdc_dev(struct md_device *md)
73 return container_of0(md, struct mdc_device, mc_md_dev);
76 static inline struct mdc_device *mdc_obj2dev(struct mdc_object *mco)
78 return (md2mdc_dev(md_obj2dev(&mco->mco_obj)));
81 static inline struct mdc_object *lu2mdc_obj(struct lu_object *lo)
83 return container_of0(lo, struct mdc_object, mco_obj.mo_lu);
86 static inline struct mdc_object *md2mdc_obj(struct md_object *mo)
88 return container_of0(mo, struct mdc_object, mco_obj);
91 static inline struct mdc_device *lu2mdc_dev(struct lu_device *ld)
93 return container_of0(ld, struct mdc_device, mc_md_dev.md_lu_dev);
96 struct lu_object *mdc_object_alloc(const struct lu_env *,
97 const struct lu_object_header *,
100 void mdc_init_ea_size(const struct lu_env *env, struct mdc_device *mc,
101 int max_mdsize, int max_cookiesize);
102 #ifdef HAVE_SPLIT_SUPPORT
103 int mdc_send_page(struct cmm_device *cmm, const struct lu_env *env,
104 struct md_object *mo, struct page *page, __u32 end);
107 #endif /* __KERNEL__ */
108 #endif /* _CMM_MDC_INTERNAL_H */