diff options
Diffstat (limited to 'drivers/md/dm-log.c')
-rw-r--r-- | drivers/md/dm-log.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/md/dm-log.c b/drivers/md/dm-log.c index 5a08be0222db..948e3f4925bf 100644 --- a/drivers/md/dm-log.c +++ b/drivers/md/dm-log.c | |||
@@ -251,20 +251,20 @@ struct log_c { | |||
251 | */ | 251 | */ |
252 | static inline int log_test_bit(uint32_t *bs, unsigned bit) | 252 | static inline int log_test_bit(uint32_t *bs, unsigned bit) |
253 | { | 253 | { |
254 | return ext2_test_bit(bit, (unsigned long *) bs) ? 1 : 0; | 254 | return test_bit_le(bit, (unsigned long *) bs) ? 1 : 0; |
255 | } | 255 | } |
256 | 256 | ||
257 | static inline void log_set_bit(struct log_c *l, | 257 | static inline void log_set_bit(struct log_c *l, |
258 | uint32_t *bs, unsigned bit) | 258 | uint32_t *bs, unsigned bit) |
259 | { | 259 | { |
260 | ext2_set_bit(bit, (unsigned long *) bs); | 260 | __test_and_set_bit_le(bit, (unsigned long *) bs); |
261 | l->touched_cleaned = 1; | 261 | l->touched_cleaned = 1; |
262 | } | 262 | } |
263 | 263 | ||
264 | static inline void log_clear_bit(struct log_c *l, | 264 | static inline void log_clear_bit(struct log_c *l, |
265 | uint32_t *bs, unsigned bit) | 265 | uint32_t *bs, unsigned bit) |
266 | { | 266 | { |
267 | ext2_clear_bit(bit, (unsigned long *) bs); | 267 | __test_and_clear_bit_le(bit, (unsigned long *) bs); |
268 | l->touched_dirtied = 1; | 268 | l->touched_dirtied = 1; |
269 | } | 269 | } |
270 | 270 | ||
@@ -300,7 +300,7 @@ static int flush_header(struct log_c *lc) | |||
300 | .count = 0, | 300 | .count = 0, |
301 | }; | 301 | }; |
302 | 302 | ||
303 | lc->io_req.bi_rw = WRITE_BARRIER; | 303 | lc->io_req.bi_rw = WRITE_FLUSH; |
304 | 304 | ||
305 | return dm_io(&lc->io_req, 1, &null_location, NULL); | 305 | return dm_io(&lc->io_req, 1, &null_location, NULL); |
306 | } | 306 | } |
@@ -449,13 +449,12 @@ static int create_log_context(struct dm_dirty_log *log, struct dm_target *ti, | |||
449 | 449 | ||
450 | lc->io_req.mem.type = DM_IO_VMA; | 450 | lc->io_req.mem.type = DM_IO_VMA; |
451 | lc->io_req.notify.fn = NULL; | 451 | lc->io_req.notify.fn = NULL; |
452 | lc->io_req.client = dm_io_client_create(dm_div_up(buf_size, | 452 | lc->io_req.client = dm_io_client_create(); |
453 | PAGE_SIZE)); | ||
454 | if (IS_ERR(lc->io_req.client)) { | 453 | if (IS_ERR(lc->io_req.client)) { |
455 | r = PTR_ERR(lc->io_req.client); | 454 | r = PTR_ERR(lc->io_req.client); |
456 | DMWARN("couldn't allocate disk io client"); | 455 | DMWARN("couldn't allocate disk io client"); |
457 | kfree(lc); | 456 | kfree(lc); |
458 | return -ENOMEM; | 457 | return r; |
459 | } | 458 | } |
460 | 459 | ||
461 | lc->disk_header = vmalloc(buf_size); | 460 | lc->disk_header = vmalloc(buf_size); |
@@ -543,7 +542,7 @@ static int disk_ctr(struct dm_dirty_log *log, struct dm_target *ti, | |||
543 | return -EINVAL; | 542 | return -EINVAL; |
544 | } | 543 | } |
545 | 544 | ||
546 | r = dm_get_device(ti, argv[0], FMODE_READ | FMODE_WRITE, &dev); | 545 | r = dm_get_device(ti, argv[0], dm_table_get_mode(ti->table), &dev); |
547 | if (r) | 546 | if (r) |
548 | return r; | 547 | return r; |
549 | 548 | ||
@@ -740,7 +739,7 @@ static int core_get_resync_work(struct dm_dirty_log *log, region_t *region) | |||
740 | return 0; | 739 | return 0; |
741 | 740 | ||
742 | do { | 741 | do { |
743 | *region = ext2_find_next_zero_bit( | 742 | *region = find_next_zero_bit_le( |
744 | (unsigned long *) lc->sync_bits, | 743 | (unsigned long *) lc->sync_bits, |
745 | lc->region_count, | 744 | lc->region_count, |
746 | lc->sync_search); | 745 | lc->sync_search); |