1616 * Private flags for iomap_dio, must not overlap with the public ones in
1717 * iomap.h:
1818 */
19- #define IOMAP_DIO_NO_INVALIDATE (1U << 25)
20- #define IOMAP_DIO_CALLER_COMP (1U << 26)
19+ #define IOMAP_DIO_NO_INVALIDATE (1U << 26)
2120#define IOMAP_DIO_INLINE_COMP (1U << 27)
2221#define IOMAP_DIO_WRITE_THROUGH (1U << 28)
2322#define IOMAP_DIO_NEED_SYNC (1U << 29)
@@ -140,11 +139,6 @@ ssize_t iomap_dio_complete(struct iomap_dio *dio)
140139}
141140EXPORT_SYMBOL_GPL (iomap_dio_complete );
142141
143- static ssize_t iomap_dio_deferred_complete (void * data )
144- {
145- return iomap_dio_complete (data );
146- }
147-
148142static void iomap_dio_complete_work (struct work_struct * work )
149143{
150144 struct iomap_dio * dio = container_of (work , struct iomap_dio , aio .work );
@@ -182,29 +176,6 @@ static void iomap_dio_done(struct iomap_dio *dio)
182176 } else if (dio -> flags & IOMAP_DIO_INLINE_COMP ) {
183177 WRITE_ONCE (iocb -> private , NULL );
184178 iomap_dio_complete_work (& dio -> aio .work );
185- } else if (dio -> flags & IOMAP_DIO_CALLER_COMP ) {
186- /*
187- * If this dio is flagged with IOMAP_DIO_CALLER_COMP, then
188- * schedule our completion that way to avoid an async punt to a
189- * workqueue.
190- */
191- /* only polled IO cares about private cleared */
192- iocb -> private = dio ;
193- iocb -> dio_complete = iomap_dio_deferred_complete ;
194-
195- /*
196- * Invoke ->ki_complete() directly. We've assigned our
197- * dio_complete callback handler, and since the issuer set
198- * IOCB_DIO_CALLER_COMP, we know their ki_complete handler will
199- * notice ->dio_complete being set and will defer calling that
200- * handler until it can be done from a safe task context.
201- *
202- * Note that the 'res' being passed in here is not important
203- * for this case. The actual completion value of the request
204- * will be gotten from dio_complete when that is run by the
205- * issuer.
206- */
207- iocb -> ki_complete (iocb , 0 );
208179 } else {
209180 struct inode * inode = file_inode (iocb -> ki_filp );
210181
@@ -261,7 +232,6 @@ u32 iomap_finish_ioend_direct(struct iomap_ioend *ioend)
261232 dio -> flags |= IOMAP_DIO_INLINE_COMP ;
262233 dio -> flags |= IOMAP_DIO_NO_INVALIDATE ;
263234 }
264- dio -> flags &= ~IOMAP_DIO_CALLER_COMP ;
265235 iomap_dio_done (dio );
266236 }
267237
@@ -380,19 +350,6 @@ static int iomap_dio_bio_iter(struct iomap_iter *iter, struct iomap_dio *dio)
380350
381351 if (!(bio_opf & REQ_FUA ))
382352 dio -> flags &= ~IOMAP_DIO_WRITE_THROUGH ;
383-
384- /*
385- * We can only do deferred completion for pure overwrites that
386- * don't require additional I/O at completion time.
387- *
388- * This rules out writes that need zeroing or extent conversion,
389- * extend the file size, or issue metadata I/O or cache flushes
390- * during completion processing.
391- */
392- if (need_zeroout || (pos >= i_size_read (inode )) ||
393- ((dio -> flags & IOMAP_DIO_NEED_SYNC ) &&
394- !(bio_opf & REQ_FUA )))
395- dio -> flags &= ~IOMAP_DIO_CALLER_COMP ;
396353 } else {
397354 bio_opf |= REQ_OP_READ ;
398355 }
@@ -413,7 +370,7 @@ static int iomap_dio_bio_iter(struct iomap_iter *iter, struct iomap_dio *dio)
413370 * ones we set for inline and deferred completions. If none of those
414371 * are available for this IO, clear the polled flag.
415372 */
416- if (!(dio -> flags & ( IOMAP_DIO_INLINE_COMP | IOMAP_DIO_CALLER_COMP ) ))
373+ if (!(dio -> flags & IOMAP_DIO_INLINE_COMP ))
417374 dio -> iocb -> ki_flags &= ~IOCB_HIPRI ;
418375
419376 if (need_zeroout ) {
@@ -669,15 +626,6 @@ __iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter,
669626 iomi .flags |= IOMAP_WRITE ;
670627 dio -> flags |= IOMAP_DIO_WRITE ;
671628
672- /*
673- * Flag as supporting deferred completions, if the issuer
674- * groks it. This can avoid a workqueue punt for writes.
675- * We may later clear this flag if we need to do other IO
676- * as part of this IO completion.
677- */
678- if (iocb -> ki_flags & IOCB_DIO_CALLER_COMP )
679- dio -> flags |= IOMAP_DIO_CALLER_COMP ;
680-
681629 if (dio_flags & IOMAP_DIO_OVERWRITE_ONLY ) {
682630 ret = - EAGAIN ;
683631 if (iomi .pos >= dio -> i_size ||
0 commit comments