[GFS2] split and annotate gfs2_statfs_change
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
This commit is contained in:
parent
b5bc9e8b06
commit
bd209cc017
|
@ -503,8 +503,8 @@ struct gfs2_sbd {
|
|||
|
||||
spinlock_t sd_statfs_spin;
|
||||
struct mutex sd_statfs_mutex;
|
||||
struct gfs2_statfs_change sd_statfs_master;
|
||||
struct gfs2_statfs_change sd_statfs_local;
|
||||
struct gfs2_statfs_change_host sd_statfs_master;
|
||||
struct gfs2_statfs_change_host sd_statfs_local;
|
||||
unsigned long sd_statfs_sync_time;
|
||||
|
||||
/* Resource group stuff */
|
||||
|
|
|
@ -279,7 +279,7 @@ void gfs2_inum_range_out(const struct gfs2_inum_range_host *ir, void *buf)
|
|||
str->ir_length = cpu_to_be64(ir->ir_length);
|
||||
}
|
||||
|
||||
void gfs2_statfs_change_in(struct gfs2_statfs_change *sc, const void *buf)
|
||||
void gfs2_statfs_change_in(struct gfs2_statfs_change_host *sc, const void *buf)
|
||||
{
|
||||
const struct gfs2_statfs_change *str = buf;
|
||||
|
||||
|
@ -288,7 +288,7 @@ void gfs2_statfs_change_in(struct gfs2_statfs_change *sc, const void *buf)
|
|||
sc->sc_dinodes = be64_to_cpu(str->sc_dinodes);
|
||||
}
|
||||
|
||||
void gfs2_statfs_change_out(const struct gfs2_statfs_change *sc, void *buf)
|
||||
void gfs2_statfs_change_out(const struct gfs2_statfs_change_host *sc, void *buf)
|
||||
{
|
||||
struct gfs2_statfs_change *str = buf;
|
||||
|
||||
|
|
|
@ -215,7 +215,7 @@ static int gfs2_statfs(struct dentry *dentry, struct kstatfs *buf)
|
|||
{
|
||||
struct super_block *sb = dentry->d_inode->i_sb;
|
||||
struct gfs2_sbd *sdp = sb->s_fs_info;
|
||||
struct gfs2_statfs_change sc;
|
||||
struct gfs2_statfs_change_host sc;
|
||||
int error;
|
||||
|
||||
if (gfs2_tune_get(sdp, gt_statfs_slow))
|
||||
|
|
|
@ -587,9 +587,9 @@ int gfs2_make_fs_ro(struct gfs2_sbd *sdp)
|
|||
int gfs2_statfs_init(struct gfs2_sbd *sdp)
|
||||
{
|
||||
struct gfs2_inode *m_ip = GFS2_I(sdp->sd_statfs_inode);
|
||||
struct gfs2_statfs_change *m_sc = &sdp->sd_statfs_master;
|
||||
struct gfs2_statfs_change_host *m_sc = &sdp->sd_statfs_master;
|
||||
struct gfs2_inode *l_ip = GFS2_I(sdp->sd_sc_inode);
|
||||
struct gfs2_statfs_change *l_sc = &sdp->sd_statfs_local;
|
||||
struct gfs2_statfs_change_host *l_sc = &sdp->sd_statfs_local;
|
||||
struct buffer_head *m_bh, *l_bh;
|
||||
struct gfs2_holder gh;
|
||||
int error;
|
||||
|
@ -634,7 +634,7 @@ void gfs2_statfs_change(struct gfs2_sbd *sdp, s64 total, s64 free,
|
|||
s64 dinodes)
|
||||
{
|
||||
struct gfs2_inode *l_ip = GFS2_I(sdp->sd_sc_inode);
|
||||
struct gfs2_statfs_change *l_sc = &sdp->sd_statfs_local;
|
||||
struct gfs2_statfs_change_host *l_sc = &sdp->sd_statfs_local;
|
||||
struct buffer_head *l_bh;
|
||||
int error;
|
||||
|
||||
|
@ -660,8 +660,8 @@ int gfs2_statfs_sync(struct gfs2_sbd *sdp)
|
|||
{
|
||||
struct gfs2_inode *m_ip = GFS2_I(sdp->sd_statfs_inode);
|
||||
struct gfs2_inode *l_ip = GFS2_I(sdp->sd_sc_inode);
|
||||
struct gfs2_statfs_change *m_sc = &sdp->sd_statfs_master;
|
||||
struct gfs2_statfs_change *l_sc = &sdp->sd_statfs_local;
|
||||
struct gfs2_statfs_change_host *m_sc = &sdp->sd_statfs_master;
|
||||
struct gfs2_statfs_change_host *l_sc = &sdp->sd_statfs_local;
|
||||
struct gfs2_holder gh;
|
||||
struct buffer_head *m_bh, *l_bh;
|
||||
int error;
|
||||
|
@ -727,10 +727,10 @@ out:
|
|||
* Returns: errno
|
||||
*/
|
||||
|
||||
int gfs2_statfs_i(struct gfs2_sbd *sdp, struct gfs2_statfs_change *sc)
|
||||
int gfs2_statfs_i(struct gfs2_sbd *sdp, struct gfs2_statfs_change_host *sc)
|
||||
{
|
||||
struct gfs2_statfs_change *m_sc = &sdp->sd_statfs_master;
|
||||
struct gfs2_statfs_change *l_sc = &sdp->sd_statfs_local;
|
||||
struct gfs2_statfs_change_host *m_sc = &sdp->sd_statfs_master;
|
||||
struct gfs2_statfs_change_host *l_sc = &sdp->sd_statfs_local;
|
||||
|
||||
spin_lock(&sdp->sd_statfs_spin);
|
||||
|
||||
|
@ -760,7 +760,7 @@ int gfs2_statfs_i(struct gfs2_sbd *sdp, struct gfs2_statfs_change *sc)
|
|||
*/
|
||||
|
||||
static int statfs_slow_fill(struct gfs2_rgrpd *rgd,
|
||||
struct gfs2_statfs_change *sc)
|
||||
struct gfs2_statfs_change_host *sc)
|
||||
{
|
||||
gfs2_rgrp_verify(rgd);
|
||||
sc->sc_total += rgd->rd_ri.ri_data;
|
||||
|
@ -782,7 +782,7 @@ static int statfs_slow_fill(struct gfs2_rgrpd *rgd,
|
|||
* Returns: errno
|
||||
*/
|
||||
|
||||
int gfs2_statfs_slow(struct gfs2_sbd *sdp, struct gfs2_statfs_change *sc)
|
||||
int gfs2_statfs_slow(struct gfs2_sbd *sdp, struct gfs2_statfs_change_host *sc)
|
||||
{
|
||||
struct gfs2_holder ri_gh;
|
||||
struct gfs2_rgrpd *rgd_next;
|
||||
|
@ -792,7 +792,7 @@ int gfs2_statfs_slow(struct gfs2_sbd *sdp, struct gfs2_statfs_change *sc)
|
|||
int done;
|
||||
int error = 0, err;
|
||||
|
||||
memset(sc, 0, sizeof(struct gfs2_statfs_change));
|
||||
memset(sc, 0, sizeof(struct gfs2_statfs_change_host));
|
||||
gha = kcalloc(slots, sizeof(struct gfs2_holder), GFP_KERNEL);
|
||||
if (!gha)
|
||||
return -ENOMEM;
|
||||
|
|
|
@ -45,8 +45,8 @@ int gfs2_statfs_init(struct gfs2_sbd *sdp);
|
|||
void gfs2_statfs_change(struct gfs2_sbd *sdp,
|
||||
s64 total, s64 free, s64 dinodes);
|
||||
int gfs2_statfs_sync(struct gfs2_sbd *sdp);
|
||||
int gfs2_statfs_i(struct gfs2_sbd *sdp, struct gfs2_statfs_change *sc);
|
||||
int gfs2_statfs_slow(struct gfs2_sbd *sdp, struct gfs2_statfs_change *sc);
|
||||
int gfs2_statfs_i(struct gfs2_sbd *sdp, struct gfs2_statfs_change_host *sc);
|
||||
int gfs2_statfs_slow(struct gfs2_sbd *sdp, struct gfs2_statfs_change_host *sc);
|
||||
|
||||
int gfs2_freeze_fs(struct gfs2_sbd *sdp);
|
||||
void gfs2_unfreeze_fs(struct gfs2_sbd *sdp);
|
||||
|
|
|
@ -497,6 +497,12 @@ struct gfs2_statfs_change {
|
|||
__be64 sc_dinodes;
|
||||
};
|
||||
|
||||
struct gfs2_statfs_change_host {
|
||||
__u64 sc_total;
|
||||
__u64 sc_free;
|
||||
__u64 sc_dinodes;
|
||||
};
|
||||
|
||||
/*
|
||||
* Quota change
|
||||
* Describes an allocation change for a particular
|
||||
|
@ -529,8 +535,8 @@ extern void gfs2_ea_header_out(const struct gfs2_ea_header *ea, void *buf);
|
|||
extern void gfs2_log_header_in(struct gfs2_log_header_host *lh, const void *buf);
|
||||
extern void gfs2_inum_range_in(struct gfs2_inum_range_host *ir, const void *buf);
|
||||
extern void gfs2_inum_range_out(const struct gfs2_inum_range_host *ir, void *buf);
|
||||
extern void gfs2_statfs_change_in(struct gfs2_statfs_change *sc, const void *buf);
|
||||
extern void gfs2_statfs_change_out(const struct gfs2_statfs_change *sc, void *buf);
|
||||
extern void gfs2_statfs_change_in(struct gfs2_statfs_change_host *sc, const void *buf);
|
||||
extern void gfs2_statfs_change_out(const struct gfs2_statfs_change_host *sc, void *buf);
|
||||
extern void gfs2_quota_change_in(struct gfs2_quota_change *qc, const void *buf);
|
||||
|
||||
/* Printing functions */
|
||||
|
|
Loading…
Reference in New Issue