mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 14:11:52 +00:00
btrfs: move btrfs_swapfile_pin into volumes.h
This isn't a great spot for this, but one of the swapfile helper functions is in volumes.c, so move the struct to volumes.h. In the future when we have better separation of code there will be a more natural spot for this. Reviewed-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
c2e79e865b
commit
2103da3b0e
@ -535,31 +535,6 @@ struct btrfs_fs_devices;
|
||||
struct btrfs_balance_control;
|
||||
struct btrfs_delayed_root;
|
||||
|
||||
/*
|
||||
* Block group or device which contains an active swapfile. Used for preventing
|
||||
* unsafe operations while a swapfile is active.
|
||||
*
|
||||
* These are sorted on (ptr, inode) (note that a block group or device can
|
||||
* contain more than one swapfile). We compare the pointer values because we
|
||||
* don't actually care what the object is, we just need a quick check whether
|
||||
* the object exists in the rbtree.
|
||||
*/
|
||||
struct btrfs_swapfile_pin {
|
||||
struct rb_node node;
|
||||
void *ptr;
|
||||
struct inode *inode;
|
||||
/*
|
||||
* If true, ptr points to a struct btrfs_block_group. Otherwise, ptr
|
||||
* points to a struct btrfs_device.
|
||||
*/
|
||||
bool is_block_group;
|
||||
/*
|
||||
* Only used when 'is_block_group' is true and it is the number of
|
||||
* extents used by a swapfile for this block group ('ptr' field).
|
||||
*/
|
||||
int bg_extent_count;
|
||||
};
|
||||
|
||||
enum {
|
||||
BTRFS_FS_CLOSING_START,
|
||||
BTRFS_FS_CLOSING_DONE,
|
||||
|
@ -180,6 +180,31 @@ struct btrfs_device {
|
||||
u64 scrub_speed_max;
|
||||
};
|
||||
|
||||
/*
|
||||
* Block group or device which contains an active swapfile. Used for preventing
|
||||
* unsafe operations while a swapfile is active.
|
||||
*
|
||||
* These are sorted on (ptr, inode) (note that a block group or device can
|
||||
* contain more than one swapfile). We compare the pointer values because we
|
||||
* don't actually care what the object is, we just need a quick check whether
|
||||
* the object exists in the rbtree.
|
||||
*/
|
||||
struct btrfs_swapfile_pin {
|
||||
struct rb_node node;
|
||||
void *ptr;
|
||||
struct inode *inode;
|
||||
/*
|
||||
* If true, ptr points to a struct btrfs_block_group. Otherwise, ptr
|
||||
* points to a struct btrfs_device.
|
||||
*/
|
||||
bool is_block_group;
|
||||
/*
|
||||
* Only used when 'is_block_group' is true and it is the number of
|
||||
* extents used by a swapfile for this block group ('ptr' field).
|
||||
*/
|
||||
int bg_extent_count;
|
||||
};
|
||||
|
||||
/*
|
||||
* If we read those variants at the context of their own lock, we needn't
|
||||
* use the following helpers, reading them directly is safe.
|
||||
|
Loading…
Reference in New Issue
Block a user