Whamcloud - gitweb
c98aefa9174890fbfcc118c86d337a6ab15ed3d7
[fs/lustre-release.git] / lustre / mds / mds_internal.h
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  * GPL HEADER START
5  *
6  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License version 2 only,
10  * as published by the Free Software Foundation.
11  *
12  * This program is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * General Public License version 2 for more details (a copy is included
16  * in the LICENSE file that accompanied this code).
17  *
18  * You should have received a copy of the GNU General Public License
19  * version 2 along with this program; If not, see
20  * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
21  *
22  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
23  * CA 95054 USA or visit www.sun.com if you need additional information or
24  * have any questions.
25  *
26  * GPL HEADER END
27  */
28 /*
29  * Copyright  2008 Sun Microsystems, Inc. All rights reserved
30  * Use is subject to license terms.
31  */
32 /*
33  * This file is part of Lustre, http://www.lustre.org/
34  * Lustre is a trademark of Sun Microsystems, Inc.
35  */
36
37 #ifndef _MDS_INTERNAL_H
38 #define _MDS_INTERNAL_H
39
40 #include <lustre_disk.h>
41 #include <lustre_mds.h>
42
43 int mds_cleanup_pending(struct obd_device *obd);
44
45
46 /* mds/mds_log.c */
47 int mds_llog_init(struct obd_device *obd, struct obd_llog_group *olg,
48                   struct obd_device *tgt, int count,
49                   struct llog_catid *logid, struct obd_uuid *uuid);
50 int mds_llog_finish(struct obd_device *obd, int count);
51
52 /* mds/mds_lov.c */
53 int mds_lov_connect(struct obd_device *obd, char * lov_name);
54 int mds_lov_disconnect(struct obd_device *obd);
55
56 int mds_lov_clear_orphans(struct mds_obd *mds, struct obd_uuid *ost_uuid);
57 void mds_lov_update_objids(struct obd_device *obd, struct lov_mds_md *lmm);
58 int mds_lov_set_nextid(struct obd_device *obd);
59
60 int mds_lov_start_synchronize(struct obd_device *obd,
61                               struct obd_device *watched,
62                               void *data, int nonblock);
63 int mds_post_mds_lovconf(struct obd_device *obd);
64 int mds_notify(struct obd_device *obd, struct obd_device *watched,
65                enum obd_notify_event ev, void *data);
66 int mds_convert_lov_ea(struct obd_device *obd, struct inode *inode,
67                        struct lov_mds_md *lmm, int lmm_size,
68                        __u64 connect_flags);
69 int mds_init_lov_desc(struct obd_device *obd, struct obd_export *osc_exp);
70
71 int mds_obd_create(struct obd_export *exp, struct obdo *oa,
72                    struct lov_stripe_md **ea, struct obd_trans_info *oti);
73 int mds_obd_destroy(struct obd_export *exp, struct obdo *oa,
74                     struct lov_stripe_md *ea, struct obd_trans_info *oti,
75                     struct obd_export *md_exp, void *capa);
76
77 /* mds/handler.c */
78 extern struct lvfs_callback_ops mds_lvfs_ops;
79
80 /* mds/lproc_mds.c */
81 enum {
82         LPROC_MDS_OPEN = 0,
83         LPROC_MDS_CLOSE,
84         LPROC_MDS_MKNOD,
85         LPROC_MDS_LINK,
86         LPROC_MDS_UNLINK,
87         LPROC_MDS_MKDIR,
88         LPROC_MDS_RMDIR,
89         LPROC_MDS_RENAME,
90         LPROC_MDS_GETXATTR,
91         LPROC_MDS_SETXATTR,
92         LPROC_MDS_LAST,
93 };
94 void mds_counter_incr(struct obd_export *exp, int opcode);
95 void mds_stats_counter_init(struct lprocfs_stats *stats);
96 void lprocfs_mds_init_vars(struct lprocfs_static_vars *lvars);
97 void lprocfs_mdt_init_vars(struct lprocfs_static_vars *lvars);
98 #endif /* _MDS_INTERNAL_H */