hpfs: remember free space
authorMikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>
Tue, 28 Jan 2014 23:10:44 +0000 (00:10 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 1 Apr 2014 23:59:00 +0000 (00:59 +0100)
commit578d1903dcfd8911534aa602ea8c104c383fadda
tree9d2edbae79f766311a995dedefcbd8178dc4e92a
parent9b41f1572b428032a7dedc8296250236dbc0229a
hpfs: remember free space

commit 2cbe5c76fc5e38e9af4b709593146e4b8272b69e upstream.

Previously, hpfs scanned all bitmaps each time the user asked for free
space using statfs.  This patch changes it so that hpfs scans the
bitmaps only once, remembes the free space and on next invocation of
statfs it returns the value instantly.

New versions of wine are hammering on the statfs syscall very heavily,
making some games unplayable when they're stored on hpfs, with load
times in minutes.

This should be backported to the stable kernels because it fixes
user-visible problem (excessive level load times in wine).

Signed-off-by: Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[ kamal: backport to 3.8 (no hpfs_prefetch_bitmap) ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/hpfs/alloc.c
fs/hpfs/hpfs_fn.h
fs/hpfs/super.c