~ubuntu-branches/ubuntu/quantal/linux-linaro-mx51/quantal

« back to all changes in this revision

Viewing changes to fs/btrfs/volumes.h

  • Committer: Package Import Robot
  • Author(s): John Rigby, John Rigby
  • Date: 2011-09-26 10:44:23 UTC
  • Revision ID: package-import@ubuntu.com-20110926104423-3o58a3c1bj7x00rs
Tags: 3.0.0-1007.9
[ John Rigby ]

Enable crypto modules and remove crypto-modules from
exclude-module files
LP: #826021

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
        int writeable;
49
49
        int in_fs_metadata;
50
50
        int missing;
 
51
        int can_discard;
51
52
 
52
53
        spinlock_t io_lock;
53
54
 
85
86
        /* physical drive uuid (or lvm uuid) */
86
87
        u8 uuid[BTRFS_UUID_SIZE];
87
88
 
 
89
        /* per-device scrub information */
 
90
        struct scrub_dev *scrub_device;
 
91
 
88
92
        struct btrfs_work work;
 
93
        struct rcu_head rcu;
 
94
        struct work_struct rcu_work;
89
95
};
90
96
 
91
97
struct btrfs_fs_devices {
99
105
        u64 rw_devices;
100
106
        u64 missing_devices;
101
107
        u64 total_rw_bytes;
 
108
        u64 num_can_discard;
102
109
        struct block_device *latest_bdev;
103
110
 
104
111
        /* all of the devices in the FS, protected by a mutex
144
151
        struct btrfs_device *dev;
145
152
        u64 dev_offset;
146
153
        u64 max_avail;
 
154
        u64 total_avail;
147
155
};
148
156
 
149
157
struct map_lookup {
157
165
        struct btrfs_bio_stripe stripes[];
158
166
};
159
167
 
160
 
/* Used to sort the devices by max_avail(descending sort) */
161
 
int btrfs_cmp_device_free_bytes(const void *dev_info1, const void *dev_info2);
162
 
 
163
 
/*
164
 
 * sort the devices by max_avail, in which max free extent size of each device
165
 
 * is stored.(Descending Sort)
166
 
 */
167
 
static inline void btrfs_descending_sort_devices(
168
 
                                        struct btrfs_device_info *devices,
169
 
                                        size_t nr_devices)
170
 
{
171
 
        sort(devices, nr_devices, sizeof(struct btrfs_device_info),
172
 
             btrfs_cmp_device_free_bytes, NULL);
173
 
}
 
168
#define map_lookup_size(n) (sizeof(struct map_lookup) + \
 
169
                            (sizeof(struct btrfs_bio_stripe) * (n)))
174
170
 
175
171
int btrfs_account_dev_extents_size(struct btrfs_device *device, u64 start,
176
172
                                   u64 end, u64 *length);
196
192
void btrfs_mapping_tree_free(struct btrfs_mapping_tree *tree);
197
193
int btrfs_map_bio(struct btrfs_root *root, int rw, struct bio *bio,
198
194
                  int mirror_num, int async_submit);
199
 
int btrfs_read_super_device(struct btrfs_root *root, struct extent_buffer *buf);
200
195
int btrfs_open_devices(struct btrfs_fs_devices *fs_devices,
201
196
                       fmode_t flags, void *holder);
202
197
int btrfs_scan_one_device(const char *path, fmode_t flags, void *holder,
209
204
int btrfs_rm_device(struct btrfs_root *root, char *device_path);
210
205
int btrfs_cleanup_fs_uuids(void);
211
206
int btrfs_num_copies(struct btrfs_mapping_tree *map_tree, u64 logical, u64 len);
212
 
int btrfs_unplug_page(struct btrfs_mapping_tree *map_tree,
213
 
                      u64 logical, struct page *page);
214
207
int btrfs_grow_device(struct btrfs_trans_handle *trans,
215
208
                      struct btrfs_device *device, u64 new_size);
216
209
struct btrfs_device *btrfs_find_device(struct btrfs_root *root, u64 devid,
218
211
int btrfs_shrink_device(struct btrfs_device *device, u64 new_size);
219
212
int btrfs_init_new_device(struct btrfs_root *root, char *path);
220
213
int btrfs_balance(struct btrfs_root *dev_root);
221
 
void btrfs_unlock_volumes(void);
222
 
void btrfs_lock_volumes(void);
223
214
int btrfs_chunk_readonly(struct btrfs_root *root, u64 chunk_offset);
224
215
int find_free_dev_extent(struct btrfs_trans_handle *trans,
225
216
                         struct btrfs_device *device, u64 num_bytes,