aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2013-07-03 10:13:32 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2013-08-19 12:26:32 -0400
commit7c0ef28a2c9a768ffb63c1c3d9542b6e175ab260 (patch)
treee423a9d588de594095d7387dac9bb5c8dfa073bd /fs/gfs2
parentd6a5e06cd17a3f901231e345e4acc1c3dab9fbb8 (diff)
GFS2: Move gfs2_sync_meta to lops.c
Since gfs2_sync_meta() is only called from a single file, lets move it to lops.c where it is used, and mark it static. At the same time, we can clean up the meta_io.h header too. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2')
-rw-r--r--fs/gfs2/lops.c18
-rw-r--r--fs/gfs2/meta_io.c18
-rw-r--r--fs/gfs2/meta_io.h26
3 files changed, 29 insertions, 33 deletions
diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c
index 17c5b5d7dc88..010b9fb9fec6 100644
--- a/fs/gfs2/lops.c
+++ b/fs/gfs2/lops.c
@@ -579,6 +579,24 @@ static int buf_lo_scan_elements(struct gfs2_jdesc *jd, unsigned int start,
579 return error; 579 return error;
580} 580}
581 581
582/**
583 * gfs2_meta_sync - Sync all buffers associated with a glock
584 * @gl: The glock
585 *
586 */
587
588static void gfs2_meta_sync(struct gfs2_glock *gl)
589{
590 struct address_space *mapping = gfs2_glock2aspace(gl);
591 int error;
592
593 filemap_fdatawrite(mapping);
594 error = filemap_fdatawait(mapping);
595
596 if (error)
597 gfs2_io_error(gl->gl_sbd);
598}
599
582static void buf_lo_after_scan(struct gfs2_jdesc *jd, int error, int pass) 600static void buf_lo_after_scan(struct gfs2_jdesc *jd, int error, int pass)
583{ 601{
584 struct gfs2_inode *ip = GFS2_I(jd->jd_inode); 602 struct gfs2_inode *ip = GFS2_I(jd->jd_inode);
diff --git a/fs/gfs2/meta_io.c b/fs/gfs2/meta_io.c
index 0da390686c08..932415050540 100644
--- a/fs/gfs2/meta_io.c
+++ b/fs/gfs2/meta_io.c
@@ -98,24 +98,6 @@ const struct address_space_operations gfs2_meta_aops = {
98}; 98};
99 99
100/** 100/**
101 * gfs2_meta_sync - Sync all buffers associated with a glock
102 * @gl: The glock
103 *
104 */
105
106void gfs2_meta_sync(struct gfs2_glock *gl)
107{
108 struct address_space *mapping = gfs2_glock2aspace(gl);
109 int error;
110
111 filemap_fdatawrite(mapping);
112 error = filemap_fdatawait(mapping);
113
114 if (error)
115 gfs2_io_error(gl->gl_sbd);
116}
117
118/**
119 * gfs2_getbuf - Get a buffer with a given address space 101 * gfs2_getbuf - Get a buffer with a given address space
120 * @gl: the glock 102 * @gl: the glock
121 * @blkno: the block number (filesystem scope) 103 * @blkno: the block number (filesystem scope)
diff --git a/fs/gfs2/meta_io.h b/fs/gfs2/meta_io.h
index 0d4c843b6f8e..4823b934208a 100644
--- a/fs/gfs2/meta_io.h
+++ b/fs/gfs2/meta_io.h
@@ -48,21 +48,17 @@ static inline struct gfs2_sbd *gfs2_mapping2sbd(struct address_space *mapping)
48 return inode->i_sb->s_fs_info; 48 return inode->i_sb->s_fs_info;
49} 49}
50 50
51void gfs2_meta_sync(struct gfs2_glock *gl); 51extern struct buffer_head *gfs2_meta_new(struct gfs2_glock *gl, u64 blkno);
52 52extern int gfs2_meta_read(struct gfs2_glock *gl, u64 blkno, int flags,
53struct buffer_head *gfs2_meta_new(struct gfs2_glock *gl, u64 blkno); 53 struct buffer_head **bhp);
54int gfs2_meta_read(struct gfs2_glock *gl, u64 blkno, 54extern int gfs2_meta_wait(struct gfs2_sbd *sdp, struct buffer_head *bh);
55 int flags, struct buffer_head **bhp); 55extern struct buffer_head *gfs2_getbuf(struct gfs2_glock *gl, u64 blkno,
56int gfs2_meta_wait(struct gfs2_sbd *sdp, struct buffer_head *bh); 56 int create);
57struct buffer_head *gfs2_getbuf(struct gfs2_glock *gl, u64 blkno, int create); 57extern void gfs2_remove_from_journal(struct buffer_head *bh,
58 58 struct gfs2_trans *tr, int meta);
59void gfs2_remove_from_journal(struct buffer_head *bh, struct gfs2_trans *tr, 59extern void gfs2_meta_wipe(struct gfs2_inode *ip, u64 bstart, u32 blen);
60 int meta); 60extern int gfs2_meta_indirect_buffer(struct gfs2_inode *ip, int height, u64 num,
61 61 struct buffer_head **bhp);
62void gfs2_meta_wipe(struct gfs2_inode *ip, u64 bstart, u32 blen);
63
64int gfs2_meta_indirect_buffer(struct gfs2_inode *ip, int height, u64 num,
65 struct buffer_head **bhp);
66 62
67static inline int gfs2_meta_inode_buffer(struct gfs2_inode *ip, 63static inline int gfs2_meta_inode_buffer(struct gfs2_inode *ip,
68 struct buffer_head **bhp) 64 struct buffer_head **bhp)