volumes.h (3c09ec59cdea5b132212d97154d625fd34e436dd) | volumes.h (5b316468983dfa9473ff0f1c42e4e30b4c267141) |
---|---|
1/* SPDX-License-Identifier: GPL-2.0 */ 2/* 3 * Copyright (C) 2007 Oracle. All rights reserved. 4 */ 5 6#ifndef BTRFS_VOLUMES_H 7#define BTRFS_VOLUMES_H 8 --- 38 unchanged lines hidden (view full) --- 47 48#define BTRFS_DEV_STATE_WRITEABLE (0) 49#define BTRFS_DEV_STATE_IN_FS_METADATA (1) 50#define BTRFS_DEV_STATE_MISSING (2) 51#define BTRFS_DEV_STATE_REPLACE_TGT (3) 52#define BTRFS_DEV_STATE_FLUSH_SENT (4) 53#define BTRFS_DEV_STATE_NO_READA (5) 54 | 1/* SPDX-License-Identifier: GPL-2.0 */ 2/* 3 * Copyright (C) 2007 Oracle. All rights reserved. 4 */ 5 6#ifndef BTRFS_VOLUMES_H 7#define BTRFS_VOLUMES_H 8 --- 38 unchanged lines hidden (view full) --- 47 48#define BTRFS_DEV_STATE_WRITEABLE (0) 49#define BTRFS_DEV_STATE_IN_FS_METADATA (1) 50#define BTRFS_DEV_STATE_MISSING (2) 51#define BTRFS_DEV_STATE_REPLACE_TGT (3) 52#define BTRFS_DEV_STATE_FLUSH_SENT (4) 53#define BTRFS_DEV_STATE_NO_READA (5) 54 |
55struct btrfs_zoned_device_info; 56 |
|
55struct btrfs_device { 56 struct list_head dev_list; /* device_list_mutex */ 57 struct list_head dev_alloc_list; /* chunk mutex */ 58 struct list_head post_commit_list; /* chunk mutex */ 59 struct btrfs_fs_devices *fs_devices; 60 struct btrfs_fs_info *fs_info; 61 62 struct rcu_string __rcu *name; 63 64 u64 generation; 65 66 struct block_device *bdev; 67 | 57struct btrfs_device { 58 struct list_head dev_list; /* device_list_mutex */ 59 struct list_head dev_alloc_list; /* chunk mutex */ 60 struct list_head post_commit_list; /* chunk mutex */ 61 struct btrfs_fs_devices *fs_devices; 62 struct btrfs_fs_info *fs_info; 63 64 struct rcu_string __rcu *name; 65 66 u64 generation; 67 68 struct block_device *bdev; 69 |
70 struct btrfs_zoned_device_info *zone_info; 71 |
|
68 /* the mode sent to blkdev_get */ 69 fmode_t mode; 70 71 unsigned long dev_state; 72 blk_status_t last_flush_error; 73 74#ifdef __BTRFS_NEED_DEVICE_DATA_ORDERED 75 /* A seqcount_t with associated chunk_mutex (for lockdep) */ --- 130 unchanged lines hidden (view full) --- 206BTRFS_DEVICE_GETSET_FUNCS(total_bytes); 207BTRFS_DEVICE_GETSET_FUNCS(disk_total_bytes); 208BTRFS_DEVICE_GETSET_FUNCS(bytes_used); 209 210enum btrfs_chunk_allocation_policy { 211 BTRFS_CHUNK_ALLOC_REGULAR, 212}; 213 | 72 /* the mode sent to blkdev_get */ 73 fmode_t mode; 74 75 unsigned long dev_state; 76 blk_status_t last_flush_error; 77 78#ifdef __BTRFS_NEED_DEVICE_DATA_ORDERED 79 /* A seqcount_t with associated chunk_mutex (for lockdep) */ --- 130 unchanged lines hidden (view full) --- 210BTRFS_DEVICE_GETSET_FUNCS(total_bytes); 211BTRFS_DEVICE_GETSET_FUNCS(disk_total_bytes); 212BTRFS_DEVICE_GETSET_FUNCS(bytes_used); 213 214enum btrfs_chunk_allocation_policy { 215 BTRFS_CHUNK_ALLOC_REGULAR, 216}; 217 |
218/* 219 * Read policies for mirrored block group profiles, read picks the stripe based 220 * on these policies. 221 */ 222enum btrfs_read_policy { 223 /* Use process PID to choose the stripe */ 224 BTRFS_READ_POLICY_PID, 225 BTRFS_NR_READ_POLICY, 226}; 227 |
|
214struct btrfs_fs_devices { 215 u8 fsid[BTRFS_FSID_SIZE]; /* FS specific uuid */ 216 u8 metadata_uuid[BTRFS_FSID_SIZE]; 217 bool fsid_change; 218 struct list_head fs_list; 219 220 u64 num_devices; 221 u64 open_devices; --- 37 unchanged lines hidden (view full) --- 259 struct btrfs_fs_info *fs_info; 260 /* sysfs kobjects */ 261 struct kobject fsid_kobj; 262 struct kobject *devices_kobj; 263 struct kobject *devinfo_kobj; 264 struct completion kobj_unregister; 265 266 enum btrfs_chunk_allocation_policy chunk_alloc_policy; | 228struct btrfs_fs_devices { 229 u8 fsid[BTRFS_FSID_SIZE]; /* FS specific uuid */ 230 u8 metadata_uuid[BTRFS_FSID_SIZE]; 231 bool fsid_change; 232 struct list_head fs_list; 233 234 u64 num_devices; 235 u64 open_devices; --- 37 unchanged lines hidden (view full) --- 273 struct btrfs_fs_info *fs_info; 274 /* sysfs kobjects */ 275 struct kobject fsid_kobj; 276 struct kobject *devices_kobj; 277 struct kobject *devinfo_kobj; 278 struct completion kobj_unregister; 279 280 enum btrfs_chunk_allocation_policy chunk_alloc_policy; |
281 282 /* Policy used to read the mirrored stripes */ 283 enum btrfs_read_policy read_policy; |
|
267}; 268 269#define BTRFS_BIO_INLINE_CSUM_SIZE 64 270 271#define BTRFS_MAX_DEVS(info) ((BTRFS_MAX_ITEM_SIZE(info) \ 272 - sizeof(struct btrfs_chunk)) \ 273 / sizeof(struct btrfs_stripe) + 1) 274 --- 156 unchanged lines hidden (view full) --- 431blk_status_t btrfs_map_bio(struct btrfs_fs_info *fs_info, struct bio *bio, 432 int mirror_num); 433int btrfs_open_devices(struct btrfs_fs_devices *fs_devices, 434 fmode_t flags, void *holder); 435struct btrfs_device *btrfs_scan_one_device(const char *path, 436 fmode_t flags, void *holder); 437int btrfs_forget_devices(const char *path); 438void btrfs_close_devices(struct btrfs_fs_devices *fs_devices); | 284}; 285 286#define BTRFS_BIO_INLINE_CSUM_SIZE 64 287 288#define BTRFS_MAX_DEVS(info) ((BTRFS_MAX_ITEM_SIZE(info) \ 289 - sizeof(struct btrfs_chunk)) \ 290 / sizeof(struct btrfs_stripe) + 1) 291 --- 156 unchanged lines hidden (view full) --- 448blk_status_t btrfs_map_bio(struct btrfs_fs_info *fs_info, struct bio *bio, 449 int mirror_num); 450int btrfs_open_devices(struct btrfs_fs_devices *fs_devices, 451 fmode_t flags, void *holder); 452struct btrfs_device *btrfs_scan_one_device(const char *path, 453 fmode_t flags, void *holder); 454int btrfs_forget_devices(const char *path); 455void btrfs_close_devices(struct btrfs_fs_devices *fs_devices); |
439void btrfs_free_extra_devids(struct btrfs_fs_devices *fs_devices, int step); | 456void btrfs_free_extra_devids(struct btrfs_fs_devices *fs_devices); |
440void btrfs_assign_next_active_device(struct btrfs_device *device, 441 struct btrfs_device *this_dev); 442struct btrfs_device *btrfs_find_device_by_devspec(struct btrfs_fs_info *fs_info, 443 u64 devid, 444 const char *devpath); 445struct btrfs_device *btrfs_alloc_device(struct btrfs_fs_info *fs_info, 446 const u64 *devid, 447 const u8 *uuid); 448void btrfs_free_device(struct btrfs_device *device); 449int btrfs_rm_device(struct btrfs_fs_info *fs_info, 450 const char *device_path, u64 devid); 451void __exit btrfs_cleanup_fs_uuids(void); 452int btrfs_num_copies(struct btrfs_fs_info *fs_info, u64 logical, u64 len); 453int btrfs_grow_device(struct btrfs_trans_handle *trans, 454 struct btrfs_device *device, u64 new_size); 455struct btrfs_device *btrfs_find_device(struct btrfs_fs_devices *fs_devices, | 457void btrfs_assign_next_active_device(struct btrfs_device *device, 458 struct btrfs_device *this_dev); 459struct btrfs_device *btrfs_find_device_by_devspec(struct btrfs_fs_info *fs_info, 460 u64 devid, 461 const char *devpath); 462struct btrfs_device *btrfs_alloc_device(struct btrfs_fs_info *fs_info, 463 const u64 *devid, 464 const u8 *uuid); 465void btrfs_free_device(struct btrfs_device *device); 466int btrfs_rm_device(struct btrfs_fs_info *fs_info, 467 const char *device_path, u64 devid); 468void __exit btrfs_cleanup_fs_uuids(void); 469int btrfs_num_copies(struct btrfs_fs_info *fs_info, u64 logical, u64 len); 470int btrfs_grow_device(struct btrfs_trans_handle *trans, 471 struct btrfs_device *device, u64 new_size); 472struct btrfs_device *btrfs_find_device(struct btrfs_fs_devices *fs_devices, |
456 u64 devid, u8 *uuid, u8 *fsid, bool seed); | 473 u64 devid, u8 *uuid, u8 *fsid); |
457int btrfs_shrink_device(struct btrfs_device *device, u64 new_size); 458int btrfs_init_new_device(struct btrfs_fs_info *fs_info, const char *path); 459int btrfs_balance(struct btrfs_fs_info *fs_info, 460 struct btrfs_balance_control *bctl, 461 struct btrfs_ioctl_balance_args *bargs); 462void btrfs_describe_block_groups(u64 flags, char *buf, u32 size_buf); 463int btrfs_resume_balance_async(struct btrfs_fs_info *fs_info); 464int btrfs_recover_balance(struct btrfs_fs_info *fs_info); --- 118 unchanged lines hidden --- | 474int btrfs_shrink_device(struct btrfs_device *device, u64 new_size); 475int btrfs_init_new_device(struct btrfs_fs_info *fs_info, const char *path); 476int btrfs_balance(struct btrfs_fs_info *fs_info, 477 struct btrfs_balance_control *bctl, 478 struct btrfs_ioctl_balance_args *bargs); 479void btrfs_describe_block_groups(u64 flags, char *buf, u32 size_buf); 480int btrfs_resume_balance_async(struct btrfs_fs_info *fs_info); 481int btrfs_recover_balance(struct btrfs_fs_info *fs_info); --- 118 unchanged lines hidden --- |