aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2008-11-19 05:08:22 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2009-01-05 02:39:07 -0500
commit9ac1b4d9b6f885ccd7d8f56bceb609003a920ff7 (patch)
tree3208c627ca63e4167b2ce1d4bf4849b478d7a0e4
parent813e0c46c9e2a0c6f0b6e774faac82afd7a2e812 (diff)
GFS2: Move gfs2_recoverd into recovery.c
By moving gfs2_recoverd, we can make an additional function static and it also leaves only (the already scheduled for removal) gfs2_glockd in daemon.c. At the same time the declaration of gfs2_quotad is moved to quota.h to reflect the new location of gfs2_quotad in a previous patch. Also the recovery.h and quota.h headers are cleaned up. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
-rw-r--r--fs/gfs2/daemon.c22
-rw-r--r--fs/gfs2/daemon.h2
-rw-r--r--fs/gfs2/ops_fstype.c1
-rw-r--r--fs/gfs2/quota.h23
-rw-r--r--fs/gfs2/recovery.c26
-rw-r--r--fs/gfs2/recovery.h14
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
68int 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
13int gfs2_glockd(void *data); 13int gfs2_glockd(void *data);
14int gfs2_recoverd(void *data);
15int 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
18int gfs2_quota_hold(struct gfs2_inode *ip, u32 uid, u32 gid); 18extern int gfs2_quota_hold(struct gfs2_inode *ip, u32 uid, u32 gid);
19void gfs2_quota_unhold(struct gfs2_inode *ip); 19extern void gfs2_quota_unhold(struct gfs2_inode *ip);
20 20
21int gfs2_quota_lock(struct gfs2_inode *ip, u32 uid, u32 gid); 21extern int gfs2_quota_lock(struct gfs2_inode *ip, u32 uid, u32 gid);
22void gfs2_quota_unlock(struct gfs2_inode *ip); 22extern void gfs2_quota_unlock(struct gfs2_inode *ip);
23 23
24int gfs2_quota_check(struct gfs2_inode *ip, u32 uid, u32 gid); 24extern int gfs2_quota_check(struct gfs2_inode *ip, u32 uid, u32 gid);
25void gfs2_quota_change(struct gfs2_inode *ip, s64 change, 25extern void gfs2_quota_change(struct gfs2_inode *ip, s64 change,
26 u32 uid, u32 gid); 26 u32 uid, u32 gid);
27 27
28int gfs2_quota_sync(struct gfs2_sbd *sdp); 28extern int gfs2_quota_sync(struct gfs2_sbd *sdp);
29int gfs2_quota_refresh(struct gfs2_sbd *sdp, int user, u32 id); 29extern int gfs2_quota_refresh(struct gfs2_sbd *sdp, int user, u32 id);
30 30
31int gfs2_quota_init(struct gfs2_sbd *sdp); 31extern int gfs2_quota_init(struct gfs2_sbd *sdp);
32void gfs2_quota_cleanup(struct gfs2_sbd *sdp); 32extern void gfs2_quota_cleanup(struct gfs2_sbd *sdp);
33extern int gfs2_quotad(void *data);
33 34
34static inline int gfs2_quota_lock_check(struct gfs2_inode *ip) 35static 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
592void gfs2_check_journals(struct gfs2_sbd *sdp) 594static 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
614int 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
21int gfs2_replay_read_block(struct gfs2_jdesc *jd, unsigned int blk, 21extern int gfs2_replay_read_block(struct gfs2_jdesc *jd, unsigned int blk,
22 struct buffer_head **bh); 22 struct buffer_head **bh);
23 23
24int gfs2_revoke_add(struct gfs2_sbd *sdp, u64 blkno, unsigned int where); 24extern int gfs2_revoke_add(struct gfs2_sbd *sdp, u64 blkno, unsigned int where);
25int gfs2_revoke_check(struct gfs2_sbd *sdp, u64 blkno, unsigned int where); 25extern int gfs2_revoke_check(struct gfs2_sbd *sdp, u64 blkno, unsigned int where);
26void gfs2_revoke_clean(struct gfs2_sbd *sdp); 26extern void gfs2_revoke_clean(struct gfs2_sbd *sdp);
27 27
28int gfs2_find_jhead(struct gfs2_jdesc *jd, 28extern int gfs2_find_jhead(struct gfs2_jdesc *jd,
29 struct gfs2_log_header_host *head); 29 struct gfs2_log_header_host *head);
30int gfs2_recover_journal(struct gfs2_jdesc *gfs2_jd); 30extern int gfs2_recover_journal(struct gfs2_jdesc *gfs2_jd);
31void gfs2_check_journals(struct gfs2_sbd *sdp); 31extern int gfs2_recoverd(void *data);
32 32
33#endif /* __RECOVERY_DOT_H__ */ 33#endif /* __RECOVERY_DOT_H__ */
34 34