linux/fs/fat
Namjae Jeon b13bb33eac fat: add fat_fallocate operation
Implement preallocation via the fallocate syscall on VFAT partitions.
This patch is based on an earlier patch of the same name which had some
issues detailed below and did not get accepted.  Refer
https://lkml.org/lkml/2007/12/22/130.

a) The preallocated space was not persistent when the
   FALLOC_FL_KEEP_SIZE flag was set.  It will deallocate cluster at evict
   time.

b) There was no need to zero out the clusters when the flag was set
   Instead of doing an expanding truncate, just allocate clusters and add
   them to the fat chain.  This reduces preallocation time.

Compatibility with windows:

There are no issues when FALLOC_FL_KEEP_SIZE is not set because it just
does an expanding truncate.  Thus reading from the preallocated area on
windows returns null until data is written to it.

When a file with preallocated area using the FALLOC_FL_KEEP_SIZE was
written to on windows, the windows driver freed-up the preallocated
clusters and allocated new clusters for the new data.  The freed up
clusters gets reflected in the free space available for the partition
which can be seen from the Volume properties.

The windows chkdsk tool also does not report any errors on a disk
containing files with preallocated space.

And there is also no issue using linux fat fsck.  because discard
preallocated clusters at repair time.

Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Amit Sahrawat <a.sahrawat@samsung.com>
Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-01-20 17:09:18 -08:00
..
cache.c fs/fat: remove unnecessary includes 2015-04-17 09:04:06 -04:00
dir.c fat: fix fake_offset handling on error path 2015-11-20 16:17:32 -08:00
fat.h fat: add fat_fallocate operation 2016-01-20 17:09:18 -08:00
fatent.c fs/fat: remove unnecessary includes 2015-04-17 09:04:06 -04:00
file.c fat: add fat_fallocate operation 2016-01-20 17:09:18 -08:00
inode.c fat: add fat_fallocate operation 2016-01-20 17:09:18 -08:00
Kconfig vfat: Note the NLS requirement 2009-04-17 09:32:11 -07:00
Makefile fat (exportfs): move NFS support code 2012-10-06 03:05:09 +09:00
misc.c fs/fat: remove unnecessary includes 2015-04-17 09:04:06 -04:00
namei_msdos.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2015-04-26 17:22:07 -07:00
namei_vfat.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2015-04-26 17:22:07 -07:00
nfs.c VFS: normal filesystems (and lustre): d_inode() annotations 2015-04-15 15:06:57 -04:00