Whamcloud - gitweb
- merge with 1_5,some fixes.
[fs/lustre-release.git] / lustre / mgs / mgs_internal.h
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  */
4
5 #ifndef _MGS_INTERNAL_H
6 #define _MGS_INTERNAL_H
7
8 #ifdef __KERNEL__
9 # include <linux/fs.h>
10 #endif
11 #include <libcfs/kp30.h>
12 #include <lustre/lustre_idl.h>
13 #include <lustre_lib.h>
14 #include <lustre_dlm.h>
15 #include <lustre_log.h>
16 #include <lustre_export.h>
17
18
19 /* MDS has o_t * 1000 */
20 #define MGS_SERVICE_WATCHDOG_TIMEOUT (obd_timeout * 10)
21
22 /* mgs_llog.c */
23 #define FSDB_EMPTY      0x0001
24 #define FSDB_OLDLOG14   0x0002  /* log starts in old (1.4) style */
25
26
27 struct fs_db {
28         char              fsdb_name[8];
29         struct list_head  fsdb_list;           /* list of databases */
30         struct semaphore  fsdb_sem;
31         void             *fsdb_ost_index_map;  /* bitmap of used indicies */
32         void             *fsdb_mdt_index_map;  /* bitmap of used indicies */
33         /* COMPAT_146 these items must be recorded out of the old client log */
34         char             *fsdb_clilov;         /* COMPAT_146 client lov name */
35         char             *fsdb_clilmv;
36         char             *fsdb_mdtlov;         /* COMPAT_146 mds lov name */
37         char             *fsdb_mdtlmv;
38         char             *fsdb_mdc;            /* COMPAT_146 mdc name */
39         /* end COMPAT_146 */
40         __u32             fsdb_flags;
41         __u32             fsdb_gen;
42 };
43
44 int mgs_init_fsdb_list(struct obd_device *obd);
45 int mgs_cleanup_fsdb_list(struct obd_device *obd);
46 int mgs_check_index(struct obd_device *obd, struct mgs_target_info *mti);
47 int mgs_check_failnid(struct obd_device *obd, struct mgs_target_info *mti);
48 int mgs_write_log_target(struct obd_device *obd, struct mgs_target_info *mti);
49 int mgs_upgrade_sv_14(struct obd_device *obd, struct mgs_target_info *mti);
50 int mgs_erase_log(struct obd_device *obd, char *name);
51 int mgs_erase_logs(struct obd_device *obd, char *fsname);
52 int mgs_setparam(struct obd_device *obd, struct lustre_cfg *lcfg, char *fsname);
53
54 /* mgs_fs.c */
55 int mgs_fs_setup(struct obd_device *obd, struct vfsmount *mnt);
56 int mgs_fs_cleanup(struct obd_device *obddev);
57
58 #define strsuf(buf, suffix) (strcmp((buf)+strlen(buf)-strlen(suffix), (suffix)))
59
60 #endif