diff options
author | Zach Brown <zab@redhat.com> | 2013-10-16 15:10:32 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2013-11-11 22:03:00 -0500 |
commit | 4546bcaeba435c1d0b7f38c011cbb2367497ca8d (patch) | |
tree | fa87d963c9d69a3c2e6db057614abbbd197209d8 /fs/btrfs/dev-replace.c | |
parent | 8185554d3eb09d23a805456b6fa98dcbb34aa518 (diff) |
btrfs: use get_seconds() instead of btrfs wrapper
Signed-off-by: Zach Brown <zab@redhat.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs/btrfs/dev-replace.c')
-rw-r--r-- | fs/btrfs/dev-replace.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/fs/btrfs/dev-replace.c b/fs/btrfs/dev-replace.c index 98df26181349..a36343a2dd68 100644 --- a/fs/btrfs/dev-replace.c +++ b/fs/btrfs/dev-replace.c | |||
@@ -38,7 +38,6 @@ | |||
38 | #include "rcu-string.h" | 38 | #include "rcu-string.h" |
39 | #include "dev-replace.h" | 39 | #include "dev-replace.h" |
40 | 40 | ||
41 | static u64 btrfs_get_seconds_since_1970(void); | ||
42 | static int btrfs_dev_replace_finishing(struct btrfs_fs_info *fs_info, | 41 | static int btrfs_dev_replace_finishing(struct btrfs_fs_info *fs_info, |
43 | int scrub_ret); | 42 | int scrub_ret); |
44 | static void btrfs_dev_replace_update_device_in_mapping_tree( | 43 | static void btrfs_dev_replace_update_device_in_mapping_tree( |
@@ -296,13 +295,6 @@ void btrfs_after_dev_replace_commit(struct btrfs_fs_info *fs_info) | |||
296 | dev_replace->cursor_left_last_write_of_item; | 295 | dev_replace->cursor_left_last_write_of_item; |
297 | } | 296 | } |
298 | 297 | ||
299 | static u64 btrfs_get_seconds_since_1970(void) | ||
300 | { | ||
301 | struct timespec t = CURRENT_TIME_SEC; | ||
302 | |||
303 | return t.tv_sec; | ||
304 | } | ||
305 | |||
306 | int btrfs_dev_replace_start(struct btrfs_root *root, | 298 | int btrfs_dev_replace_start(struct btrfs_root *root, |
307 | struct btrfs_ioctl_dev_replace_args *args) | 299 | struct btrfs_ioctl_dev_replace_args *args) |
308 | { | 300 | { |
@@ -390,7 +382,7 @@ int btrfs_dev_replace_start(struct btrfs_root *root, | |||
390 | * go to the tgtdev as well (refer to btrfs_map_block()). | 382 | * go to the tgtdev as well (refer to btrfs_map_block()). |
391 | */ | 383 | */ |
392 | dev_replace->replace_state = BTRFS_IOCTL_DEV_REPLACE_STATE_STARTED; | 384 | dev_replace->replace_state = BTRFS_IOCTL_DEV_REPLACE_STATE_STARTED; |
393 | dev_replace->time_started = btrfs_get_seconds_since_1970(); | 385 | dev_replace->time_started = get_seconds(); |
394 | dev_replace->cursor_left = 0; | 386 | dev_replace->cursor_left = 0; |
395 | dev_replace->committed_cursor_left = 0; | 387 | dev_replace->committed_cursor_left = 0; |
396 | dev_replace->cursor_left_last_write_of_item = 0; | 388 | dev_replace->cursor_left_last_write_of_item = 0; |
@@ -493,7 +485,7 @@ static int btrfs_dev_replace_finishing(struct btrfs_fs_info *fs_info, | |||
493 | : BTRFS_IOCTL_DEV_REPLACE_STATE_FINISHED; | 485 | : BTRFS_IOCTL_DEV_REPLACE_STATE_FINISHED; |
494 | dev_replace->tgtdev = NULL; | 486 | dev_replace->tgtdev = NULL; |
495 | dev_replace->srcdev = NULL; | 487 | dev_replace->srcdev = NULL; |
496 | dev_replace->time_stopped = btrfs_get_seconds_since_1970(); | 488 | dev_replace->time_stopped = get_seconds(); |
497 | dev_replace->item_needs_writeback = 1; | 489 | dev_replace->item_needs_writeback = 1; |
498 | 490 | ||
499 | if (scrub_ret) { | 491 | if (scrub_ret) { |
@@ -671,7 +663,7 @@ static u64 __btrfs_dev_replace_cancel(struct btrfs_fs_info *fs_info) | |||
671 | break; | 663 | break; |
672 | } | 664 | } |
673 | dev_replace->replace_state = BTRFS_IOCTL_DEV_REPLACE_STATE_CANCELED; | 665 | dev_replace->replace_state = BTRFS_IOCTL_DEV_REPLACE_STATE_CANCELED; |
674 | dev_replace->time_stopped = btrfs_get_seconds_since_1970(); | 666 | dev_replace->time_stopped = get_seconds(); |
675 | dev_replace->item_needs_writeback = 1; | 667 | dev_replace->item_needs_writeback = 1; |
676 | btrfs_dev_replace_unlock(dev_replace); | 668 | btrfs_dev_replace_unlock(dev_replace); |
677 | btrfs_scrub_cancel(fs_info); | 669 | btrfs_scrub_cancel(fs_info); |
@@ -706,7 +698,7 @@ void btrfs_dev_replace_suspend_for_unmount(struct btrfs_fs_info *fs_info) | |||
706 | case BTRFS_IOCTL_DEV_REPLACE_STATE_STARTED: | 698 | case BTRFS_IOCTL_DEV_REPLACE_STATE_STARTED: |
707 | dev_replace->replace_state = | 699 | dev_replace->replace_state = |
708 | BTRFS_IOCTL_DEV_REPLACE_STATE_SUSPENDED; | 700 | BTRFS_IOCTL_DEV_REPLACE_STATE_SUSPENDED; |
709 | dev_replace->time_stopped = btrfs_get_seconds_since_1970(); | 701 | dev_replace->time_stopped = get_seconds(); |
710 | dev_replace->item_needs_writeback = 1; | 702 | dev_replace->item_needs_writeback = 1; |
711 | pr_info("btrfs: suspending dev_replace for unmount\n"); | 703 | pr_info("btrfs: suspending dev_replace for unmount\n"); |
712 | break; | 704 | break; |