Lines Matching +full:buffered +full:- +full:negative
1 // SPDX-License-Identifier: GPL-2.0-or-later
14 struct inode *inode = wreq->inode; in netfs_cleanup_dio_write()
15 unsigned long long end = wreq->start + wreq->transferred; in netfs_cleanup_dio_write()
17 if (!wreq->error && in netfs_cleanup_dio_write()
19 if (wreq->netfs_ops->update_i_size) in netfs_cleanup_dio_write()
20 wreq->netfs_ops->update_i_size(inode, end); in netfs_cleanup_dio_write()
34 unsigned long long start = iocb->ki_pos; in netfs_unbuffered_write_iter_locked()
48 _debug("uw %llx-%llx", start, end); in netfs_unbuffered_write_iter_locked()
50 wreq = netfs_create_write_req(iocb->ki_filp->f_mapping, iocb->ki_filp, start, in netfs_unbuffered_write_iter_locked()
51 iocb->ki_flags & IOCB_DIRECT ? in netfs_unbuffered_write_iter_locked()
56 wreq->io_streams[0].avail = true; in netfs_unbuffered_write_iter_locked()
57 trace_netfs_write(wreq, (iocb->ki_flags & IOCB_DIRECT ? in netfs_unbuffered_write_iter_locked()
71 n = netfs_extract_user_iter(iter, len, &wreq->iter, 0); in netfs_unbuffered_write_iter_locked()
76 wreq->direct_bv = (struct bio_vec *)wreq->iter.bvec; in netfs_unbuffered_write_iter_locked()
77 wreq->direct_bv_count = n; in netfs_unbuffered_write_iter_locked()
78 wreq->direct_bv_unpin = iov_iter_extract_will_pin(iter); in netfs_unbuffered_write_iter_locked()
80 wreq->iter = *iter; in netfs_unbuffered_write_iter_locked()
83 wreq->io_iter = wreq->iter; in netfs_unbuffered_write_iter_locked()
86 __set_bit(NETFS_RREQ_USE_IO_ITER, &wreq->flags); in netfs_unbuffered_write_iter_locked()
92 __set_bit(NETFS_RREQ_UPLOAD_TO_SERVER, &wreq->flags); in netfs_unbuffered_write_iter_locked()
94 wreq->iocb = iocb; in netfs_unbuffered_write_iter_locked()
95 wreq->len = iov_iter_count(&wreq->io_iter); in netfs_unbuffered_write_iter_locked()
96 wreq->cleanup = netfs_cleanup_dio_write; in netfs_unbuffered_write_iter_locked()
97 ret = netfs_unbuffered_write(wreq, is_sync_kiocb(iocb), wreq->len); in netfs_unbuffered_write_iter_locked()
105 wait_on_bit(&wreq->flags, NETFS_RREQ_IN_PROGRESS, in netfs_unbuffered_write_iter_locked()
108 ret = wreq->error; in netfs_unbuffered_write_iter_locked()
110 ret = wreq->transferred; in netfs_unbuffered_write_iter_locked()
111 iocb->ki_pos += ret; in netfs_unbuffered_write_iter_locked()
114 ret = -EIOCBQUEUED; in netfs_unbuffered_write_iter_locked()
124 * netfs_unbuffered_write_iter - Unbuffered write to a file
132 * * Negative error code if no data has been written at all of
138 struct file *file = iocb->ki_filp; in netfs_unbuffered_write_iter()
139 struct address_space *mapping = file->f_mapping; in netfs_unbuffered_write_iter()
140 struct inode *inode = mapping->host; in netfs_unbuffered_write_iter()
143 loff_t pos = iocb->ki_pos; in netfs_unbuffered_write_iter()
144 unsigned long long end = pos + iov_iter_count(from) - 1; in netfs_unbuffered_write_iter()
166 if (iocb->ki_flags & IOCB_NOWAIT) { in netfs_unbuffered_write_iter()
168 ret = -EAGAIN; in netfs_unbuffered_write_iter()
179 * After a write we want buffered reads to be sure to go to disk to get in netfs_unbuffered_write_iter()
182 * without clobbering -EIOCBQUEUED from ->direct_IO(). in netfs_unbuffered_write_iter()
187 end = iocb->ki_pos + iov_iter_count(from); in netfs_unbuffered_write_iter()
188 if (end > ictx->zero_point) in netfs_unbuffered_write_iter()
189 ictx->zero_point = end; in netfs_unbuffered_write_iter()