raid5-cache.c (4d5324f760aacaefeb721b172aa14bf66045c332) | raid5-cache.c (b03e0ccb5ab9df3efbe51c87843a1ffbecbafa1f) |
---|---|
1/* 2 * Copyright (C) 2015 Shaohua Li <shli@fb.com> 3 * Copyright (C) 2016 Song Liu <songliubraving@fb.com> 4 * 5 * This program is free software; you can redistribute it and/or modify it 6 * under the terms and conditions of the GNU General Public License, 7 * version 2, as published by the Free Software Foundation. 8 * --- 1575 unchanged lines hidden (view full) --- 1584 do { 1585 target = log->reclaim_target; 1586 if (new < target) 1587 return; 1588 } while (cmpxchg(&log->reclaim_target, target, new) != target); 1589 md_wakeup_thread(log->reclaim_thread); 1590} 1591 | 1/* 2 * Copyright (C) 2015 Shaohua Li <shli@fb.com> 3 * Copyright (C) 2016 Song Liu <songliubraving@fb.com> 4 * 5 * This program is free software; you can redistribute it and/or modify it 6 * under the terms and conditions of the GNU General Public License, 7 * version 2, as published by the Free Software Foundation. 8 * --- 1575 unchanged lines hidden (view full) --- 1584 do { 1585 target = log->reclaim_target; 1586 if (new < target) 1587 return; 1588 } while (cmpxchg(&log->reclaim_target, target, new) != target); 1589 md_wakeup_thread(log->reclaim_thread); 1590} 1591 |
1592void r5l_quiesce(struct r5l_log *log, int state) | 1592void r5l_quiesce(struct r5l_log *log, int quiesce) |
1593{ 1594 struct mddev *mddev; | 1593{ 1594 struct mddev *mddev; |
1595 if (!log || state == 2) | 1595 if (!log) |
1596 return; | 1596 return; |
1597 if (state == 0) 1598 kthread_unpark(log->reclaim_thread->tsk); 1599 else if (state == 1) { | 1597 1598 if (quiesce) { |
1600 /* make sure r5l_write_super_and_discard_space exits */ 1601 mddev = log->rdev->mddev; 1602 wake_up(&mddev->sb_wait); 1603 kthread_park(log->reclaim_thread->tsk); 1604 r5l_wake_reclaim(log, MaxSector); 1605 r5l_do_reclaim(log); | 1599 /* make sure r5l_write_super_and_discard_space exits */ 1600 mddev = log->rdev->mddev; 1601 wake_up(&mddev->sb_wait); 1602 kthread_park(log->reclaim_thread->tsk); 1603 r5l_wake_reclaim(log, MaxSector); 1604 r5l_do_reclaim(log); |
1606 } | 1605 } else 1606 kthread_unpark(log->reclaim_thread->tsk); |
1607} 1608 1609bool r5l_log_disk_error(struct r5conf *conf) 1610{ 1611 struct r5l_log *log; 1612 bool ret; 1613 /* don't allow write if journal disk is missing */ 1614 rcu_read_lock(); --- 1569 unchanged lines hidden --- | 1607} 1608 1609bool r5l_log_disk_error(struct r5conf *conf) 1610{ 1611 struct r5l_log *log; 1612 bool ret; 1613 /* don't allow write if journal disk is missing */ 1614 rcu_read_lock(); --- 1569 unchanged lines hidden --- |