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;
55 struct semaphore mc_fid_sem;
58 struct mdc_thread_info {
59 struct md_op_data mci_opdata;
60 struct ptlrpc_request *mci_req;
64 struct md_object mco_obj;
67 static inline struct lu_device *mdc2lu_dev(struct mdc_device *mc)
69 return (&mc->mc_md_dev.md_lu_dev);
72 static inline struct mdc_device *md2mdc_dev(struct md_device *md)
74 return container_of0(md, struct mdc_device, mc_md_dev);
77 static inline struct mdc_device *mdc_obj2dev(struct mdc_object *mco)
79 return (md2mdc_dev(md_obj2dev(&mco->mco_obj)));
82 static inline struct mdc_object *lu2mdc_obj(struct lu_object *lo)
84 return container_of0(lo, struct mdc_object, mco_obj.mo_lu);
87 static inline struct mdc_object *md2mdc_obj(struct md_object *mo)
89 return container_of0(mo, struct mdc_object, mco_obj);
92 static inline struct mdc_device *lu2mdc_dev(struct lu_device *ld)
94 return container_of0(ld, struct mdc_device, mc_md_dev.md_lu_dev);
97 struct lu_object *mdc_object_alloc(const struct lu_env *,
98 const struct lu_object_header *,
101 void mdc_init_ea_size(const struct lu_env *env, struct mdc_device *mc,
102 int max_mdsize, int max_cookiesize);
103 #ifdef HAVE_SPLIT_SUPPORT
104 int mdc_send_page(struct cmm_device *cmm, const struct lu_env *env,
105 struct md_object *mo, struct page *page, __u32 end);
108 #endif /* __KERNEL__ */
109 #endif /* _CMM_MDC_INTERNAL_H */