X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Flib%2Fll_pack.c;h=184c2c12328a9308a6d81f451d6066795e5fe38e;hb=0ad39fa72b58b7174e4844d2f5e951185af2ab54;hp=a71f56402134493584c5a5140dafeb8ad63a0c5d;hpb=c595efb917448bbf495049e6f9997b5e501714a3;p=fs%2Flustre-release.git diff --git a/lustre/lib/ll_pack.c b/lustre/lib/ll_pack.c index a71f564..184c2c1 100644 --- a/lustre/lib/ll_pack.c +++ b/lustre/lib/ll_pack.c @@ -53,31 +53,14 @@ void statfs_pack(struct obd_statfs *osfs, struct statfs *sfs) osfs->os_namelen = sfs->f_namelen; } -#if BITS_PER_LONG > 32 -#define statfs_max(val) val -#else -static inline long statfs_max(__u64 val) -{ - return ((long)val < val) ? (long)-1 : val; -} -#endif - -/* - * Note: since linux statfs is limited to a "long" for the statfs - * fields, we quickly overflow that. If we wanted, we could start - * playing games with the blocksize until the blocks count fit into - * a long. Note that it also appears that userspace interprets these - * fields as an unsigned long, which is helps us a bit, and it also - * appears to do 64-bit math for at least some of the computations. - */ void statfs_unpack(struct statfs *sfs, struct obd_statfs *osfs) { sfs->f_type = osfs->os_type; - sfs->f_blocks = statfs_max(osfs->os_blocks); - sfs->f_bfree = statfs_max(osfs->os_bfree); - sfs->f_bavail = statfs_max(osfs->os_bavail); - sfs->f_files = statfs_max(osfs->os_files); - sfs->f_ffree = statfs_max(osfs->os_ffree); + sfs->f_blocks = osfs->os_blocks; + sfs->f_bfree = osfs->os_bfree; + sfs->f_bavail = osfs->os_bavail; + sfs->f_files = osfs->os_files; + sfs->f_ffree = osfs->os_ffree; sfs->f_bsize = osfs->os_bsize; sfs->f_namelen = osfs->os_namelen; }