X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Finclude%2Flustre_disk.h;h=10be5022569dd5ea987289918c15e876577dd9eb;hb=cbb4fad7566a09f54c129d48fb1e328a5941564d;hp=228cb06a915c9c7c60e9847643b7d4ce5d467474;hpb=ed9bcdc5177f0a50cb322357ea94908c16c5038f;p=fs%2Flustre-release.git diff --git a/lustre/include/lustre_disk.h b/lustre/include/lustre_disk.h index 228cb06..10be502 100644 --- a/lustre/include/lustre_disk.h +++ b/lustre/include/lustre_disk.h @@ -26,8 +26,11 @@ * GPL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. + * + * Copyright (c) 2011 Whamcloud, Inc. + * */ /* * This file is part of Lustre, http://www.lustre.org/ @@ -43,6 +46,11 @@ #ifndef _LUSTRE_DISK_H #define _LUSTRE_DISK_H +/** \defgroup disk disk + * + * @{ + */ + #include #include @@ -70,11 +78,11 @@ #define LDD_F_NEED_INDEX 0x0010 /** never registered */ #define LDD_F_VIRGIN 0x0020 -/** update the config logs for this server*/ +/** update the config logs for this server */ #define LDD_F_UPDATE 0x0040 /** rewrite the LDD */ #define LDD_F_REWRITE_LDD 0x0080 -/** regenerate all logs for this fs */ +/** regenerate config logs for this fs or server */ #define LDD_F_WRITECONF 0x0100 /** COMPAT_14 */ #define LDD_F_UPGRADE14 0x0200 @@ -82,6 +90,8 @@ #define LDD_F_PARAM 0x0400 /** backend fs make use of IAM directory format. */ #define LDD_F_IAM_DIR 0x0800 +/** all nodes are specified as service nodes */ +#define LDD_F_NO_PRIMNODE 0x1000 enum ldd_mount_type { LDD_MT_EXT3 = 0, @@ -121,7 +131,8 @@ struct lustre_disk_data { __u32 ldd_svindex; /* server index (0001), must match svname */ __u32 ldd_mount_type; /* target fs type LDD_MT_* */ - char ldd_fsname[64]; /* filesystem this server is part of */ + char ldd_fsname[64]; /* filesystem this server is part of, + MTI_NAME_MAXLEN */ char ldd_svname[64]; /* this server's name (lustre-mdt0001)*/ __u8 ldd_uuid[40]; /* server UUID (COMPAT_146) */ @@ -171,6 +182,8 @@ struct lustre_mount_data { __u32 lmd_flags; /* lustre mount flags */ int lmd_mgs_failnodes; /* mgs failover node count */ int lmd_exclude_count; + int lmd_recovery_time_soft; + int lmd_recovery_time_hard; char *lmd_dev; /* device name */ char *lmd_profile; /* client only */ char *lmd_mgssec; /* sptlrpc flavor to mgs */ @@ -186,6 +199,7 @@ struct lustre_mount_data { no other services */ #define LMD_FLG_NOMGS 0x0020 /* Only start target for servers, reusing existing MGS services */ +#define LMD_FLG_WRITECONF 0x0040 /* Rewrite config log */ #define lmd_is_client(x) ((x)->lmd_flags & LMD_FLG_CLIENT) @@ -196,6 +210,7 @@ struct lustre_mount_data { #define LR_EPOCH_BITS 32 #define lr_epoch(a) ((a) >> LR_EPOCH_BITS) #define LR_EXPIRE_INTERVALS 16 /**< number of intervals to track transno */ +#define ENOENT_VERSION 1 /** 'virtual' version of non-existent object */ #define LR_SERVER_SIZE 512 #define LR_CLIENT_START 8192 @@ -216,8 +231,6 @@ struct lustre_mount_data { #define LR_MAX_CLIENTS (CFS_PAGE_SIZE * 8) #endif -#define LR_CLIENT_BITMAP_SIZE ((LR_MAX_CLIENTS >> 3) / sizeof(long)) - /** COMPAT_146: this is an OST (temporary) */ #define OBD_COMPAT_OST 0x00000002 /** COMPAT_146: this is an MDT (temporary) */ @@ -294,6 +307,20 @@ struct lsd_client_data { __u8 lcd_padding[LR_CLIENT_SIZE - 128]; }; +/* bug20354: the lcd_uuid for export of clients may be wrong */ +static inline void check_lcd(char *obd_name, int index, + struct lsd_client_data *lcd) +{ + int length = sizeof(lcd->lcd_uuid); + if (strnlen((char*)lcd->lcd_uuid, length) == length) { + lcd->lcd_uuid[length - 1] = '\0'; + + LCONSOLE_ERROR("the client UUID (%s) on %s for exports" + "stored in last_rcvd(index = %d) is bad!\n", + lcd->lcd_uuid, obd_name, index); + } +} + /* last_rcvd handling */ static inline void lsd_le_to_cpu(struct lr_server_data *buf, struct lr_server_data *lsd) @@ -413,12 +440,14 @@ struct lustre_sb_info { struct lustre_disk_data *lsi_ldd; /* mount info on-disk */ struct ll_sb_info *lsi_llsbi; /* add'l client sbi info */ struct vfsmount *lsi_srv_mnt; /* the one server mount */ - atomic_t lsi_mounts; /* references to the srv_mnt */ + cfs_atomic_t lsi_mounts; /* references to the srv_mnt */ + struct backing_dev_info lsi_bdi; /* each client mountpoint needs own backing_dev_info */ }; #define LSI_SERVER 0x00000001 #define LSI_UMOUNT_FORCE 0x00000010 #define LSI_UMOUNT_FAILOVER 0x00000020 +#define LSI_BDI_INITIALIZED 0x00000040 #define s2lsi(sb) ((struct lustre_sb_info *)((sb)->s_fs_info)) #define s2lsi_nocast(sb) ((sb)->s_fs_info) @@ -430,10 +459,10 @@ struct lustre_sb_info { /****************** mount lookup info *********************/ struct lustre_mount_info { - char *lmi_name; - struct super_block *lmi_sb; - struct vfsmount *lmi_mnt; - struct list_head lmi_list_chain; + char *lmi_name; + struct super_block *lmi_sb; + struct vfsmount *lmi_mnt; + cfs_list_t lmi_list_chain; }; /****************** prototypes *********************/ @@ -441,11 +470,13 @@ struct lustre_mount_info { #ifdef __KERNEL__ /* obd_mount.c */ -void lustre_register_client_fill_super(int (*cfs)(struct super_block *sb)); +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 lustre_common_put_super(struct super_block *sb); +struct lustre_mount_info *server_find_mount_locked(const char *name); struct lustre_mount_info *server_get_mount(const char *name); struct lustre_mount_info *server_get_mount_2(const char *name); int server_put_mount(const char *name, struct vfsmount *mnt); @@ -459,4 +490,6 @@ int mgc_fsname2resid(char *fsname, struct ldlm_res_id *res_id); #endif +/** @} disk */ + #endif // _LUSTRE_DISK_H