aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-11-23 11:06:35 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2006-11-30 10:36:45 -0500
commita25311c8e0b7071b129ca9a9e49e22eeaf620864 (patch)
tree6da042d3f24461b88d968d0ca7b85b37252c5e5a /fs/gfs2
parentb004157ab5b374a498a5874cda68c389219d23e7 (diff)
[GFS2] Move gfs2_meta_syncfs() into log.c
By moving gfs2_meta_syncfs() into log.c, gfs2_ail1_start() can be made static. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2')
-rw-r--r--fs/gfs2/log.c21
-rw-r--r--fs/gfs2/log.h2
-rw-r--r--fs/gfs2/meta_io.c17
-rw-r--r--fs/gfs2/meta_io.h1
4 files changed, 21 insertions, 20 deletions
diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c
index 6456fc39aace..7713d5918672 100644
--- a/fs/gfs2/log.c
+++ b/fs/gfs2/log.c
@@ -15,6 +15,7 @@
15#include <linux/gfs2_ondisk.h> 15#include <linux/gfs2_ondisk.h>
16#include <linux/crc32.h> 16#include <linux/crc32.h>
17#include <linux/lm_interface.h> 17#include <linux/lm_interface.h>
18#include <linux/delay.h>
18 19
19#include "gfs2.h" 20#include "gfs2.h"
20#include "incore.h" 21#include "incore.h"
@@ -142,7 +143,7 @@ static int gfs2_ail1_empty_one(struct gfs2_sbd *sdp, struct gfs2_ail *ai, int fl
142 return list_empty(&ai->ai_ail1_list); 143 return list_empty(&ai->ai_ail1_list);
143} 144}
144 145
145void gfs2_ail1_start(struct gfs2_sbd *sdp, int flags) 146static void gfs2_ail1_start(struct gfs2_sbd *sdp, int flags)
146{ 147{
147 struct list_head *head = &sdp->sd_ail1_list; 148 struct list_head *head = &sdp->sd_ail1_list;
148 u64 sync_gen; 149 u64 sync_gen;
@@ -689,3 +690,21 @@ void gfs2_log_shutdown(struct gfs2_sbd *sdp)
689 up_write(&sdp->sd_log_flush_lock); 690 up_write(&sdp->sd_log_flush_lock);
690} 691}
691 692
693
694/**
695 * gfs2_meta_syncfs - sync all the buffers in a filesystem
696 * @sdp: the filesystem
697 *
698 */
699
700void gfs2_meta_syncfs(struct gfs2_sbd *sdp)
701{
702 gfs2_log_flush(sdp, NULL);
703 for (;;) {
704 gfs2_ail1_start(sdp, DIO_ALL);
705 if (gfs2_ail1_empty(sdp, DIO_ALL))
706 break;
707 msleep(10);
708 }
709}
710
diff --git a/fs/gfs2/log.h b/fs/gfs2/log.h
index 7f5737d55612..8e7aa0f29109 100644
--- a/fs/gfs2/log.h
+++ b/fs/gfs2/log.h
@@ -48,7 +48,6 @@ static inline void gfs2_log_pointers_init(struct gfs2_sbd *sdp,
48unsigned int gfs2_struct2blk(struct gfs2_sbd *sdp, unsigned int nstruct, 48unsigned int gfs2_struct2blk(struct gfs2_sbd *sdp, unsigned int nstruct,
49 unsigned int ssize); 49 unsigned int ssize);
50 50
51void gfs2_ail1_start(struct gfs2_sbd *sdp, int flags);
52int gfs2_ail1_empty(struct gfs2_sbd *sdp, int flags); 51int gfs2_ail1_empty(struct gfs2_sbd *sdp, int flags);
53 52
54int gfs2_log_reserve(struct gfs2_sbd *sdp, unsigned int blks); 53int gfs2_log_reserve(struct gfs2_sbd *sdp, unsigned int blks);
@@ -61,5 +60,6 @@ void gfs2_log_flush(struct gfs2_sbd *sdp, struct gfs2_glock *gl);
61void gfs2_log_commit(struct gfs2_sbd *sdp, struct gfs2_trans *trans); 60void gfs2_log_commit(struct gfs2_sbd *sdp, struct gfs2_trans *trans);
62 61
63void gfs2_log_shutdown(struct gfs2_sbd *sdp); 62void gfs2_log_shutdown(struct gfs2_sbd *sdp);
63void gfs2_meta_syncfs(struct gfs2_sbd *sdp);
64 64
65#endif /* __LOG_DOT_H__ */ 65#endif /* __LOG_DOT_H__ */
diff --git a/fs/gfs2/meta_io.c b/fs/gfs2/meta_io.c
index 939a09f6e885..fbeba813c973 100644
--- a/fs/gfs2/meta_io.c
+++ b/fs/gfs2/meta_io.c
@@ -574,20 +574,3 @@ out:
574 return first_bh; 574 return first_bh;
575} 575}
576 576
577/**
578 * gfs2_meta_syncfs - sync all the buffers in a filesystem
579 * @sdp: the filesystem
580 *
581 */
582
583void gfs2_meta_syncfs(struct gfs2_sbd *sdp)
584{
585 gfs2_log_flush(sdp, NULL);
586 for (;;) {
587 gfs2_ail1_start(sdp, DIO_ALL);
588 if (gfs2_ail1_empty(sdp, DIO_ALL))
589 break;
590 msleep(10);
591 }
592}
593
diff --git a/fs/gfs2/meta_io.h b/fs/gfs2/meta_io.h
index 3ec939e20dff..e037425bc042 100644
--- a/fs/gfs2/meta_io.h
+++ b/fs/gfs2/meta_io.h
@@ -67,7 +67,6 @@ static inline int gfs2_meta_inode_buffer(struct gfs2_inode *ip,
67} 67}
68 68
69struct buffer_head *gfs2_meta_ra(struct gfs2_glock *gl, u64 dblock, u32 extlen); 69struct buffer_head *gfs2_meta_ra(struct gfs2_glock *gl, u64 dblock, u32 extlen);
70void gfs2_meta_syncfs(struct gfs2_sbd *sdp);
71 70
72#define buffer_busy(bh) \ 71#define buffer_busy(bh) \
73((bh)->b_state & ((1ul << BH_Dirty) | (1ul << BH_Lock) | (1ul << BH_Pinned))) 72((bh)->b_state & ((1ul << BH_Dirty) | (1ul << BH_Lock) | (1ul << BH_Pinned)))