diff options
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_super.c')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_super.c | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c index 70024a24692d..156a1a7da16b 100644 --- a/fs/xfs/linux-2.6/xfs_super.c +++ b/fs/xfs/linux-2.6/xfs_super.c | |||
@@ -51,6 +51,7 @@ | |||
51 | #include "xfs_vfsops.h" | 51 | #include "xfs_vfsops.h" |
52 | #include "xfs_version.h" | 52 | #include "xfs_version.h" |
53 | #include "xfs_log_priv.h" | 53 | #include "xfs_log_priv.h" |
54 | #include "xfs_trans_priv.h" | ||
54 | 55 | ||
55 | #include <linux/namei.h> | 56 | #include <linux/namei.h> |
56 | #include <linux/init.h> | 57 | #include <linux/init.h> |
@@ -765,6 +766,64 @@ xfs_blkdev_issue_flush( | |||
765 | blkdev_issue_flush(buftarg->bt_bdev, NULL); | 766 | blkdev_issue_flush(buftarg->bt_bdev, NULL); |
766 | } | 767 | } |
767 | 768 | ||
769 | /* | ||
770 | * XFS AIL push thread support | ||
771 | */ | ||
772 | void | ||
773 | xfsaild_wakeup( | ||
774 | xfs_mount_t *mp, | ||
775 | xfs_lsn_t threshold_lsn) | ||
776 | { | ||
777 | mp->m_ail.xa_target = threshold_lsn; | ||
778 | wake_up_process(mp->m_ail.xa_task); | ||
779 | } | ||
780 | |||
781 | int | ||
782 | xfsaild( | ||
783 | void *data) | ||
784 | { | ||
785 | xfs_mount_t *mp = (xfs_mount_t *)data; | ||
786 | xfs_lsn_t last_pushed_lsn = 0; | ||
787 | long tout = 0; | ||
788 | |||
789 | while (!kthread_should_stop()) { | ||
790 | if (tout) | ||
791 | schedule_timeout_interruptible(msecs_to_jiffies(tout)); | ||
792 | tout = 1000; | ||
793 | |||
794 | /* swsusp */ | ||
795 | try_to_freeze(); | ||
796 | |||
797 | ASSERT(mp->m_log); | ||
798 | if (XFS_FORCED_SHUTDOWN(mp)) | ||
799 | continue; | ||
800 | |||
801 | tout = xfsaild_push(mp, &last_pushed_lsn); | ||
802 | } | ||
803 | |||
804 | return 0; | ||
805 | } /* xfsaild */ | ||
806 | |||
807 | int | ||
808 | xfsaild_start( | ||
809 | xfs_mount_t *mp) | ||
810 | { | ||
811 | mp->m_ail.xa_target = 0; | ||
812 | mp->m_ail.xa_task = kthread_run(xfsaild, mp, "xfsaild"); | ||
813 | if (IS_ERR(mp->m_ail.xa_task)) | ||
814 | return -PTR_ERR(mp->m_ail.xa_task); | ||
815 | return 0; | ||
816 | } | ||
817 | |||
818 | void | ||
819 | xfsaild_stop( | ||
820 | xfs_mount_t *mp) | ||
821 | { | ||
822 | kthread_stop(mp->m_ail.xa_task); | ||
823 | } | ||
824 | |||
825 | |||
826 | |||
768 | STATIC struct inode * | 827 | STATIC struct inode * |
769 | xfs_fs_alloc_inode( | 828 | xfs_fs_alloc_inode( |
770 | struct super_block *sb) | 829 | struct super_block *sb) |