]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - fs/btrfs/volumes.h
Btrfs: Add support for device scanning and detection ioctls
[mv-sheeva.git] / fs / btrfs / volumes.h
index 4ab9891878a86d8ce87fc004550401f2f0e5e260..12f297eb05597313c2f370cf502d75dffb693102 100644 (file)
 struct btrfs_device {
        struct list_head dev_list;
        struct btrfs_root *dev_root;
-       struct btrfs_key dev_key;
 
        struct block_device *bdev;
 
+       char *name;
+
        /* the internal btrfs device id */
        u64 devid;
 
@@ -43,22 +44,25 @@ struct btrfs_device {
        /* minimal io size for this device */
        u32 sector_size;
 
-       /* the kernel device number */
-       u64 rdev;
-
        /* type and info about this device */
        u64 type;
 
-       /* partition number, 0 for whole dev */
-       int partition;
-
-       /* length of the name data at the end of the item */
-       int name_len;
-
        /* physical drive uuid (or lvm uuid) */
        u8 uuid[BTRFS_DEV_UUID_SIZE];
+};
 
-       char *name;
+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;
+       u64 num_devices;
+       struct block_device *latest_bdev;
+       struct block_device *lowest_bdev;
+       struct list_head devices;
+       struct list_head list;
 };
 
 int btrfs_alloc_dev_extent(struct btrfs_trans_handle *trans,
@@ -75,4 +79,17 @@ int btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
 void btrfs_mapping_init(struct btrfs_mapping_tree *tree);
 void btrfs_mapping_tree_free(struct btrfs_mapping_tree *tree);
 int btrfs_map_bio(struct btrfs_root *root, int rw, struct bio *bio);
+int btrfs_read_super_device(struct btrfs_root *root, struct extent_buffer *buf);
+int btrfs_map_block(struct btrfs_mapping_tree *map_tree,
+                   u64 logical, u64 *phys, u64 *length,
+                   struct btrfs_device **dev);
+int btrfs_open_devices(struct btrfs_fs_devices *fs_devices,
+                      int flags, void *holder);
+int btrfs_scan_one_device(const char *path, int flags, void *holder,
+                         struct btrfs_fs_devices **fs_devices_ret);
+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_cleanup_fs_uuids(void);
 #endif