lustre_idl.h

来自「lustre 1.6.5 source code」· C头文件 代码 · 共 1,604 行 · 第 1/4 页

H
1,604
字号
        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));struct obdo {        obd_valid               o_valid;        /* hot fields in this obdo */        obd_id                  o_id;        obd_gr                  o_gr;        obd_id                  o_fid;        obd_size                o_size;         /* o_size-o_blocks == ost_lvb */        obd_time                o_mtime;        obd_time                o_atime;        obd_time                o_ctime;        obd_blocks              o_blocks;       /* brw: cli sent cached bytes */        obd_size                o_grant;        /* 32-bit fields start here: keep an even number of them via padding */        obd_blksize             o_blksize;      /* optimal IO blocksize */        obd_mode                o_mode;         /* brw: cli sent cache remain */        obd_uid                 o_uid;        obd_gid                 o_gid;        obd_flag                o_flags;        obd_count               o_nlink;        /* brw: checksum */        obd_count               o_generation;        obd_count               o_misc;         /* brw: o_dropped */        __u32                   o_easize;       /* epoch in ost writes */        __u32                   o_mds;        __u32                   o_stripe_idx;   /* holds stripe idx */        __u32                   o_padding_1;        struct lustre_handle    o_handle;       /* brw: lock handle to prolong locks */        struct llog_cookie      o_lcookie;      /* destroy: unlink cookie from MDS */        __u64                   o_padding_2;        __u64                   o_padding_3;        __u64                   o_padding_4;        __u64                   o_padding_5;        __u64                   o_padding_6;};#define o_dirty   o_blocks#define o_undirty o_mode#define o_dropped o_misc#define o_cksum   o_nlinkextern void lustre_swab_obdo (struct obdo *o);/* request structure for OST's */struct ost_body {        struct  obdo oa;};extern void lustre_swab_ost_body (struct ost_body *b);extern void lustre_swab_ost_last_id(obd_id *id);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);/* this will be used when OBD_CONNECT_CHANGE_QS is set */struct qunit_data {        __u32 qd_id;    /* ID appiles to (uid, gid) */        __u32 qd_flags; /* LQUOTA_FLAGS_* affect the responding bits */        __u64 qd_count; /* acquire/release count (bytes for block quota) */        __u64 qd_qunit; /* when a master returns the reply to a slave, it will                         * contain the current corresponding qunit size */        __u64 padding;};#define QDATA_IS_GRP(qdata)    ((qdata)->qd_flags & LQUOTA_FLAGS_GRP)#define QDATA_IS_BLK(qdata)    ((qdata)->qd_flags & LQUOTA_FLAGS_BLK)#define QDATA_IS_ADJBLK(qdata) ((qdata)->qd_flags & LQUOTA_FLAGS_ADJBLK)#define QDATA_IS_ADJINO(qdata) ((qdata)->qd_flags & LQUOTA_FLAGS_ADJINO)#define QDATA_IS_CHANGE_QS(qdata) ((qdata)->qd_flags & LQUOTA_FLAGS_CHG_QS)#define QDATA_SET_GRP(qdata)    ((qdata)->qd_flags |= LQUOTA_FLAGS_GRP)#define QDATA_SET_BLK(qdata)    ((qdata)->qd_flags |= LQUOTA_FLAGS_BLK)#define QDATA_SET_ADJBLK(qdata) ((qdata)->qd_flags |= LQUOTA_FLAGS_ADJBLK)#define QDATA_SET_ADJINO(qdata) ((qdata)->qd_flags |= LQUOTA_FLAGS_ADJINO)#define QDATA_SET_CHANGE_QS(qdata) ((qdata)->qd_flags |= LQUOTA_FLAGS_CHG_QS)#define QDATA_CLR_GRP(qdata)        ((qdata)->qd_flags &= ~LQUOTA_FLAGS_GRP)#define QDATA_CLR_CHANGE_QS(qdata)  ((qdata)->qd_flags &= ~LQUOTA_FLAGS_CHG_QS)#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(1, 9, 0, 0)/* this will be used when OBD_CONNECT_QUOTA64 is set */struct qunit_data_old2 {        __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) */};#else#warning "remove quota code above for format absolete in new release"#endif#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(1, 7, 0, 0)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 */};#else#warning "remove quota code above for format absolete in new release"#endifextern void lustre_swab_qdata(struct qunit_data *d);#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(1, 7, 0, 0)extern void lustre_swab_qdata_old(struct qunit_data_old *d);#else#warning "remove quota code above for format absolete in new release"#endif#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(1, 9, 0, 0)extern void lustre_swab_qdata_old2(struct qunit_data_old2 *d);#else#warning "remove quota code above for format absolete in new release"#endifextern int quota_get_qdata(void*req, struct qunit_data *qdata,                           int is_req, int is_exp);extern int quota_copy_qdata(void *request, struct qunit_data *qdata,                            int is_req, int is_exp);typedef enum {        QUOTA_DQACQ     = 601,        QUOTA_DQREL     = 602,} quota_cmd_t;#define JOIN_FILE_ALIGN 4096#define QUOTA_REQUEST   1#define QUOTA_REPLY     0#define QUOTA_EXPORT    1#define QUOTA_IMPORT    0/* 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      4 /* need to acquire extra quota */#define QUOTA_RET_INC_PENDING  8 /* pending value is increased */extern int quota_get_qunit_data_size(__u64 flag);#endif

⌨️ 快捷键说明

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