diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-07-26 18:03:07 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-07-26 18:03:07 -0400 |
commit | d05d7f40791ccbb6e543cc5dd6a6aa08fc71d635 (patch) | |
tree | dc0039fe490a41a70de10d58fe8e6136db46463a /kernel/power | |
parent | 75a442efb1ca613f8d1cc71a32c2c9b0aefae4a5 (diff) | |
parent | 17007f3994cdb4643355c73f54f0adad006cf59e (diff) |
Merge branch 'for-4.8/core' of git://git.kernel.dk/linux-block
Pull core block updates from Jens Axboe:
- the big change is the cleanup from Mike Christie, cleaning up our
uses of command types and modified flags. This is what will throw
some merge conflicts
- regression fix for the above for btrfs, from Vincent
- following up to the above, better packing of struct request from
Christoph
- a 2038 fix for blktrace from Arnd
- a few trivial/spelling fixes from Bart Van Assche
- a front merge check fix from Damien, which could cause issues on
SMR drives
- Atari partition fix from Gabriel
- convert cfq to highres timers, since jiffies isn't granular enough
for some devices these days. From Jan and Jeff
- CFQ priority boost fix idle classes, from me
- cleanup series from Ming, improving our bio/bvec iteration
- a direct issue fix for blk-mq from Omar
- fix for plug merging not involving the IO scheduler, like we do for
other types of merges. From Tahsin
- expose DAX type internally and through sysfs. From Toshi and Yigal
* 'for-4.8/core' of git://git.kernel.dk/linux-block: (76 commits)
block: Fix front merge check
block: do not merge requests without consulting with io scheduler
block: Fix spelling in a source code comment
block: expose QUEUE_FLAG_DAX in sysfs
block: add QUEUE_FLAG_DAX for devices to advertise their DAX support
Btrfs: fix comparison in __btrfs_map_block()
block: atari: Return early for unsupported sector size
Doc: block: Fix a typo in queue-sysfs.txt
cfq-iosched: Charge at least 1 jiffie instead of 1 ns
cfq-iosched: Fix regression in bonnie++ rewrite performance
cfq-iosched: Convert slice_resid from u64 to s64
block: Convert fifo_time from ulong to u64
blktrace: avoid using timespec
block/blk-cgroup.c: Declare local symbols static
block/bio-integrity.c: Add #include "blk.h"
block/partition-generic.c: Remove a set-but-not-used variable
block: bio: kill BIO_MAX_SIZE
cfq-iosched: temporarily boost queue priority for idle classes
block: drbd: avoid to use BIO_MAX_SIZE
block: bio: remove BIO_MAX_SECTORS
...
Diffstat (limited to 'kernel/power')
-rw-r--r-- | kernel/power/swap.c | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/kernel/power/swap.c b/kernel/power/swap.c index 160e1006640d..c1aaac431055 100644 --- a/kernel/power/swap.c +++ b/kernel/power/swap.c | |||
@@ -261,7 +261,7 @@ static void hib_end_io(struct bio *bio) | |||
261 | bio_put(bio); | 261 | bio_put(bio); |
262 | } | 262 | } |
263 | 263 | ||
264 | static int hib_submit_io(int rw, pgoff_t page_off, void *addr, | 264 | static int hib_submit_io(int op, int op_flags, pgoff_t page_off, void *addr, |
265 | struct hib_bio_batch *hb) | 265 | struct hib_bio_batch *hb) |
266 | { | 266 | { |
267 | struct page *page = virt_to_page(addr); | 267 | struct page *page = virt_to_page(addr); |
@@ -271,6 +271,7 @@ static int hib_submit_io(int rw, pgoff_t page_off, void *addr, | |||
271 | bio = bio_alloc(__GFP_RECLAIM | __GFP_HIGH, 1); | 271 | bio = bio_alloc(__GFP_RECLAIM | __GFP_HIGH, 1); |
272 | bio->bi_iter.bi_sector = page_off * (PAGE_SIZE >> 9); | 272 | bio->bi_iter.bi_sector = page_off * (PAGE_SIZE >> 9); |
273 | bio->bi_bdev = hib_resume_bdev; | 273 | bio->bi_bdev = hib_resume_bdev; |
274 | bio_set_op_attrs(bio, op, op_flags); | ||
274 | 275 | ||
275 | if (bio_add_page(bio, page, PAGE_SIZE, 0) < PAGE_SIZE) { | 276 | if (bio_add_page(bio, page, PAGE_SIZE, 0) < PAGE_SIZE) { |
276 | printk(KERN_ERR "PM: Adding page to bio failed at %llu\n", | 277 | printk(KERN_ERR "PM: Adding page to bio failed at %llu\n", |
@@ -283,9 +284,9 @@ static int hib_submit_io(int rw, pgoff_t page_off, void *addr, | |||
283 | bio->bi_end_io = hib_end_io; | 284 | bio->bi_end_io = hib_end_io; |
284 | bio->bi_private = hb; | 285 | bio->bi_private = hb; |
285 | atomic_inc(&hb->count); | 286 | atomic_inc(&hb->count); |
286 | submit_bio(rw, bio); | 287 | submit_bio(bio); |
287 | } else { | 288 | } else { |
288 | error = submit_bio_wait(rw, bio); | 289 | error = submit_bio_wait(bio); |
289 | bio_put(bio); | 290 | bio_put(bio); |
290 | } | 291 | } |
291 | 292 | ||
@@ -306,7 +307,8 @@ static int mark_swapfiles(struct swap_map_handle *handle, unsigned int flags) | |||
306 | { | 307 | { |
307 | int error; | 308 | int error; |
308 | 309 | ||
309 | hib_submit_io(READ_SYNC, swsusp_resume_block, swsusp_header, NULL); | 310 | hib_submit_io(REQ_OP_READ, READ_SYNC, swsusp_resume_block, |
311 | swsusp_header, NULL); | ||
310 | if (!memcmp("SWAP-SPACE",swsusp_header->sig, 10) || | 312 | if (!memcmp("SWAP-SPACE",swsusp_header->sig, 10) || |
311 | !memcmp("SWAPSPACE2",swsusp_header->sig, 10)) { | 313 | !memcmp("SWAPSPACE2",swsusp_header->sig, 10)) { |
312 | memcpy(swsusp_header->orig_sig,swsusp_header->sig, 10); | 314 | memcpy(swsusp_header->orig_sig,swsusp_header->sig, 10); |
@@ -315,8 +317,8 @@ static int mark_swapfiles(struct swap_map_handle *handle, unsigned int flags) | |||
315 | swsusp_header->flags = flags; | 317 | swsusp_header->flags = flags; |
316 | if (flags & SF_CRC32_MODE) | 318 | if (flags & SF_CRC32_MODE) |
317 | swsusp_header->crc32 = handle->crc32; | 319 | swsusp_header->crc32 = handle->crc32; |
318 | error = hib_submit_io(WRITE_SYNC, swsusp_resume_block, | 320 | error = hib_submit_io(REQ_OP_WRITE, WRITE_SYNC, |
319 | swsusp_header, NULL); | 321 | swsusp_resume_block, swsusp_header, NULL); |
320 | } else { | 322 | } else { |
321 | printk(KERN_ERR "PM: Swap header not found!\n"); | 323 | printk(KERN_ERR "PM: Swap header not found!\n"); |
322 | error = -ENODEV; | 324 | error = -ENODEV; |
@@ -389,7 +391,7 @@ static int write_page(void *buf, sector_t offset, struct hib_bio_batch *hb) | |||
389 | } else { | 391 | } else { |
390 | src = buf; | 392 | src = buf; |
391 | } | 393 | } |
392 | return hib_submit_io(WRITE_SYNC, offset, src, hb); | 394 | return hib_submit_io(REQ_OP_WRITE, WRITE_SYNC, offset, src, hb); |
393 | } | 395 | } |
394 | 396 | ||
395 | static void release_swap_writer(struct swap_map_handle *handle) | 397 | static void release_swap_writer(struct swap_map_handle *handle) |
@@ -992,7 +994,8 @@ static int get_swap_reader(struct swap_map_handle *handle, | |||
992 | return -ENOMEM; | 994 | return -ENOMEM; |
993 | } | 995 | } |
994 | 996 | ||
995 | error = hib_submit_io(READ_SYNC, offset, tmp->map, NULL); | 997 | error = hib_submit_io(REQ_OP_READ, READ_SYNC, offset, |
998 | tmp->map, NULL); | ||
996 | if (error) { | 999 | if (error) { |
997 | release_swap_reader(handle); | 1000 | release_swap_reader(handle); |
998 | return error; | 1001 | return error; |
@@ -1016,7 +1019,7 @@ static int swap_read_page(struct swap_map_handle *handle, void *buf, | |||
1016 | offset = handle->cur->entries[handle->k]; | 1019 | offset = handle->cur->entries[handle->k]; |
1017 | if (!offset) | 1020 | if (!offset) |
1018 | return -EFAULT; | 1021 | return -EFAULT; |
1019 | error = hib_submit_io(READ_SYNC, offset, buf, hb); | 1022 | error = hib_submit_io(REQ_OP_READ, READ_SYNC, offset, buf, hb); |
1020 | if (error) | 1023 | if (error) |
1021 | return error; | 1024 | return error; |
1022 | if (++handle->k >= MAP_PAGE_ENTRIES) { | 1025 | if (++handle->k >= MAP_PAGE_ENTRIES) { |
@@ -1525,7 +1528,8 @@ int swsusp_check(void) | |||
1525 | if (!IS_ERR(hib_resume_bdev)) { | 1528 | if (!IS_ERR(hib_resume_bdev)) { |
1526 | set_blocksize(hib_resume_bdev, PAGE_SIZE); | 1529 | set_blocksize(hib_resume_bdev, PAGE_SIZE); |
1527 | clear_page(swsusp_header); | 1530 | clear_page(swsusp_header); |
1528 | error = hib_submit_io(READ_SYNC, swsusp_resume_block, | 1531 | error = hib_submit_io(REQ_OP_READ, READ_SYNC, |
1532 | swsusp_resume_block, | ||
1529 | swsusp_header, NULL); | 1533 | swsusp_header, NULL); |
1530 | if (error) | 1534 | if (error) |
1531 | goto put; | 1535 | goto put; |
@@ -1533,7 +1537,8 @@ int swsusp_check(void) | |||
1533 | if (!memcmp(HIBERNATE_SIG, swsusp_header->sig, 10)) { | 1537 | if (!memcmp(HIBERNATE_SIG, swsusp_header->sig, 10)) { |
1534 | memcpy(swsusp_header->sig, swsusp_header->orig_sig, 10); | 1538 | memcpy(swsusp_header->sig, swsusp_header->orig_sig, 10); |
1535 | /* Reset swap signature now */ | 1539 | /* Reset swap signature now */ |
1536 | error = hib_submit_io(WRITE_SYNC, swsusp_resume_block, | 1540 | error = hib_submit_io(REQ_OP_WRITE, WRITE_SYNC, |
1541 | swsusp_resume_block, | ||
1537 | swsusp_header, NULL); | 1542 | swsusp_header, NULL); |
1538 | } else { | 1543 | } else { |
1539 | error = -EINVAL; | 1544 | error = -EINVAL; |
@@ -1577,10 +1582,12 @@ int swsusp_unmark(void) | |||
1577 | { | 1582 | { |
1578 | int error; | 1583 | int error; |
1579 | 1584 | ||
1580 | hib_submit_io(READ_SYNC, swsusp_resume_block, swsusp_header, NULL); | 1585 | hib_submit_io(REQ_OP_READ, READ_SYNC, swsusp_resume_block, |
1586 | swsusp_header, NULL); | ||
1581 | if (!memcmp(HIBERNATE_SIG,swsusp_header->sig, 10)) { | 1587 | if (!memcmp(HIBERNATE_SIG,swsusp_header->sig, 10)) { |
1582 | memcpy(swsusp_header->sig,swsusp_header->orig_sig, 10); | 1588 | memcpy(swsusp_header->sig,swsusp_header->orig_sig, 10); |
1583 | error = hib_submit_io(WRITE_SYNC, swsusp_resume_block, | 1589 | error = hib_submit_io(REQ_OP_WRITE, WRITE_SYNC, |
1590 | swsusp_resume_block, | ||
1584 | swsusp_header, NULL); | 1591 | swsusp_header, NULL); |
1585 | } else { | 1592 | } else { |
1586 | printk(KERN_ERR "PM: Cannot find swsusp signature!\n"); | 1593 | printk(KERN_ERR "PM: Cannot find swsusp signature!\n"); |