1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
5 #ifndef _MGS_INTERNAL_H
6 #define _MGS_INTERNAL_H
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>
19 #define MGS_SERVICE_WATCHDOG_TIMEOUT (obd_timeout * 1000)
22 int class_dentry_readdir(struct obd_device *obd, struct dentry *dir,
23 struct vfsmount *inmnt,
24 struct list_head *dentry_list);
26 struct mgs_tgt_srpc_conf {
27 struct mgs_tgt_srpc_conf *mtsc_next;
29 struct sptlrpc_rule_set mtsc_rset;
32 #define INDEX_MAP_SIZE 8192 /* covers indicies to FFFF */
33 #define FSDB_LOG_EMPTY 0x0001 /* missing client log */
34 #define FSDB_OLDLOG14 0x0002 /* log starts in old (1.4) style */
39 struct list_head fsdb_list; /* list of databases */
40 struct semaphore fsdb_sem;
41 void *fsdb_ost_index_map; /* bitmap of used indicies */
42 void *fsdb_mdt_index_map; /* bitmap of used indicies */
43 /* COMPAT_146 these items must be recorded out of the old client log */
44 char *fsdb_clilov; /* COMPAT_146 client lov name */
46 char *fsdb_mdtlov; /* COMPAT_146 mds lov name */
48 char *fsdb_mdc; /* COMPAT_146 mdc name */
53 /* in-memory copy of the srpc rules, guarded by fsdb_sem */
54 struct sptlrpc_rule_set fsdb_srpc_gen;
55 struct mgs_tgt_srpc_conf *fsdb_srpc_tgt;
56 unsigned int fsdb_srpc_fl_udesc:1;
59 int mgs_init_fsdb_list(struct obd_device *obd);
60 int mgs_cleanup_fsdb_list(struct obd_device *obd);
61 int mgs_check_index(struct obd_device *obd, struct mgs_target_info *mti);
62 int mgs_check_failnid(struct obd_device *obd, struct mgs_target_info *mti);
63 int mgs_write_log_target(struct obd_device *obd, struct mgs_target_info *mti);
64 int mgs_upgrade_sv_14(struct obd_device *obd, struct mgs_target_info *mti);
65 int mgs_erase_log(struct obd_device *obd, char *name);
66 int mgs_erase_logs(struct obd_device *obd, char *fsname);
67 int mgs_setparam(struct obd_device *obd, struct lustre_cfg *lcfg, char *fsname);
70 int mgs_fs_setup(struct obd_device *obd, struct vfsmount *mnt);
71 int mgs_fs_cleanup(struct obd_device *obddev);
73 #define strsuf(buf, suffix) (strcmp((buf)+strlen(buf)-strlen(suffix), (suffix)))
75 int lproc_mgs_setup(struct obd_device *dev);
76 int lproc_mgs_cleanup(struct obd_device *obd);
77 int lproc_mgs_add_live(struct obd_device *obd, struct fs_db *fsdb);
78 int lproc_mgs_del_live(struct obd_device *obd, struct fs_db *fsdb);
79 void lprocfs_mgs_init_vars(struct lprocfs_static_vars *lvars);
81 static inline int lproc_mgs_setup(struct obd_device *dev)
83 static inline int lproc_mgs_cleanup(struct obd_device *obd)
85 static inline int lproc_mgs_add_live(struct obd_device *obd, struct fs_db *fsdb)
87 static inline int lproc_mgs_del_live(struct obd_device *obd, struct fs_db *fsdb)
89 static void lprocfs_mgs_init_vars(struct lprocfs_static_vars *lvars)
91 memset(lvars, 0, sizeof(*lvars));
97 LPROC_MGS_CONNECT = 0,
100 LPROC_MGS_TARGET_REG,
101 LPROC_MGS_TARGET_DEL,
104 void mgs_counter_incr(struct obd_export *exp, int opcode);
105 void mgs_stats_counter_init(struct lprocfs_stats *stats);
107 #endif /* _MGS_INTERNAL_H */