On Fri, May 20, 2022 at 11:36:36AM -0700, Stefan Roesch wrote: > @@ -765,14 +765,22 @@ static loff_t iomap_write_iter(struct iomap_iter *iter, struct iov_iter *i) > do { > struct folio *folio; > struct page *page; > + struct address_space *mapping = iter->inode->i_mapping; > unsigned long offset; /* Offset into pagecache page */ > unsigned long bytes; /* Bytes to write to page */ > size_t copied; /* Bytes copied from user */ > + unsigned int bdp_flags = > + (iter->flags & IOMAP_NOWAIT) ? BDP_ASYNC : 0; Bot the mapping and bdp_flags don't change over the loop iterations, so we can initialize them once at the start of the function. Otherwise this looks good, but I think this should go into the previous patch as it is a central part of supporting async buffered writes.