diff options
Diffstat (limited to 'fs/exofs/common.h')
| -rw-r--r-- | fs/exofs/common.h | 81 |
1 files changed, 57 insertions, 24 deletions
diff --git a/fs/exofs/common.h b/fs/exofs/common.h index c6718e4817fe..b1b178e61718 100644 --- a/fs/exofs/common.h +++ b/fs/exofs/common.h | |||
| @@ -49,6 +49,7 @@ | |||
| 49 | #define EXOFS_MIN_PID 0x10000 /* Smallest partition ID */ | 49 | #define EXOFS_MIN_PID 0x10000 /* Smallest partition ID */ |
| 50 | #define EXOFS_OBJ_OFF 0x10000 /* offset for objects */ | 50 | #define EXOFS_OBJ_OFF 0x10000 /* offset for objects */ |
| 51 | #define EXOFS_SUPER_ID 0x10000 /* object ID for on-disk superblock */ | 51 | #define EXOFS_SUPER_ID 0x10000 /* object ID for on-disk superblock */ |
| 52 | #define EXOFS_DEVTABLE_ID 0x10001 /* object ID for on-disk device table */ | ||
| 52 | #define EXOFS_ROOT_ID 0x10002 /* object ID for root directory */ | 53 | #define EXOFS_ROOT_ID 0x10002 /* object ID for root directory */ |
| 53 | 54 | ||
| 54 | /* exofs Application specific page/attribute */ | 55 | /* exofs Application specific page/attribute */ |
| @@ -78,17 +79,67 @@ enum { | |||
| 78 | #define EXOFS_SUPER_MAGIC 0x5DF5 | 79 | #define EXOFS_SUPER_MAGIC 0x5DF5 |
| 79 | 80 | ||
| 80 | /* | 81 | /* |
| 81 | * The file system control block - stored in an object's data (mainly, the one | 82 | * The file system control block - stored in object EXOFS_SUPER_ID's data. |
| 82 | * with ID EXOFS_SUPER_ID). This is where the in-memory superblock is stored | 83 | * This is where the in-memory superblock is stored on disk. |
| 83 | * on disk. Right now it just has a magic value, which is basically a sanity | ||
| 84 | * check on our ability to communicate with the object store. | ||
| 85 | */ | 84 | */ |
| 85 | enum {EXOFS_FSCB_VER = 1, EXOFS_DT_VER = 1}; | ||
| 86 | struct exofs_fscb { | 86 | struct exofs_fscb { |
| 87 | __le64 s_nextid; /* Highest object ID used */ | 87 | __le64 s_nextid; /* Highest object ID used */ |
| 88 | __le32 s_numfiles; /* Number of files on fs */ | 88 | __le64 s_numfiles; /* Number of files on fs */ |
| 89 | __le32 s_version; /* == EXOFS_FSCB_VER */ | ||
| 89 | __le16 s_magic; /* Magic signature */ | 90 | __le16 s_magic; /* Magic signature */ |
| 90 | __le16 s_newfs; /* Non-zero if this is a new fs */ | 91 | __le16 s_newfs; /* Non-zero if this is a new fs */ |
| 91 | }; | 92 | |
| 93 | /* From here on it's a static part, only written by mkexofs */ | ||
| 94 | __le64 s_dev_table_oid; /* Resurved, not used */ | ||
| 95 | __le64 s_dev_table_count; /* == 0 means no dev_table */ | ||
| 96 | } __packed; | ||
| 97 | |||
| 98 | /* | ||
| 99 | * Describes the raid used in the FS. It is part of the device table. | ||
| 100 | * This here is taken from the pNFS-objects definition. In exofs we | ||
| 101 | * use one raid policy through-out the filesystem. (NOTE: the funny | ||
| 102 | * alignment at begining. We take care of it at exofs_device_table. | ||
| 103 | */ | ||
| 104 | struct exofs_dt_data_map { | ||
| 105 | __le32 cb_num_comps; | ||
| 106 | __le64 cb_stripe_unit; | ||
| 107 | __le32 cb_group_width; | ||
| 108 | __le32 cb_group_depth; | ||
| 109 | __le32 cb_mirror_cnt; | ||
| 110 | __le32 cb_raid_algorithm; | ||
| 111 | } __packed; | ||
| 112 | |||
| 113 | /* | ||
| 114 | * This is an osd device information descriptor. It is a single entry in | ||
| 115 | * the exofs device table. It describes an osd target lun which | ||
| 116 | * contains data belonging to this FS. (Same partition_id on all devices) | ||
| 117 | */ | ||
| 118 | struct exofs_dt_device_info { | ||
| 119 | __le32 systemid_len; | ||
| 120 | u8 systemid[OSD_SYSTEMID_LEN]; | ||
| 121 | __le64 long_name_offset; /* If !0 then offset-in-file */ | ||
| 122 | __le32 osdname_len; /* */ | ||
| 123 | u8 osdname[44]; /* Embbeded, Ususally an asci uuid */ | ||
| 124 | } __packed; | ||
| 125 | |||
| 126 | /* | ||
| 127 | * The EXOFS device table - stored in object EXOFS_DEVTABLE_ID's data. | ||
| 128 | * It contains the raid used for this multy-device FS and an array of | ||
| 129 | * participating devices. | ||
| 130 | */ | ||
| 131 | struct exofs_device_table { | ||
| 132 | __le32 dt_version; /* == EXOFS_DT_VER */ | ||
| 133 | struct exofs_dt_data_map dt_data_map; /* Raid policy to use */ | ||
| 134 | |||
| 135 | /* Resurved space For future use. Total includeing this: | ||
| 136 | * (8 * sizeof(le64)) | ||
| 137 | */ | ||
| 138 | __le64 __Resurved[4]; | ||
| 139 | |||
| 140 | __le64 dt_num_devices; /* Array size */ | ||
| 141 | struct exofs_dt_device_info dt_dev_table[]; /* Array of devices */ | ||
| 142 | } __packed; | ||
| 92 | 143 | ||
| 93 | /**************************************************************************** | 144 | /**************************************************************************** |
| 94 | * inode-related things | 145 | * inode-related things |
| @@ -155,22 +206,4 @@ enum { | |||
| 155 | (((name_len) + offsetof(struct exofs_dir_entry, name) + \ | 206 | (((name_len) + offsetof(struct exofs_dir_entry, name) + \ |
| 156 | EXOFS_DIR_ROUND) & ~EXOFS_DIR_ROUND) | 207 | EXOFS_DIR_ROUND) & ~EXOFS_DIR_ROUND) |
| 157 | 208 | ||
| 158 | /************************* | ||
| 159 | * function declarations * | ||
| 160 | *************************/ | ||
| 161 | /* osd.c */ | ||
| 162 | void exofs_make_credential(u8 cred_a[OSD_CAP_LEN], | ||
| 163 | const struct osd_obj_id *obj); | ||
| 164 | |||
| 165 | int exofs_check_ok_resid(struct osd_request *or, u64 *in_resid, u64 *out_resid); | ||
| 166 | static inline int exofs_check_ok(struct osd_request *or) | ||
| 167 | { | ||
| 168 | return exofs_check_ok_resid(or, NULL, NULL); | ||
| 169 | } | ||
| 170 | int exofs_sync_op(struct osd_request *or, int timeout, u8 *cred); | ||
| 171 | int exofs_async_op(struct osd_request *or, | ||
| 172 | osd_req_done_fn *async_done, void *caller_context, u8 *cred); | ||
| 173 | |||
| 174 | int extract_attr_from_req(struct osd_request *or, struct osd_attr *attr); | ||
| 175 | |||
| 176 | #endif /*ifndef __EXOFS_COM_H__*/ | 209 | #endif /*ifndef __EXOFS_COM_H__*/ |
