summaryrefslogtreecommitdiffstats
path: root/fs
AgeCommit message (Collapse)AuthorFilesLines
2015-04-15VFS: normal filesystems (and lustre): d_inode() annotationsDavid Howells266-1351/+1350
that's the bulk of filesystem drivers dealing with inodes of their own Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-15VFS: Cachefiles should perform fs modifications on the top layer onlyDavid Howells2-28/+28
Cachefiles should perform fs modifications (eg. vfs_unlink()) on the top layer only and should not attempt to alter the lower layer. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-15configfs: Fix inconsistent use of file_inode() vs file->f_path.dentry->d_inodeDavid Howells1-1/+1
Fix inconsistent use of file_inode() vs file->f_path.dentry->d_inode. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-15VFS: Make pathwalk use d_is_reg() rather than S_ISREG()David Howells1-1/+1
Make pathwalk use d_is_reg() rather than S_ISREG() to determine whether to honour O_TRUNC. Since this occurs after complete_walk(), the dentry type field cannot change and the inode pointer cannot change as we hold a ref on the dentry, so this should be safe. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-15VFS: Fix up debugfs to use d_is_dir() in place of S_ISDIR()David Howells1-1/+1
Fix up debugfs to use d_is_dir(dentry) in place of S_ISDIR(dentry->d_inode->i_mode). Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-15VFS: Combine inode checks with d_is_negative() and d_is_positive() in pathwalkDavid Howells1-3/+3
Where we have: if (!dentry->d_inode || d_is_negative(dentry)) { type constructions in pathwalk we should be able to eliminate the check of d_inode and rely solely on the result of d_is_negative() or d_is_positive(). What we do have to take care to do is to read d_inode after calling a d_is_xxx() typecheck function to get the barriering right. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-15NFS: Don't use d_inode as a variable nameDavid Howells1-4/+4
Don't use d_inode as a variable name as it now masks a function name. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-15VFS: Impose ordering on accesses of d_inode and d_flagsDavid Howells1-8/+39
Impose ordering on accesses of d_inode and d_flags to avoid the need to do this: if (!dentry->d_inode || d_is_negative(dentry)) { when this: if (d_is_negative(dentry)) { should suffice. This check is especially problematic if a dentry can have its type field set to something other than DENTRY_MISS_TYPE when d_inode is NULL (as in unionmount). What we really need to do is stick a write barrier between setting d_inode and setting d_flags and a read barrier between reading d_flags and reading d_inode. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-15nfs: generic_write_checks() shouldn't be done on swapout...Al Viro2-13/+10
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-11ocfs2: use __generic_file_write_iter()Al Viro1-57/+7
we can do that now - all we need is to clear IOCB_DIRECT from ->ki_flags in "can't do dio" case. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-11mirror O_APPEND and O_DIRECT into iocb->ki_flagsAl Viro9-20/+20
... avoiding write_iter/fcntl races. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-11switch generic_write_checks() to iocb and iterAl Viro12-140/+79
... returning -E... upon error and amount of data left in iter after (possible) truncation upon success. Note, that normal case gives a non-zero (positive) return value, so any tests for != 0 _must_ be updated. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Conflicts: fs/ext4/file.c
2015-04-11ocfs2: move generic_write_checks() before the alignment checksAl Viro1-24/+18
Alignment checks for dio depend upon the range truncation done by generic_write_checks(). They can be done as soon as we got ocfs2_rw_lock() and that actually makes ocfs2_prepare_inode_for_write() simpler. The only thing to watch out for is restoring the original count in "unlock and redo without dio" case. Position doesn't need to be restored, since we change it only in O_APPEND case and in that case it will be reassigned anyway. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-11ocfs2_file_write_iter: stop messing with pposAl Viro1-12/+12
it's &iocb->ki_pos; no need to obfuscate. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-11Merge branch 'for-linus' into for-nextAl Viro2-12/+25
2015-04-11udf_file_write_iter: reorder and simplifyAl Viro1-20/+14
it's easier to do generic_write_checks() first Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-11fuse: ->direct_IO() doesn't need generic_write_checks()Al Viro1-8/+3
already done by caller. We used to call __fuse_direct_write(), which called generic_write_checks(); now the former got expanded, bringing the latter to the surface. It used to be called all along and calling it from there had been wrong all along... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-11ext4_file_write_iter: move generic_write_checks() upAl Viro1-19/+20
simpler that way... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-11xfs_file_aio_write_checks: switch to iocb/iov_iterAl Viro1-15/+16
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-11generic_write_checks(): drop isblk argumentAl Viro12-16/+15
all remaining callers are passing 0; some just obscure that fact. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-11blkdev_write_iter: expand generic_file_checks() call in thereAl Viro1-6/+9
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-11lift generic_write_checks() into callers of __generic_file_write_iter()Al Viro4-19/+54
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-11cifs: fold cifs_iovec_write() into the only callerAl Viro1-31/+16
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-11ntfs: move iov_iter_truncate() closer to generic_write_checks()Al Viro1-52/+29
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-11new_sync_write(): discard ->ki_pos unless the return value is positiveAl Viro1-1/+2
That allows ->write_iter() instances much more convenient life wrt iocb->ki_pos (and fixes several filesystems with borderline POSIX violations when zero-length write succeeds and changes the current position). Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-11direct_IO: remove rw from a_ops->direct_IO()Omar Sandoval24-48/+33
Now that no one is using rw, remove it completely. Signed-off-by: Omar Sandoval <osandov@osandov.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-11direct_IO: use iov_iter_rw() instead of rw everywhereOmar Sandoval21-60/+60
The rw parameter to direct_IO is redundant with iov_iter->type, and treated slightly differently just about everywhere it's used: some users do rw & WRITE, and others do rw == WRITE where they should be doing a bitwise check. Simplify this with the new iov_iter_rw() helper, which always returns either READ or WRITE. Signed-off-by: Omar Sandoval <osandov@osandov.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-11Remove rw from dax_{do_,}io()Omar Sandoval4-19/+18
And use iov_iter_rw() instead. Signed-off-by: Omar Sandoval <osandov@osandov.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-11Remove rw from {,__,do_}blockdev_direct_IO()Omar Sandoval19-64/+55
Most filesystems call through to these at some point, so we'll start here. Signed-off-by: Omar Sandoval <osandov@osandov.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-11->aio_read and ->aio_write removedAl Viro4-44/+6
no remaining users Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-11kill do_sync_read/do_sync_writeAl Viro1-38/+0
all remaining instances of aio_{read,write} (all 4 of them) have explicit ->read and ->write resp.; do_sync_read/do_sync_write is never called by __vfs_read/__vfs_write anymore and no other users had been left. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-11fuse: use iov_iter_get_pages() for non-splice pathAl Viro1-24/+17
store reference to iter instead of that to iovec Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-11fuse: switch to ->read_iter/->write_iterAl Viro1-12/+14
we just change the calling conventions here; more work to follow. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-11make new_sync_{read,write}() staticAl Viro47-127/+2
All places outside of core VFS that checked ->read and ->write for being NULL or called the methods directly are gone now, so NULL {read,write} with non-NULL {read,write}_iter will do the right thing in all cases. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-11coredump: accept any write methodAl Viro1-1/+1
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-11export __vfs_read()Al Viro1-8/+5
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-11autofs: switch to __vfs_write()Al Viro2-2/+2
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-11new helper: __vfs_write()Al Viro1-12/+16
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-11Merge branch '9p-iov_iter' into for-nextAl Viro5-366/+139
2015-04-11switch hugetlbfs to ->read_iter()Al Viro1-58/+34
... and fix the case when the area we are asked to read crosses a hugepage boundary Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-11coda: switch to ->read_iter/->write_iterAl Viro1-25/+15
... and request the same from the local cache - all filesystems with anything usable for that support those already. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-11ncpfs: switch to ->read_iter/->write_iterAl Viro3-63/+37
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-119p: we are leaking glock.client_id in v9fs_file_getlock()Al Viro1-0/+2
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-119p: switch to ->read_iter/->write_iterAl Viro1-44/+39
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-119p: get rid of v9fs_direct_file_read()Al Viro2-51/+12
do it in ->direct_IO()... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-119p: switch p9_client_read() to passing struct iov_iter *Al Viro5-118/+46
... and make it loop Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-119p: get rid of v9fs_direct_file_write()Al Viro2-82/+17
just handle it in ->direct_IO() Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-119p: fold v9fs_file_write_internal() into the callerAl Viro2-49/+30
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-119p: switch ->writepage() to direct use of p9_client_write()Al Viro1-22/+13
Don't mess with kmap() - just use ITER_BVEC. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-04-119p: switch p9_client_write() to passing it struct iov_iter *Al Viro2-38/+18
... and make it loop until it's done Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>