diff options
author | Chris Mason <chris.mason@oracle.com> | 2008-03-24 15:05:44 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@hera.kernel.org> | 2008-03-24 15:05:44 -0400 |
commit | 0dcfa3b8270f38edacee1c62f308129c36073d0c (patch) | |
tree | 74e084b5cceed48161b5ca1508a88afd6f8ca8b1 /volumes.h | |
parent | 26afd0f31d59853f51120622b0121cdfc72cd398 (diff) |
Walk all block devices looking for btrfs
Diffstat (limited to 'volumes.h')
-rw-r--r-- | volumes.h | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -24,6 +24,8 @@ struct btrfs_device { int fd; + char *name; + /* the internal btrfs device id */ u64 devid; @@ -49,6 +51,19 @@ struct btrfs_device { u8 uuid[BTRFS_DEV_UUID_SIZE]; }; +struct btrfs_fs_devices { + u8 fsid[BTRFS_FSID_SIZE]; /* FS specific uuid */ + + /* the device with this id has the most recent coyp of the super */ + u64 latest_devid; + u64 latest_trans; + u64 lowest_devid; + int latest_bdev; + int lowest_bdev; + struct list_head devices; + struct list_head list; +}; + int btrfs_alloc_dev_extent(struct btrfs_trans_handle *trans, struct btrfs_device *device, u64 owner, u64 num_bytes, u64 *start); @@ -64,4 +79,13 @@ int btrfs_read_super_device(struct btrfs_root *root, struct extent_buffer *buf); int btrfs_add_device(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_device *device); +int btrfs_open_devices(struct btrfs_fs_devices *fs_devices, + int flags); +int btrfs_close_devices(struct btrfs_fs_devices *fs_devices); +int btrfs_add_device(struct btrfs_trans_handle *trans, + struct btrfs_root *root, + struct btrfs_device *device); +int btrfs_scan_one_device(int fd, const char *path, + struct btrfs_fs_devices **fs_devices_ret, + u64 *total_devs, u64 super_offset); #endif |