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__)
29 #include <md_object.h>
32 struct obd_connect_data cl_conn_data;
33 struct obd_uuid cl_srv_uuid;
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 md_object mco_obj;
50 static inline struct lu_device *mdc2lu_dev(struct mdc_device *mc)
52 return (&mc->mc_md_dev.md_lu_dev);
55 static inline struct mdc_device *md2mdc_dev(struct md_device *md)
57 return container_of0(md, struct mdc_device, mc_md_dev);
60 static inline struct mdc_device *mdc_obj2dev(struct mdc_object *mco)
62 return (md2mdc_dev(md_device_get(&mco->mco_obj)));
65 static inline struct mdc_object *lu2mdc_obj(struct lu_object *lo)
67 return container_of0(lo, struct mdc_object, mco_obj.mo_lu);
70 static inline struct mdc_object *md2mdc_obj(struct md_object *mo)
72 return container_of0(mo, struct mdc_object, mco_obj);
75 static inline struct mdc_device *lu2mdc_dev(struct lu_device *ld)
77 return container_of0(ld, struct mdc_device, mc_md_dev.md_lu_dev);
80 int mdc_object_init(const struct lu_context *, struct lu_object*);
81 struct lu_object *mdc_object_alloc(const struct lu_context *,
83 void mdc_object_free(const struct lu_context *, struct lu_object *);
84 void mdc_object_release(const struct lu_context *, struct lu_object *);
86 #endif /* __KERNEL__ */
87 #endif /* _CMM_MDC_INTERNAL_H */