提交 7c0ef28a 编写于 作者: S Steven Whitehouse

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: NSteven Whitehouse <swhiteho@redhat.com>
上级 d6a5e06c
...@@ -579,6 +579,24 @@ static int buf_lo_scan_elements(struct gfs2_jdesc *jd, unsigned int start, ...@@ -579,6 +579,24 @@ static int buf_lo_scan_elements(struct gfs2_jdesc *jd, unsigned int start,
return error; return error;
} }
/**
* gfs2_meta_sync - Sync all buffers associated with a glock
* @gl: The glock
*
*/
static void gfs2_meta_sync(struct gfs2_glock *gl)
{
struct address_space *mapping = gfs2_glock2aspace(gl);
int error;
filemap_fdatawrite(mapping);
error = filemap_fdatawait(mapping);
if (error)
gfs2_io_error(gl->gl_sbd);
}
static void buf_lo_after_scan(struct gfs2_jdesc *jd, int error, int pass) static void buf_lo_after_scan(struct gfs2_jdesc *jd, int error, int pass)
{ {
struct gfs2_inode *ip = GFS2_I(jd->jd_inode); struct gfs2_inode *ip = GFS2_I(jd->jd_inode);
......
...@@ -97,24 +97,6 @@ const struct address_space_operations gfs2_meta_aops = { ...@@ -97,24 +97,6 @@ const struct address_space_operations gfs2_meta_aops = {
.releasepage = gfs2_releasepage, .releasepage = gfs2_releasepage,
}; };
/**
* gfs2_meta_sync - Sync all buffers associated with a glock
* @gl: The glock
*
*/
void gfs2_meta_sync(struct gfs2_glock *gl)
{
struct address_space *mapping = gfs2_glock2aspace(gl);
int error;
filemap_fdatawrite(mapping);
error = filemap_fdatawait(mapping);
if (error)
gfs2_io_error(gl->gl_sbd);
}
/** /**
* gfs2_getbuf - Get a buffer with a given address space * gfs2_getbuf - Get a buffer with a given address space
* @gl: the glock * @gl: the glock
......
...@@ -48,21 +48,17 @@ static inline struct gfs2_sbd *gfs2_mapping2sbd(struct address_space *mapping) ...@@ -48,21 +48,17 @@ static inline struct gfs2_sbd *gfs2_mapping2sbd(struct address_space *mapping)
return inode->i_sb->s_fs_info; return inode->i_sb->s_fs_info;
} }
void gfs2_meta_sync(struct gfs2_glock *gl); extern struct buffer_head *gfs2_meta_new(struct gfs2_glock *gl, u64 blkno);
extern int gfs2_meta_read(struct gfs2_glock *gl, u64 blkno, int flags,
struct buffer_head *gfs2_meta_new(struct gfs2_glock *gl, u64 blkno); struct buffer_head **bhp);
int gfs2_meta_read(struct gfs2_glock *gl, u64 blkno, extern int gfs2_meta_wait(struct gfs2_sbd *sdp, struct buffer_head *bh);
int flags, struct buffer_head **bhp); extern struct buffer_head *gfs2_getbuf(struct gfs2_glock *gl, u64 blkno,
int gfs2_meta_wait(struct gfs2_sbd *sdp, struct buffer_head *bh); int create);
struct buffer_head *gfs2_getbuf(struct gfs2_glock *gl, u64 blkno, int create); extern void gfs2_remove_from_journal(struct buffer_head *bh,
struct gfs2_trans *tr, int meta);
void gfs2_remove_from_journal(struct buffer_head *bh, struct gfs2_trans *tr, extern void gfs2_meta_wipe(struct gfs2_inode *ip, u64 bstart, u32 blen);
int meta); extern int gfs2_meta_indirect_buffer(struct gfs2_inode *ip, int height, u64 num,
struct buffer_head **bhp);
void gfs2_meta_wipe(struct gfs2_inode *ip, u64 bstart, u32 blen);
int gfs2_meta_indirect_buffer(struct gfs2_inode *ip, int height, u64 num,
struct buffer_head **bhp);
static inline int gfs2_meta_inode_buffer(struct gfs2_inode *ip, static inline int gfs2_meta_inode_buffer(struct gfs2_inode *ip,
struct buffer_head **bhp) struct buffer_head **bhp)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册