summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* xfs: switch to ->write_iter()Al Viro2014-05-061-20/+9
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* afs: switch to ->write_iter()Al Viro2014-05-063-10/+8
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* gfs2: switch to ->write_iter()Al Viro2014-05-061-10/+8
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* nfs: switch to ->write_iter()Al Viro2014-05-063-12/+10
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* ubifs: switch to ->write_iter()Al Viro2014-05-061-12/+7
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* bury __generic_file_aio_write()Al Viro2014-05-062-12/+0
| | | | | | all users converted to __generic_file_write_iter() now Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* cifs: switch to ->write_iter()Al Viro2014-05-063-42/+35
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* udf: switch to ->write_iter()Al Viro2014-05-061-6/+5
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* convert ext4 to ->write_iter()Al Viro2014-05-061-18/+11
| | | | | | | | | | | unfortunately, Ted's changes to ext4_file_write() are *still* an incomplete fix - playing with rlimits can let you smuggle an unaligned request past the checks. So there almost certainly will be more merge PITA around that place... [fix from Peter Ujfalusi <peter.ujfalusi@ti.com> folded] Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* Merge ext4 changes in ext4_file_write() into for-nextAl Viro2014-05-069-250/+244
|\ | | | | | | From ext4.git#dev, needed for switch of ext4 to ->write_iter() ;-/
| * ext4: fix locking for O_APPEND writesTheodore Ts'o2014-04-211-16/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | Al Viro pointed out that locking for O_APPEND writes was problematic, since the location of the write isn't known until after we take the i_mutex, which impacts the ext4_unaligned_aio() and s_bitmap_maxbytes check. For O_APPEND always assume that the write is unaligned so call ext4_unwritten_wait(). And to solve the second problem, take the i_mutex earlier before we start the s_bitmap_maxbytes check. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
| * ext4: factor out common code in ext4_file_write()Theodore Ts'o2014-04-211-34/+22
| | | | | | | | | | | | | | This shouldn't change any logic flow; just delete duplicated code. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Reviewed-by: Jan Kara <jack@suse.cz>
| * ext4: move ext4_file_dio_write() into ext4_file_write()Theodore Ts'o2014-04-211-74/+64
| | | | | | | | | | | | | | | | This commit doesn't actually change anything; it just moves code around in preparation for some code simplification work. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Reviewed-by: Jan Kara <jack@suse.cz>
| * ext4: inline generic_file_aio_write() into ext4_file_write()Theodore Ts'o2014-04-211-4/+16
| | | | | | | | | | | | | | | | | | Copy generic_file_aio_write() into ext4_file_write(). This is part of a patch series which allows us to simplify ext4_file_write() and ext4_file_dio_write(), by calling __generic_file_aio_write() directly. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Reviewed-by: Jan Kara <jack@suse.cz>
| * ext4: rename uninitialized extents to unwrittenLukas Czerner2014-04-209-163/+163
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently in ext4 there is quite a mess when it comes to naming unwritten extents. Sometimes we call it uninitialized and sometimes we refer to it as unwritten. The right name for the extent which has been allocated but does not contain any written data is _unwritten_. Other file systems are using this name consistently, even the buffer head state refers to it as unwritten. We need to fix this confusion in ext4. This commit changes every reference to an uninitialized extent (meaning allocated but unwritten) to unwritten extent. This includes comments, function names and variable names. It even covers abbreviation of the word uninitialized (such as uninit) and some misspellings. This commit does not change any of the code paths at all. This has been confirmed by comparing md5sums of the assembly code of each object file after all the function names were stripped from it. Signed-off-by: Lukas Czerner <lczerner@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
| * ext4: get rid of EXT4_MAP_UNINIT flagLukas Czerner2014-04-204-13/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently EXT4_MAP_UNINIT is used in dioread_nolock case to mark the cases where we're using dioread_nolock and we're writing into either unallocated, or unwritten extent, because we need to make sure that any DIO write into that inode will wait for the extent conversion. However EXT4_MAP_UNINIT is not only entirely misleading name but also unnecessary because we can check for EXT4_MAP_UNWRITTEN in the dioread_nolock case instead. This commit removes EXT4_MAP_UNINIT flag. Signed-off-by: Lukas Czerner <lczerner@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* | blkdev_aio_write() - turn into blkdev_write_iter()Al Viro2014-05-063-14/+9
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | write_iter variants of {__,}generic_file_aio_write()Al Viro2014-05-0629-79/+94
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | ceph: switch to ->read_iter()Al Viro2014-05-061-11/+7
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | nfs: switch to ->read_iter()Al Viro2014-05-063-14/+9
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | fs/block_dev.c: switch to ->read_iter()Al Viro2014-05-061-10/+6
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | shmem: switch to ->read_iter()Al Viro2014-05-061-10/+5
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | pipe: switch to ->read_iter()Al Viro2014-05-061-11/+5
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | cifs: switch to ->read_iter()Al Viro2014-05-063-32/+22
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | fuse_file_aio_read(): convert to ->read_iter()Al Viro2014-05-061-6/+5
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | ocfs2: switch to ->read_iter()Al Viro2014-05-061-11/+10
| | | | | | | | | | | | tracepoints are evil, exhibit #6969... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | ecryptfs: switch to ->read_iter()Al Viro2014-05-061-5/+4
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | xfs: switch to ->read_iter()Al Viro2014-05-061-12/+7
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | switch simple generic_file_aio_read() users to ->read_iter()Al Viro2014-05-0635-75/+75
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | new methods: ->read_iter() and ->write_iter()Al Viro2014-05-067-13/+121
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Beginning to introduce those. Just the callers for now, and it's clumsier than it'll eventually become; once we finish converting aio_read and aio_write instances, the things will get nicer. For now, these guys are in parallel to ->aio_read() and ->aio_write(); they take iocb and iov_iter, with everything in iov_iter already validated. File offset is passed in iocb->ki_pos, iov/nr_segs - in iov_iter. Main concerns in that series are stack footprint and ability to split the damn thing cleanly. [fix from Peter Ujfalusi <peter.ujfalusi@ti.com> folded] Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | replace checking for ->read/->aio_read presence with check in ->f_modeAl Viro2014-05-066-11/+23
| | | | | | | | | | | | | | | | | | | | | | Since we are about to introduce new methods (read_iter/write_iter), the tests in a bunch of places would have to grow inconveniently. Check once (at open() time) and store results in ->f_mode as FMODE_CAN_READ and FMODE_CAN_WRITE resp. It might end up being a temporary measure - once everything switches from ->aio_{read,write} to ->{read,write}_iter it might make sense to return to open-coded checks. We'll see... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | xfs: trim the argument lists of xfs_file_{dio,buffered}_aio_write()Al Viro2014-05-061-19/+14
| | | | | | | | | | | | | | pos is redundant (it's iocb->ki_pos), and iov/nr_segs/count are taken care of by lifting iov_iter into the caller. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | blkdev_aio_read(): switch to generic_file_read_iter(), get rid of iov_shorten()Al Viro2014-05-061-3/+6
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | iov_iter_truncate()Al Viro2014-05-067-42/+40
| | | | | | | | | | | | | | | | | | | | | | | | Now It Can Be Done(tm) - we don't need to do iov_shorten() in generic_file_direct_write() anymore, now that all ->direct_IO() instances are converted to proper iov_iter methods and honour iter->count and iter->iov_offset properly. Get rid of count/ocount arguments of generic_file_direct_write(), while we are at it. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | btrfs: switch check_direct_IO() to iov_iterAl Viro2014-05-061-25/+15
| | | | | | | | | | | | ... and don't open-code iov_iter_alignment() there Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | new helper: iov_iter_get_pages_alloc()Al Viro2014-05-064-257/+167
| | | | | | | | | | | | | | | | same as iov_iter_get_pages(), except that pages array is allocated (kmalloc if possible, vmalloc if that fails) and left for caller to free. Lustre and NFS ->direct_IO() switched to it. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | new helper: iov_iter_npages()Al Viro2014-05-064-22/+31
| | | | | | | | | | | | | | | | counts the pages covered by iov_iter, up to given limit. do_block_direct_io() and fuse_iter_npages() switched to it. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | f2fs: switch to iov_iter_alignment()Al Viro2014-05-061-6/+5
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | fuse: switch to iov_iter_get_pages()Al Viro2014-05-061-21/+12
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | fuse: pull iov_iter initializations upAl Viro2014-05-063-30/+38
| | | | | | | | | | | | | | ... to fuse_direct_{read,write}(). ->direct_IO() path uses the iov_iter passed by the caller instead. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | new helper: iov_iter_get_pages()Al Viro2014-05-063-73/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | iov_iter_get_pages(iter, pages, maxsize, &start) grabs references pinning the pages of up to maxsize of (contiguous) data from iter. Returns the amount of memory grabbed or -error. In case of success, the requested area begins at offset start in pages[0] and runs through pages[1], etc. Less than requested amount might be returned - either because the contiguous area in the beginning of iterator is smaller than requested, or because the kernel failed to pin that many pages. direct-io.c switched to using iov_iter_get_pages() Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | dio: take updating ->result into do_direct_IO()Al Viro2014-05-061-4/+2
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | start adding the tag to iov_iterAl Viro2014-05-0615-35/+41
| | | | | | | | | | | | | | | | | | For now, just use the same thing we pass to ->direct_IO() - it's all iovec-based at the moment. Pass it explicitly to iov_iter_init() and account for kvec vs. iovec in there, by the same kludge NFS ->direct_IO() uses. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | new helper: generic_file_read_iter()Al Viro2014-05-064-48/+37
| | | | | | | | | | | | | | | | | | iov_iter-using variant of generic_file_aio_read(). Some callers converted. Note that it's still not quite there for use as ->read_iter() - we depend on having zero iter->iov_offset in O_DIRECT case. Fortunately, that's true for all converted callers (and for generic_file_aio_read() itself). Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | fuse_file_aio_write(): merge initializations of iov_iterAl Viro2014-05-061-2/+1
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | ceph_aio_read(): keep iov_iter across retriesAl Viro2014-05-061-6/+8
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | new primitive: iov_iter_alignment()Al Viro2014-05-064-27/+34
| | | | | | | | | | | | | | returns the value aligned as badly as the worst remaining segment in iov_iter is. Use instead of open-coded equivalents. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | give ->direct_IO() a copy of iov_iterAl Viro2014-05-061-3/+7
| | | | | | | | | | | | | | | | | | | | | | the thing is, we want to advance what's given to ->direct_IO() as we are forming the request; however, the callers care about the amount of data actually transferred, not the amount we tried to transfer. It's more convenient to allow ->direct_IO() instances do use iov_iter_advance() on the copy of iov_iter, leaving the actual advancing of the original to caller. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | switch {__,}blockdev_direct_IO() to iov_iterAl Viro2014-05-0619-60/+49
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | get rid of pointless iov_length() in ->direct_IO()Al Viro2014-05-0618-30/+32
| | | | | | | | | | | | all callers have iov_length(iter->iov, iter->nr_segs) == iov_iter_count(iter) Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>