diff options
-rw-r--r-- | fs/gfs2/daemon.c | 22 | ||||
-rw-r--r-- | fs/gfs2/daemon.h | 2 | ||||
-rw-r--r-- | fs/gfs2/ops_fstype.c | 1 | ||||
-rw-r--r-- | fs/gfs2/quota.h | 23 | ||||
-rw-r--r-- | fs/gfs2/recovery.c | 26 | ||||
-rw-r--r-- | fs/gfs2/recovery.h | 14 |
6 files changed, 45 insertions, 43 deletions
diff --git a/fs/gfs2/daemon.c b/fs/gfs2/daemon.c index 5668aa77b95a..2662df0d5b93 100644 --- a/fs/gfs2/daemon.c +++ b/fs/gfs2/daemon.c | |||
@@ -59,25 +59,3 @@ int gfs2_glockd(void *data) | |||
59 | return 0; | 59 | return 0; |
60 | } | 60 | } |
61 | 61 | ||
62 | /** | ||
63 | * gfs2_recoverd - Recover dead machine's journals | ||
64 | * @sdp: Pointer to GFS2 superblock | ||
65 | * | ||
66 | */ | ||
67 | |||
68 | int gfs2_recoverd(void *data) | ||
69 | { | ||
70 | struct gfs2_sbd *sdp = data; | ||
71 | unsigned long t; | ||
72 | |||
73 | while (!kthread_should_stop()) { | ||
74 | gfs2_check_journals(sdp); | ||
75 | t = gfs2_tune_get(sdp, gt_recoverd_secs) * HZ; | ||
76 | if (freezing(current)) | ||
77 | refrigerator(); | ||
78 | schedule_timeout_interruptible(t); | ||
79 | } | ||
80 | |||
81 | return 0; | ||
82 | } | ||
83 | |||
diff --git a/fs/gfs2/daemon.h b/fs/gfs2/daemon.h index 4be084fb6a62..5258954a234f 100644 --- a/fs/gfs2/daemon.h +++ b/fs/gfs2/daemon.h | |||
@@ -11,7 +11,5 @@ | |||
11 | #define __DAEMON_DOT_H__ | 11 | #define __DAEMON_DOT_H__ |
12 | 12 | ||
13 | int gfs2_glockd(void *data); | 13 | int gfs2_glockd(void *data); |
14 | int gfs2_recoverd(void *data); | ||
15 | int gfs2_quotad(void *data); | ||
16 | 14 | ||
17 | #endif /* __DAEMON_DOT_H__ */ | 15 | #endif /* __DAEMON_DOT_H__ */ |
diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c index a9a83804eea7..d159e7e72722 100644 --- a/fs/gfs2/ops_fstype.c +++ b/fs/gfs2/ops_fstype.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include "sys.h" | 33 | #include "sys.h" |
34 | #include "util.h" | 34 | #include "util.h" |
35 | #include "log.h" | 35 | #include "log.h" |
36 | #include "quota.h" | ||
36 | 37 | ||
37 | #define DO 0 | 38 | #define DO 0 |
38 | #define UNDO 1 | 39 | #define UNDO 1 |
diff --git a/fs/gfs2/quota.h b/fs/gfs2/quota.h index 1d08aeef07e6..cec9032be97d 100644 --- a/fs/gfs2/quota.h +++ b/fs/gfs2/quota.h | |||
@@ -15,21 +15,22 @@ struct gfs2_sbd; | |||
15 | 15 | ||
16 | #define NO_QUOTA_CHANGE ((u32)-1) | 16 | #define NO_QUOTA_CHANGE ((u32)-1) |
17 | 17 | ||
18 | int gfs2_quota_hold(struct gfs2_inode *ip, u32 uid, u32 gid); | 18 | extern int gfs2_quota_hold(struct gfs2_inode *ip, u32 uid, u32 gid); |
19 | void gfs2_quota_unhold(struct gfs2_inode *ip); | 19 | extern void gfs2_quota_unhold(struct gfs2_inode *ip); |
20 | 20 | ||
21 | int gfs2_quota_lock(struct gfs2_inode *ip, u32 uid, u32 gid); | 21 | extern int gfs2_quota_lock(struct gfs2_inode *ip, u32 uid, u32 gid); |
22 | void gfs2_quota_unlock(struct gfs2_inode *ip); | 22 | extern void gfs2_quota_unlock(struct gfs2_inode *ip); |
23 | 23 | ||
24 | int gfs2_quota_check(struct gfs2_inode *ip, u32 uid, u32 gid); | 24 | extern int gfs2_quota_check(struct gfs2_inode *ip, u32 uid, u32 gid); |
25 | void gfs2_quota_change(struct gfs2_inode *ip, s64 change, | 25 | extern void gfs2_quota_change(struct gfs2_inode *ip, s64 change, |
26 | u32 uid, u32 gid); | 26 | u32 uid, u32 gid); |
27 | 27 | ||
28 | int gfs2_quota_sync(struct gfs2_sbd *sdp); | 28 | extern int gfs2_quota_sync(struct gfs2_sbd *sdp); |
29 | int gfs2_quota_refresh(struct gfs2_sbd *sdp, int user, u32 id); | 29 | extern int gfs2_quota_refresh(struct gfs2_sbd *sdp, int user, u32 id); |
30 | 30 | ||
31 | int gfs2_quota_init(struct gfs2_sbd *sdp); | 31 | extern int gfs2_quota_init(struct gfs2_sbd *sdp); |
32 | void gfs2_quota_cleanup(struct gfs2_sbd *sdp); | 32 | extern void gfs2_quota_cleanup(struct gfs2_sbd *sdp); |
33 | extern int gfs2_quotad(void *data); | ||
33 | 34 | ||
34 | static inline int gfs2_quota_lock_check(struct gfs2_inode *ip) | 35 | static inline int gfs2_quota_lock_check(struct gfs2_inode *ip) |
35 | { | 36 | { |
diff --git a/fs/gfs2/recovery.c b/fs/gfs2/recovery.c index d5e91f4f6a0b..b56ba3db7771 100644 --- a/fs/gfs2/recovery.c +++ b/fs/gfs2/recovery.c | |||
@@ -14,6 +14,8 @@ | |||
14 | #include <linux/gfs2_ondisk.h> | 14 | #include <linux/gfs2_ondisk.h> |
15 | #include <linux/crc32.h> | 15 | #include <linux/crc32.h> |
16 | #include <linux/lm_interface.h> | 16 | #include <linux/lm_interface.h> |
17 | #include <linux/kthread.h> | ||
18 | #include <linux/freezer.h> | ||
17 | 19 | ||
18 | #include "gfs2.h" | 20 | #include "gfs2.h" |
19 | #include "incore.h" | 21 | #include "incore.h" |
@@ -589,7 +591,7 @@ fail: | |||
589 | * | 591 | * |
590 | */ | 592 | */ |
591 | 593 | ||
592 | void gfs2_check_journals(struct gfs2_sbd *sdp) | 594 | static void gfs2_check_journals(struct gfs2_sbd *sdp) |
593 | { | 595 | { |
594 | struct gfs2_jdesc *jd; | 596 | struct gfs2_jdesc *jd; |
595 | 597 | ||
@@ -603,3 +605,25 @@ void gfs2_check_journals(struct gfs2_sbd *sdp) | |||
603 | } | 605 | } |
604 | } | 606 | } |
605 | 607 | ||
608 | /** | ||
609 | * gfs2_recoverd - Recover dead machine's journals | ||
610 | * @sdp: Pointer to GFS2 superblock | ||
611 | * | ||
612 | */ | ||
613 | |||
614 | int gfs2_recoverd(void *data) | ||
615 | { | ||
616 | struct gfs2_sbd *sdp = data; | ||
617 | unsigned long t; | ||
618 | |||
619 | while (!kthread_should_stop()) { | ||
620 | gfs2_check_journals(sdp); | ||
621 | t = gfs2_tune_get(sdp, gt_recoverd_secs) * HZ; | ||
622 | if (freezing(current)) | ||
623 | refrigerator(); | ||
624 | schedule_timeout_interruptible(t); | ||
625 | } | ||
626 | |||
627 | return 0; | ||
628 | } | ||
629 | |||
diff --git a/fs/gfs2/recovery.h b/fs/gfs2/recovery.h index f7235e61c723..a8218ea15b57 100644 --- a/fs/gfs2/recovery.h +++ b/fs/gfs2/recovery.h | |||
@@ -18,17 +18,17 @@ static inline void gfs2_replay_incr_blk(struct gfs2_sbd *sdp, unsigned int *blk) | |||
18 | *blk = 0; | 18 | *blk = 0; |
19 | } | 19 | } |
20 | 20 | ||
21 | int gfs2_replay_read_block(struct gfs2_jdesc *jd, unsigned int blk, | 21 | extern int gfs2_replay_read_block(struct gfs2_jdesc *jd, unsigned int blk, |
22 | struct buffer_head **bh); | 22 | struct buffer_head **bh); |
23 | 23 | ||
24 | int gfs2_revoke_add(struct gfs2_sbd *sdp, u64 blkno, unsigned int where); | 24 | extern int gfs2_revoke_add(struct gfs2_sbd *sdp, u64 blkno, unsigned int where); |
25 | int gfs2_revoke_check(struct gfs2_sbd *sdp, u64 blkno, unsigned int where); | 25 | extern int gfs2_revoke_check(struct gfs2_sbd *sdp, u64 blkno, unsigned int where); |
26 | void gfs2_revoke_clean(struct gfs2_sbd *sdp); | 26 | extern void gfs2_revoke_clean(struct gfs2_sbd *sdp); |
27 | 27 | ||
28 | int gfs2_find_jhead(struct gfs2_jdesc *jd, | 28 | extern int gfs2_find_jhead(struct gfs2_jdesc *jd, |
29 | struct gfs2_log_header_host *head); | 29 | struct gfs2_log_header_host *head); |
30 | int gfs2_recover_journal(struct gfs2_jdesc *gfs2_jd); | 30 | extern int gfs2_recover_journal(struct gfs2_jdesc *gfs2_jd); |
31 | void gfs2_check_journals(struct gfs2_sbd *sdp); | 31 | extern int gfs2_recoverd(void *data); |
32 | 32 | ||
33 | #endif /* __RECOVERY_DOT_H__ */ | 33 | #endif /* __RECOVERY_DOT_H__ */ |
34 | 34 | ||