⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lustre_idl.h

📁 非常经典的一个分布式系统
💻 H
📖 第 1 页 / 共 4 页
字号:
        __u64  lock_policy_res2;};extern void lustre_swab_ldlm_reply (struct ldlm_reply *r);/* * Opcodes for mountconf (mgs and mgc) */typedef enum {        MGS_CONNECT = 250,        MGS_DISCONNECT,        MGS_EXCEPTION,         /* node died, etc. */        MGS_TARGET_REG,        /* whenever target starts up */        MGS_TARGET_DEL,        MGS_SET_INFO,        MGS_LAST_OPC} mgs_cmd_t;#define MGS_FIRST_OPC MGS_CONNECT#define MGS_PARAM_MAXLEN 1024#define KEY_SET_INFO "set_info"struct mgs_send_param {        char             mgs_param[MGS_PARAM_MAXLEN];};/* We pass this info to the MGS so it can write config logs */#define MTI_NAME_MAXLEN 64#define MTI_PARAM_MAXLEN 4096#define MTI_NIDS_MAX 32struct mgs_target_info {        __u32            mti_lustre_ver;        __u32            mti_stripe_index;        __u32            mti_config_ver;        __u32            mti_flags;        __u32            mti_nid_count;        __u32            padding;                    /* 64 bit align */        char             mti_fsname[MTI_NAME_MAXLEN];        char             mti_svname[MTI_NAME_MAXLEN];        char             mti_uuid[sizeof(struct obd_uuid)];        __u64            mti_nids[MTI_NIDS_MAX];     /* host nids (lnet_nid_t)*/        char             mti_params[MTI_PARAM_MAXLEN];};extern void lustre_swab_mgs_target_info(struct mgs_target_info *oinfo);/* Config marker flags (in config log) */#define CM_START       0x01#define CM_END         0x02#define CM_SKIP        0x04#define CM_UPGRADE146  0x08#define CM_EXCLUDE     0x10#define CM_START_SKIP (CM_START | CM_SKIP)struct cfg_marker {        __u32             cm_step;       /* aka config version */        __u32             cm_flags;        __u32             cm_vers;       /* lustre release version number */        __u32             padding;       /* 64 bit align */        time_t            cm_createtime; /*when this record was first created */        time_t            cm_canceltime; /*when this record is no longer valid*/        char              cm_tgtname[MTI_NAME_MAXLEN];        char              cm_comment[MTI_NAME_MAXLEN];};/* * Opcodes for multiple servers. */typedef enum {        OBD_PING = 400,        OBD_LOG_CANCEL,        OBD_QC_CALLBACK,        OBD_LAST_OPC} obd_cmd_t;#define OBD_FIRST_OPC OBD_PING/* catalog of log objects *//* Identifier for a single log object */struct llog_logid {        __u64                   lgl_oid;        __u64                   lgl_ogr;        __u32                   lgl_ogen;} __attribute__((packed));/* Records written to the CATALOGS list */#define CATLIST "CATALOGS"struct llog_catid {        struct llog_logid       lci_logid;        __u32                   lci_padding1;        __u32                   lci_padding2;        __u32                   lci_padding3;} __attribute__((packed));/*join file lov mds md*/struct lov_mds_md_join {        struct lov_mds_md lmmj_md;        /*join private info*/        struct llog_logid lmmj_array_id; /*array object id*/        __u32  lmmj_extent_count;        /*array extent count*/};/* Log data record types - there is no specific reason that these need to * be related to the RPC opcodes, but no reason not to (may be handy later?) */#define LLOG_OP_MAGIC 0x10600000#define LLOG_OP_MASK  0xfff00000typedef enum {        LLOG_PAD_MAGIC   = LLOG_OP_MAGIC | 0x00000,        OST_SZ_REC       = LLOG_OP_MAGIC | 0x00f00,        OST_RAID1_REC    = LLOG_OP_MAGIC | 0x01000,        MDS_UNLINK_REC   = LLOG_OP_MAGIC | 0x10000 | (MDS_REINT << 8) | REINT_UNLINK,        MDS_SETATTR_REC  = LLOG_OP_MAGIC | 0x10000 | (MDS_REINT << 8) | REINT_SETATTR,        OBD_CFG_REC      = LLOG_OP_MAGIC | 0x20000,        PTL_CFG_REC      = LLOG_OP_MAGIC | 0x30000, /* obsolete */        LLOG_GEN_REC     = LLOG_OP_MAGIC | 0x40000,        LLOG_JOIN_REC    = LLOG_OP_MAGIC | 0x50000,        LLOG_HDR_MAGIC   = LLOG_OP_MAGIC | 0x45539,        LLOG_LOGID_MAGIC = LLOG_OP_MAGIC | 0x4553b,} llog_op_type;/* * for now, continue to support old pad records which have 0 for their * type but still need to be swabbed for their length */#define LLOG_REC_HDR_NEEDS_SWABBING(r)                                  \        (((r)->lrh_type & __swab32(LLOG_OP_MASK)) ==                    \         __swab32(LLOG_OP_MAGIC) ||                                     \         (((r)->lrh_type == 0) && ((r)->lrh_len > LLOG_CHUNK_SIZE)))/* Log record header - stored in little endian order. * Each record must start with this struct, end with a llog_rec_tail, * and be a multiple of 256 bits in size. */struct llog_rec_hdr {        __u32                   lrh_len;        __u32                   lrh_index;        __u32                   lrh_type;        __u32                   padding;};struct llog_rec_tail {        __u32 lrt_len;        __u32 lrt_index;};struct llog_logid_rec {        struct llog_rec_hdr     lid_hdr;        struct llog_logid       lid_id;        __u32                   padding1;        __u32                   padding2;        __u32                   padding3;        __u32                   padding4;        __u32                   padding5;        struct llog_rec_tail    lid_tail;} __attribute__((packed));/* MDS extent description * It is for joined file extent info, each extent info for joined file * just like (start, end, lmm). */struct mds_extent_desc {        __u64                   med_start; /* extent start */        __u64                   med_len;   /* extent length */        struct lov_mds_md       med_lmm;   /* extent's lmm  */};/*Joined file array extent log record*/struct llog_array_rec {        struct llog_rec_hdr     lmr_hdr;        struct mds_extent_desc  lmr_med;        struct llog_rec_tail    lmr_tail;};struct llog_create_rec {        struct llog_rec_hdr     lcr_hdr;        struct ll_fid           lcr_fid;        obd_id                  lcr_oid;        obd_count               lcr_ogen;        __u32                   padding;        struct llog_rec_tail    lcr_tail;} __attribute__((packed));struct llog_orphan_rec {        struct llog_rec_hdr     lor_hdr;        obd_id                  lor_oid;        obd_count               lor_ogen;        __u32                   padding;        struct llog_rec_tail    lor_tail;} __attribute__((packed));struct llog_unlink_rec {        struct llog_rec_hdr     lur_hdr;        obd_id                  lur_oid;        obd_count               lur_ogen;        __u32                   padding;        struct llog_rec_tail    lur_tail;} __attribute__((packed));struct llog_setattr_rec {        struct llog_rec_hdr     lsr_hdr;        obd_id                  lsr_oid;        obd_count               lsr_ogen;        __u32                   lsr_uid;        __u32                   lsr_gid;        __u32                   padding;        struct llog_rec_tail    lsr_tail;} __attribute__((packed));struct llog_size_change_rec {        struct llog_rec_hdr     lsc_hdr;        struct ll_fid           lsc_fid;        __u32                   lsc_io_epoch;        __u32                   padding;        struct llog_rec_tail    lsc_tail;} __attribute__((packed));struct llog_gen {        __u64 mnt_cnt;        __u64 conn_cnt;} __attribute__((packed));struct llog_gen_rec {        struct llog_rec_hdr     lgr_hdr;        struct llog_gen         lgr_gen;        struct llog_rec_tail    lgr_tail;};/* On-disk header structure of each log object, stored in little endian order */#define LLOG_CHUNK_SIZE         8192#define LLOG_HEADER_SIZE        (96)#define LLOG_BITMAP_BYTES       (LLOG_CHUNK_SIZE - LLOG_HEADER_SIZE)#define LLOG_MIN_REC_SIZE       (24) /* round(llog_rec_hdr + llog_rec_tail) *//* flags for the logs */#define LLOG_F_ZAP_WHEN_EMPTY   0x1#define LLOG_F_IS_CAT           0x2#define LLOG_F_IS_PLAIN         0x4struct llog_log_hdr {        struct llog_rec_hdr     llh_hdr;        __u64                   llh_timestamp;        __u32                   llh_count;        __u32                   llh_bitmap_offset;        __u32                   llh_size;        __u32                   llh_flags;        __u32                   llh_cat_idx;        /* for a catalog the first plain slot is next to it */        struct obd_uuid         llh_tgtuuid;        __u32                   llh_reserved[LLOG_HEADER_SIZE/sizeof(__u32) - 23];        __u32                   llh_bitmap[LLOG_BITMAP_BYTES/sizeof(__u32)];        struct llog_rec_tail    llh_tail;} __attribute__((packed));#define LLOG_BITMAP_SIZE(llh)  ((llh->llh_hdr.lrh_len -         \                                 llh->llh_bitmap_offset -       \                                 sizeof(llh->llh_tail)) * 8)/* log cookies are used to reference a specific log file and a record therein */struct llog_cookie {        struct llog_logid       lgc_lgl;        __u32                   lgc_subsys;        __u32                   lgc_index;        __u32                   lgc_padding;} __attribute__((packed));/* llog protocol */typedef enum {        LLOG_ORIGIN_HANDLE_CREATE       = 501,        LLOG_ORIGIN_HANDLE_NEXT_BLOCK   = 502,        LLOG_ORIGIN_HANDLE_READ_HEADER  = 503,        LLOG_ORIGIN_HANDLE_WRITE_REC    = 504,        LLOG_ORIGIN_HANDLE_CLOSE        = 505,        LLOG_ORIGIN_CONNECT             = 506,        LLOG_CATINFO                    = 507,  /* for lfs catinfo */        LLOG_ORIGIN_HANDLE_PREV_BLOCK   = 508,        LLOG_ORIGIN_HANDLE_DESTROY      = 509,  /* for destroy llog object*/        LLOG_LAST_OPC} llog_cmd_t;#define LLOG_FIRST_OPC LLOG_ORIGIN_HANDLE_CREATEstruct llogd_body {        struct llog_logid  lgd_logid;        __u32 lgd_ctxt_idx;        __u32 lgd_llh_flags;        __u32 lgd_index;        __u32 lgd_saved_index;        __u32 lgd_len;        __u64 lgd_cur_offset;} __attribute__((packed));struct llogd_conn_body {        struct llog_gen         lgdc_gen;        struct llog_logid       lgdc_logid;        __u32                   lgdc_ctxt_idx;} __attribute__((packed));struct lov_user_ost_data_join {   /* per-stripe data structure */        __u64 l_extent_start;     /* extent start*/        __u64 l_extent_end;       /* extent end*/        __u64 l_object_id;        /* OST object ID */        __u64 l_object_gr;        /* OST object group (creating MDS number) */        __u32 l_ost_gen;          /* generation of this OST index */        __u32 l_ost_idx;          /* OST index in LOV */} __attribute__((packed));struct lov_user_md_join {         /* LOV EA user data (host-endian) */        __u32 lmm_magic;          /* magic number = LOV_MAGIC_JOIN */        __u32 lmm_pattern;        /* LOV_PATTERN_RAID0, LOV_PATTERN_RAID1 */        __u64 lmm_object_id;      /* LOV object ID */        __u64 lmm_object_gr;      /* LOV object group */        __u32 lmm_stripe_size;    /* size of stripe in bytes */        __u32 lmm_stripe_count;   /* num stripes in use for this object */        __u32 lmm_extent_count;   /* extent count of lmm*/        __u64 lmm_tree_id;        /* mds tree object id */        __u64 lmm_tree_gen;       /* mds tree object gen */        struct llog_logid lmm_array_id; /* mds extent desc llog object id */        struct lov_user_ost_data_join lmm_objects[0]; /* per-stripe data */} __attribute__((packed));extern void lustre_swab_lov_user_md(struct lov_user_md *lum);extern void lustre_swab_lov_user_md_objects(struct lov_user_md *lum);extern void lustre_swab_lov_user_md_join(struct lov_user_md_join *lumj);/* llog_swab.c */extern void lustre_swab_llogd_body (struct llogd_body *d);extern void lustre_swab_llog_hdr (struct llog_log_hdr *h);extern void lustre_swab_llogd_conn_body (struct llogd_conn_body *d);extern void lustre_swab_llog_rec(struct llog_rec_hdr  *rec,                                 struct llog_rec_tail *tail);struct lustre_cfg;extern void lustre_swab_lustre_cfg(struct lustre_cfg *lcfg);/* quota. fixed by tianzy for bug10707 */#define QUOTA_IS_GRP   0X1UL  /* 0 is user, 1 is group. Used by qd_flags*/#define QUOTA_IS_BLOCK 0x2UL  /* 0 is inode, 1 is block. Used by qd_flags*/struct qunit_data {        __u32 qd_id; /* ID appiles to (uid, gid) */        __u32 qd_flags; /* Quota type (USRQUOTA, GRPQUOTA) occupy one bit;                         * Block quota or file quota occupy one bit */        __u64 qd_count; /* acquire/release count (bytes for block quota) */};struct qunit_data_old {        __u32 qd_id;    /* ID appiles to (uid, gid) */        __u32 qd_type;  /* Quota type (USRQUOTA, GRPQUOTA) */        __u32 qd_count; /* acquire/release count (bytes for block quota) */        __u32 qd_isblk; /* Block quota or file quota */};extern void lustre_swab_qdata(struct qunit_data *d);extern void lustre_swab_qdata_old(struct qunit_data_old *d);extern struct qunit_data *lustre_quota_old_to_new(struct qunit_data_old *d);extern struct qunit_data_old *lustre_quota_new_to_old(struct qunit_data *d);typedef enum {        QUOTA_DQACQ     = 601,        QUOTA_DQREL     = 602,} quota_cmd_t;#define JOIN_FILE_ALIGN 4096/* quota check function */#define QUOTA_RET_OK           0 /* return successfully */#define QUOTA_RET_NOQUOTA      1 /* not support quota */#define QUOTA_RET_NOLIMIT      2 /* quota limit isn't set */#define QUOTA_RET_ACQUOTA      3 /* need to acquire extra quota */#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -