summaryrefslogtreecommitdiff
path: root/fs
AgeCommit message (Collapse)Author
2014-07-30fat: permit to return phy block number by fibmap in fallocated regionNamjae Jeon
Make the fibmap call the return the proper physical block number for any offset request in the fallocated range. 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>
2014-07-30fat: fallback to buffered write in case of fallocated region on direct IONamjae Jeon
For normal cases of direct IO write, trying to seek to location greater than file size, makes it fall back to buffered write to fill that region. Similarly, in case for write in Fallocated region, make it fall to buffered write. 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>
2014-07-30fat: zero out seek range on _fat_get_blockNamjae Jeon
For normal buffered write operations, normally if we try to write to an offset > than file size, it does a cont_expand_zero till that offset. Now, in case of fallocated regions, since the blocks are already allocated. So, make it zero out that buffers for those blocks till the seek'ed offset. 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>
2014-07-30fat: add fat_fallocate operationNamjae Jeon
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>
2014-07-30fat: add i_disksize to represent uninitialized sizeNamjae Jeon
Add i_disksize to represent uninitialized allocated size. And mmu_private represent initialized allocated size. 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>
2014-07-30fs: dlm/lockd: convert int result to unsigned char typeJoe Perches
op->info.rv is an s32, but it's only used as a u8. Signed-off-by: Joe Perches <joe@perches.com> Cc: Al Viro <viro@ZenIV.linux.org.uk> Cc: David Teigland <teigland@redhat.com> Cc: Jeff Layton <jlayton@poochiereds.net> Cc: Christine Caulfield <ccaulfie@redhat.com> Cc: "J. Bruce Fields" <bfields@fieldses.org> Cc: Trond Myklebust <trond.myklebust@primarydata.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2014-07-30dlm: plock: reduce indentation by rearranging orderJoe Perches
if blocks that have a goto at the end of one branch can be simplified by reordering and unindenting. Signed-off-by: Joe Perches <joe@perches.com> Cc: Al Viro <viro@ZenIV.linux.org.uk> Cc: David Teigland <teigland@redhat.com> Cc: Jeff Layton <jlayton@poochiereds.net> Cc: Christine Caulfield <ccaulfie@redhat.com> Cc: "J. Bruce Fields" <bfields@fieldses.org> Cc: Trond Myklebust <trond.myklebust@primarydata.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2014-07-30dlm, lockd: remove unused conf from lm_grantJoe Perches
This argument is always NULL so don't pass it around. Signed-off-by: Joe Perches <joe@perches.com> Cc: Al Viro <viro@ZenIV.linux.org.uk> Cc: David Teigland <teigland@redhat.com> Cc: Jeff Layton <jlayton@poochiereds.net> Cc: Christine Caulfield <ccaulfie@redhat.com> Cc: "J. Bruce Fields" <bfields@fieldses.org> Cc: Trond Myklebust <trond.myklebust@primarydata.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2014-07-30fs/dlm/plock.c: add argument descriptions to notifyJoe Perches
Function pointer arguments without type names are not very clear. Add them. Signed-off-by: Joe Perches <joe@perches.com> Cc: Al Viro <viro@ZenIV.linux.org.uk> Cc: David Teigland <teigland@redhat.com> Cc: Jeff Layton <jlayton@poochiereds.net> Cc: Christine Caulfield <ccaulfie@redhat.com> Cc: "J. Bruce Fields" <bfields@fieldses.org> Cc: Trond Myklebust <trond.myklebust@primarydata.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2014-07-30Merge branch 'akpm-current/current'Stephen Rothwell
Conflicts: arch/arm64/Kconfig mm/shmem.c
2014-07-30Merge remote-tracking branch 'aio/master'Stephen Rothwell
2014-07-30Merge remote-tracking branch 'userns/for-next'Stephen Rothwell
Conflicts: fs/btrfs/ioctl.c fs/dcache.c fs/namei.c fs/namespace.c
2014-07-30Merge remote-tracking branch 'driver-core/driver-core-next'Stephen Rothwell
Conflicts: arch/arm/mach-shmobile/board-genmai.c arch/arm/mach-shmobile/setup-r7s72100.c drivers/gpu/drm/armada/armada_crtc.c
2014-07-30next-20140724/tipStephen Rothwell
2014-07-30Merge remote-tracking branch 'trivial/for-next'Stephen Rothwell
Conflicts: Documentation/laptops/freefall.c arch/arm/mach-msm/Kconfig
2014-07-30Merge remote-tracking branch 'security/next'Stephen Rothwell
2014-07-30Merge remote-tracking branch 'block/for-next'Stephen Rothwell
2014-07-30Merge remote-tracking branch 'l2-mtd/master'Stephen Rothwell
2014-07-30Merge remote-tracking branch 'net-next/master'Stephen Rothwell
2014-07-30Merge remote-tracking branch 'hch-vfs/vfs-for-3.17'Stephen Rothwell
2014-07-30Merge remote-tracking branch 'vfs/for-next'Stephen Rothwell
2014-07-30Merge remote-tracking branch 'file-private-locks/linux-next'Stephen Rothwell
2014-07-30Merge remote-tracking branch 'xfs/for-next'Stephen Rothwell
2014-07-30Merge remote-tracking branch 'ubifs/linux-next'Stephen Rothwell
2014-07-30Merge remote-tracking branch 'nfsd/nfsd-next'Stephen Rothwell
Conflicts: fs/nfsd/nfs4xdr.c
2014-07-30Merge remote-tracking branch 'nfs/linux-next'Stephen Rothwell
2014-07-30Merge remote-tracking branch 'logfs/master'Stephen Rothwell
2014-07-30Merge remote-tracking branch 'gfs2/master'Stephen Rothwell
2014-07-30Merge remote-tracking branch 'f2fs/dev'Stephen Rothwell
2014-07-30Merge remote-tracking branch 'ext4/dev'Stephen Rothwell
2014-07-30Merge remote-tracking branch 'ext3/for_next'Stephen Rothwell
2014-07-30Merge remote-tracking branch 'ecryptfs/next'Stephen Rothwell
2014-07-30Merge remote-tracking branch 'cifs/for-next'Stephen Rothwell
2014-07-30Merge remote-tracking branch 'ceph/master'Stephen Rothwell
2014-07-30Merge branch 'xfs-misc-fixes-3.17-1' into for-nextDave Chinner
2014-07-30Merge branch 'xfs-quota-eofblocks-scan' into for-nextDave Chinner
2014-07-30xfs: require 64-bit sector_tChristoph Hellwig
Trying to support tiny disks only and saving a bit memory might have made sense on an SGI O2 15 years ago, but is pretty pointless today. Remove the rarely tested codepath that uses various smaller in-memory types to reduce our test matrix and make the codebase a little bit smaller and less complicated. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Ben Myers <bpm@sgi.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
2014-07-29nfsd: rename unhash_generic_stateid to unhash_ol_stateidJeff Layton
...to better match other functions that deal with open/lock stateids. Signed-off-by: Jeff Layton <jlayton@primarydata.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
2014-07-29nfsd: don't thrash the cl_lock while freeing an open stateidJeff Layton
When we remove the client_mutex, we'll have a potential race between FREE_STATEID and CLOSE. The root of the problem is that we are walking the st_locks list, dropping the spinlock and then trying to release the persistent reference to the lockstateid. In between, a FREE_STATEID call can come along and take the lock, find the stateid and then try to put the reference. That leads to a double put. Fix this by not releasing the cl_lock in order to release each lock stateid. Use put_generic_stateid_locked to unhash them and gather them onto a list, and free_ol_stateid_reaplist to free any that end up on the list. Signed-off-by: Jeff Layton <jlayton@primarydata.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
2014-07-29nfsd: reduce cl_lock thrashing in release_openownerJeff Layton
Releasing an openowner is a bit inefficient as it can potentially thrash the cl_lock if you have a lot of stateids attached to it. Once we remove the client_mutex, it'll also potentially be dangerous to do this. Add some functions to make it easier to defer the part of putting a generic stateid reference that needs to be done outside the cl_lock while doing the parts that must be done while holding it under a single lock. First we unhash each open stateid. Then we call put_generic_stateid_locked which will put the reference to an nfs4_ol_stateid. If it turns out to be the last reference, it'll go ahead and remove the stid from the IDR tree and put it onto the reaplist using the st_locks list_head. Then, after dropping the lock we'll call free_ol_stateid_reaplist to walk the list of stateids that are fully unhashed and ready to be freed, and free each of them. This function can sleep, so it must be done outside any spinlocks. Signed-off-by: Jeff Layton <jlayton@primarydata.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
2014-07-29nfsd: close potential race in nfsd4_free_stateidJeff Layton
Once we remove the client_mutex, it'll be possible for the sc_type of a lock stateid to change after it's found and checked, but before we can go to destroy it. If that happens, we can end up putting the persistent reference to the stateid more than once, and unhash it more than once. Fix this by unhashing the lock stateid prior to dropping the cl_lock but after finding it. Signed-off-by: Jeff Layton <jlayton@primarydata.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
2014-07-29nfsd: optimize destroy_lockowner cl_lock thrashingJeff Layton
Reduce the cl_lock trashing in destroy_lockowner. Unhash all of the lockstateids on the lockowner's list. Put the reference under the lock and see if it was the last one. If so, then add it to a private list to be destroyed after we drop the lock. Signed-off-by: Jeff Layton <jlayton@primarydata.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
2014-07-29nfsd: add locking to stateowner releaseJeff Layton
Once we remove the client_mutex, we'll need to properly protect the stateowner reference counts using the cl_lock. Signed-off-by: Jeff Layton <jlayton@primarydata.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
2014-07-29nfsd: clean up and reorganize release_lockownerJeff Layton
Do more within the main loop, and simplify the function a bit. Also, there's no need to take a stateowner reference unless we're going to call release_lockowner. Signed-off-by: Jeff Layton <jlayton@primarydata.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
2014-07-29nfsd: Move the open owner hash table into struct nfs4_clientTrond Myklebust
Preparation for removing the client_mutex. Convert the open owner hash table into a per-client table and protect it using the nfs4_client->cl_lock spin lock. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
2014-07-29nfsd: Protect adding/removing lock owners using client_lockTrond Myklebust
Once we remove client mutex protection, we'll need to ensure that stateowner lookup and creation are atomic between concurrent compounds. Ensure that alloc_init_lock_stateowner checks the hashtable under the client_lock before adding a new element. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
2014-07-29nfsd: Protect adding/removing open state owners using client_lockTrond Myklebust
Once we remove client mutex protection, we'll need to ensure that stateowner lookup and creation are atomic between concurrent compounds. Ensure that alloc_init_open_stateowner checks the hashtable under the client_lock before adding a new element. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
2014-07-29nfsd: don't allow CLOSE to proceed until refcount on stateid dropsJeff Layton
Once we remove client_mutex protection, it'll be possible to have an in-flight operation using an openstateid when a CLOSE call comes in. If that happens, we can't just put the sc_file reference and clear its pointer without risking an oops. Fix this by ensuring that v4.0 CLOSE operations wait for the refcount to drop before proceeding to do so. Signed-off-by: Jeff Layton <jlayton@primarydata.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
2014-07-29nfsd: make openstateids hold references to their openownersJeff Layton
Change it so that only openstateids hold persistent references to openowners. References can still be held by compounds in progress. With this, we can get rid of NFS4_OO_NEW. It's possible that we will create a new openowner in the process of doing the open, but something later fails. In the meantime, another task could find that openowner and start using it on a successful open. If that occurs we don't necessarily want to tear it down, just put the reference that the failing compound holds. Signed-off-by: Jeff Layton <jlayton@primarydata.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
2014-07-29nfsd: clean up refcounting for lockownersJeff Layton
Ensure that lockowner references are only held by lockstateids and operations that are in-progress. With this, we can get rid of release_lockowner_if_empty, which will be racy once we remove client_mutex protection. Signed-off-by: Jeff Layton <jlayton@primarydata.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>