From: Alex Zhuravlev Date: Wed, 15 Aug 2012 09:38:22 +0000 (+0400) Subject: LU-1711 mount: use OSD API to export statfs data X-Git-Tag: 2.3.51~115 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=7de57cc8c7ccc82a47e19d39ad04b82bbfb6d6d1 LU-1711 mount: use OSD API to export statfs data so that server mount points (like /mnt/ostXXX) show valid data on any backend (ldiskfs, zfs) Signed-off-by: Alex Zhuravlev Change-Id: I6ad0546d7630769083e8aea69547a6bb3256784f Reviewed-on: http://review.whamcloud.com/3652 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Jinshan Xiong --- diff --git a/lustre/obdclass/obd_mount.c b/lustre/obdclass/obd_mount.c index 368256a..33ef09d 100644 --- a/lustre/obdclass/obd_mount.c +++ b/lustre/obdclass/obd_mount.c @@ -1539,12 +1539,15 @@ static void server_umount_begin(struct super_block *sb) static int server_statfs (struct dentry *dentry, cfs_kstatfs_t *buf) { struct super_block *sb = dentry->d_sb; - struct vfsmount *mnt = s2lsi(sb)->lsi_srv_mnt; + struct lustre_sb_info *lsi = s2lsi(sb); + struct obd_statfs statfs; + int rc; ENTRY; - if (mnt && mnt->mnt_sb && mnt->mnt_sb->s_op->statfs) { - int rc = mnt->mnt_sb->s_op->statfs(mnt->mnt_root, buf); - if (!rc) { + if (lsi->lsi_dt_dev) { + rc = dt_statfs(NULL, lsi->lsi_dt_dev, &statfs); + if (rc == 0) { + statfs_unpack(buf, &statfs); buf->f_type = sb->s_magic; RETURN(0); }