* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
- * Copyright (c) 2011, 2016, Intel Corporation.
+ * Copyright (c) 2011, 2017, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
#include <linux/backing-dev.h>
#include <linux/list.h>
#include <libcfs/libcfs.h>
-#include <uapi/linux/lustre_disk.h>
+#include <uapi/linux/lustre/lustre_disk.h>
+#include <uapi/linux/lustre/lustre_idl.h>
#define IS_MDT(data) ((data)->lsi_flags & LDD_F_SV_TYPE_MDT)
#define IS_OST(data) ((data)->lsi_flags & LDD_F_SV_TYPE_OST)
#define LMD_FLG_UPDATE 0x2000 /* update parameters */
#define LMD_FLG_HSM 0x4000 /* Start coordinator */
#define LMD_FLG_DEV_RDONLY 0x8000 /* discard modification quitely */
+#define LMD_FLG_NO_PRECREATE 0x10000 /* do not allow OST object creation */
+#define LMD_FLG_LOCAL_RECOV 0x20000 /* force recovery for local clients */
+#define LMD_FLG_ABORT_RECOV_MDT 0x40000 /* Abort recovery between MDTs */
+#define LMD_FLG_NO_LOCAL_LOGS 0x80000 /* Use config logs from MGS */
#define lmd_is_client(x) ((x)->lmd_flags & LMD_FLG_CLIENT)
/****************** superblock additional info *********************/
struct ll_sb_info;
+struct kobject;
struct lustre_sb_info {
int lsi_flags;
struct ll_sb_info *lsi_llsbi; /* add'l client sbi info */
struct dt_device *lsi_dt_dev; /* dt device to access disk fs*/
atomic_t lsi_mounts; /* references to the srv_mnt */
+ struct kobject *lsi_kobj;
char lsi_svname[MTI_NAME_MAXLEN];
- char lsi_osd_obdname[64];
- char lsi_osd_uuid[64];
+ /* lsi_osd_obdname format = 'lsi->ls_svname'-osd */
+ char lsi_osd_obdname[MTI_NAME_MAXLEN + 4];
+ /* lsi_osd_uuid format = 'lsi->ls_osd_obdname'_UUID */
+ char lsi_osd_uuid[MTI_NAME_MAXLEN + 9];
struct obd_export *lsi_osd_exp;
char lsi_osd_type[16];
char lsi_fstype[16];
struct backing_dev_info lsi_bdi; /* each client mountpoint needs
own backing_dev_info */
+ /* protect lsi_lwp_list */
+ struct mutex lsi_lwp_mutex;
struct list_head lsi_lwp_list;
- spinlock_t lsi_lwp_lock;
- unsigned long lsi_lwp_started:1;
+ unsigned long lsi_lwp_started:1,
+ lsi_server_started:1;
+#ifdef CONFIG_LL_ENCRYPTION
+ const struct llcrypt_operations *lsi_cop;
+ struct key *lsi_master_keys; /* master crypto keys used */
+#endif
};
#define LSI_UMOUNT_FAILOVER 0x00200000
-#define LSI_BDI_INITIALIZED 0x00400000
#define s2lsi(sb) ((struct lustre_sb_info *)((sb)->s_fs_info))
#define s2lsi_nocast(sb) ((sb)->s_fs_info)
/****************** prototypes *********************/
-/* obd_mount.c */
-int server_name2fsname(const char *svname, char *fsname, const char **endptr);
-#endif /* HAVE_SERVER_SUPPORT */
+/* obd_mount_server.c */
+int server_fill_super(struct super_block *sb);
+struct lustre_mount_info *server_get_mount(const char *name);
+int server_put_mount(const char *name, bool dereg_mnt);
+struct mgs_target_info;
+int server_mti_print(const char *title, struct mgs_target_info *mti);
+void server_calc_timeout(struct lustre_sb_info *lsi, struct obd_device *obd);
+/* obd_mount.c */
int server_name2svname(const char *label, char *svname, const char **endptr,
size_t svsize);
-#ifdef HAVE_SERVER_SUPPORT
int server_name_is_ost(const char *svname);
int target_name2index(const char *svname, u32 *idx, const char **endptr);
int lustre_put_lsi(struct super_block *sb);
int lustre_start_simple(char *obdname, char *type, char *uuid,
char *s1, char *s2, char *s3, char *s4);
-int lustre_start_mgc(struct super_block *sb);
#endif /* HAVE_SERVER_SUPPORT */
-void lustre_register_client_fill_super(int (*cfs)(struct super_block *sb,
- struct vfsmount *mnt));
-void lustre_register_kill_super_cb(void (*cfs)(struct super_block *sb));
+int server_name2fsname(const char *svname, char *fsname, const char **endptr);
+void obdname2fsname(const char *tgt, char *fsname, size_t fslen);
+
+int lustre_start_mgc(struct super_block *sb);
int lustre_common_put_super(struct super_block *sb);
-# ifdef HAVE_SERVER_SUPPORT
-/* obd_mount_server.c */
-int server_fill_super(struct super_block *sb);
-struct lustre_mount_info *server_get_mount(const char *name);
-int server_put_mount(const char *name, bool dereg_mnt);
-struct mgs_target_info;
-int server_mti_print(const char *title, struct mgs_target_info *mti);
-void server_calc_timeout(struct lustre_sb_info *lsi, struct obd_device *obd);
-# endif
+struct lustre_sb_info *lustre_init_lsi(struct super_block *sb);
+int lustre_put_lsi(struct super_block *sb);
+int lmd_parse(char *options, struct lustre_mount_data *lmd);
+/* mgc_request.c */
int mgc_fsname2resid(char *fsname, struct ldlm_res_id *res_id, int type);
int mgc_logname2resid(char *fsname, struct ldlm_res_id *res_id, int type);