📄 evms_bbr.h
字号:
/* * * Copyright (c) International Business Machines Corp., 2000 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *//* * linux/include/linux/evms_bbr.h * * EVMS Bad Block Relocation Feature kernel header file * */#ifndef EVMS_BBR_INCLUDED#define EVMS_BBR_INCLUDED#define EVMS_BBR_VERSION_MAJOR 1#define EVMS_BBR_VERSION_MINOR 0#define EVMS_BBR_VERSION_PATCHLEVEL 0#define EVMS_BBR_FEATURE_ID 6#define EVMS_BBR_SIGNATURE 0x42627246 /* BbrF *//* The following defines establish the minimum and maximum number of * replacement sectors which can be allocated for Bad Block Relocation. * Otherwise, 1 replacement sector per MB of disk space is allocated. */#define EVMS_BBR_ENTRIES_PER_SECT 31 /* Assume sector size is 512 bytes*/#define EVMS_BBR_LIMIT 4096#define EVMS_BBR_TABLE_SIGNATURE 0x42627254 /* BbrT */typedef struct evms_bbr_table_entry_s { u_int64_t bad_sect; u_int64_t replacement_sect;} evms_bbr_table_entry_t;typedef struct evms_bbr_table_s { u_int32_t signature; /* Signature for a sector of the bbr table (EVMS_BBR_TABLE_SIGNATURE) */ u_int32_t crc; /* CRC for this sector of the BBR Table. */ u_int32_t sequence_number; /* Used to resolve conflicts when the primary and secondary tables do not match. */ u_int32_t in_use_cnt; /* number of in-use entries */ evms_bbr_table_entry_t entries[EVMS_BBR_ENTRIES_PER_SECT]; /* BBR table entries available for this sector of the BBR table */} evms_bbr_table_t;/* description of on disk meta data sector for bbr feature */typedef struct evms_bbr_metadata_s {/* 0*/ u_int32_t signature; /* EVMS_BBR_SIGNATURE *//* 4*/ u_int32_t crc;/* 8*/ u_int32_t block_size; /* block size in bytes *//*12*/ u_int32_t flags; /* Global flag used by BBR *//*16*/ u_int64_t sequence_number;/*24*/ u_int64_t start_sect_bbr_table; /* start 64-bit LBA of the BBR table *//*32*/ u_int64_t nr_sects_bbr_table; /* number of sectors to hold the BBR table *//*40*/ u_int64_t start_replacement_sect; /* start 64-bit LBA of the replacement sectors *//*48*/ u_int64_t nr_replacement_blks; /* number of replacement blocks. *//*56*/ char pads[456]; /* padding for 512-byte sector alignment */} evms_bbr_metadata_t;// BBR direct ioctl commands.#define BBR_GET_INFO_CMD 1 // Return the total number of sectors // that are currently remapped for the // bbr object.#define BBR_STOP_REMAP_CMD 2 // Stop ... do not remap any new sectors // or even honor any existing remaps for // the bbr object until after the next // rediscover command is received.#define BBR_SECTOR_IO_CMD 3 // Process an I/O from the engine directly // through the bbr object.typedef struct evms_notify_bbr_s { char object_name[EVMS_VOLUME_NAME_SIZE+1]; // Input - Name of bbr object from feature header u_int64_t count; // Output - Count of remapped sectors u_int64_t start_sect; // Input - Starting sector for sector_io u_int64_t nr_sect; // Input - Number of sectors for sector_io unsigned long buffer; // Input - Pointer to buffer for sector_io int rw; // Input - READ or WRITE for sector_io} evms_notify_bbr_t;#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -