mirror of
https://github.com/versity/scoutfs.git
synced 2026-08-15 19:56:36 +00:00
Compat for iomap private and write_ops arguments
The iomap read/write entry points have grown arguments that el10 has picked up. Since v5.18-rc7-162-g786f847f43a5 iomap_dio_rw() takes a private pointer that it stashes in the iomap_iter for the filesystem's use, and since v6.16-rc1-11-g2a5574fc57d1 the iomap_folio_ops that used to hang off the iomap are passed to iomap_file_buffered_write() as iomap_write_ops, which also gained a private pointer of its own. We have neither per-iter state nor write ops, so the compat wrappers just pass nulls for the new arguments, which the iomap code checks for. While we're in here, drop the extern for scoutfs_iomap_page_ops. It was never defined, and struct iomap_page_ops no longer exists upstream. Signed-off-by: Auke Kok <auke.kok@versity.com>
This commit is contained in:
@@ -361,3 +361,24 @@ endif
|
||||
ifneq (,$(shell grep 'copy_page_to_iter_nofault' include/linux/uio.h))
|
||||
ccflags-y += -DKC_USE_IOMAP_FOR_IO
|
||||
endif
|
||||
|
||||
#
|
||||
# v5.18-rc7-162-g786f847f43a5
|
||||
#
|
||||
# iomap_dio_rw() takes a private pointer that it stores in the iomap_iter
|
||||
# for the filesystem's use.
|
||||
#
|
||||
ifneq (,$(shell grep 'unsigned int dio_flags, void .private' include/linux/iomap.h))
|
||||
ccflags-y += -DKC_IOMAP_DIO_RW_PRIVATE
|
||||
endif
|
||||
|
||||
#
|
||||
# v6.16-rc1-11-g2a5574fc57d1
|
||||
#
|
||||
# The iomap_folio_ops that used to hang off the iomap are replaced by
|
||||
# iomap_write_ops which are passed to iomap_file_buffered_write() along
|
||||
# with a private pointer.
|
||||
#
|
||||
ifneq (,$(shell grep 'const struct iomap_write_ops .write_ops, void .private' include/linux/iomap.h))
|
||||
ccflags-y += -DKC_IOMAP_WRITE_OPS
|
||||
endif
|
||||
|
||||
+5
-5
@@ -154,7 +154,7 @@ static ssize_t scoutfs_file_direct_read(struct kiocb *iocb, struct iov_iter *to,
|
||||
retry:
|
||||
pagefault_disable();
|
||||
to->nofault = true;
|
||||
ret = iomap_dio_rw(iocb, to, &scoutfs_iomap_ops, NULL, IOMAP_DIO_PARTIAL, read);
|
||||
ret = KC_IOMAP_DIO_RW(iocb, to, &scoutfs_iomap_ops, NULL, IOMAP_DIO_PARTIAL, read);
|
||||
to->nofault = false;
|
||||
pagefault_enable();
|
||||
|
||||
@@ -336,9 +336,9 @@ retry:
|
||||
* any needed pages later on.
|
||||
*/
|
||||
from->nofault = true;
|
||||
ret = iomap_dio_rw(iocb, from, &scoutfs_iomap_ops, NULL,
|
||||
IOMAP_DIO_PARTIAL | IOMAP_DIO_FORCE_WAIT,
|
||||
written);
|
||||
ret = KC_IOMAP_DIO_RW(iocb, from, &scoutfs_iomap_ops, NULL,
|
||||
IOMAP_DIO_PARTIAL | IOMAP_DIO_FORCE_WAIT,
|
||||
written);
|
||||
from->nofault = false;
|
||||
|
||||
if (ret <= 0) {
|
||||
@@ -410,7 +410,7 @@ retry:
|
||||
locked = true;
|
||||
|
||||
pagefault_disable();
|
||||
ret = iomap_file_buffered_write(iocb, from, &scoutfs_iomap_ops);
|
||||
ret = KC_IOMAP_FILE_BUFFERED_WRITE(iocb, from, &scoutfs_iomap_ops);
|
||||
pagefault_enable();
|
||||
|
||||
/* Accumulate the count of what's been written so far */
|
||||
|
||||
@@ -3,6 +3,5 @@
|
||||
|
||||
extern const struct iomap_ops scoutfs_iomap_report_ops;
|
||||
extern const struct iomap_ops scoutfs_iomap_ops;
|
||||
extern const struct iomap_page_ops scoutfs_iomap_page_ops;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -374,6 +374,26 @@ static inline long inode_get_atime_nsec(const struct inode *inode)
|
||||
#define KC_PAGE_OR_FOLIO(p, f) p
|
||||
#endif
|
||||
|
||||
/*
|
||||
* We don't have any per-iter state or write ops of our own, so we just
|
||||
* pass in nulls for the newer arguments.
|
||||
*/
|
||||
#ifdef KC_IOMAP_DIO_RW_PRIVATE
|
||||
#define KC_IOMAP_DIO_RW(iocb, iter, ops, dops, dio_flags, done_before) \
|
||||
iomap_dio_rw(iocb, iter, ops, dops, dio_flags, NULL, done_before)
|
||||
#else
|
||||
#define KC_IOMAP_DIO_RW(iocb, iter, ops, dops, dio_flags, done_before) \
|
||||
iomap_dio_rw(iocb, iter, ops, dops, dio_flags, done_before)
|
||||
#endif
|
||||
|
||||
#ifdef KC_IOMAP_WRITE_OPS
|
||||
#define KC_IOMAP_FILE_BUFFERED_WRITE(iocb, iter, ops) \
|
||||
iomap_file_buffered_write(iocb, iter, ops, NULL, NULL)
|
||||
#else
|
||||
#define KC_IOMAP_FILE_BUFFERED_WRITE(iocb, iter, ops) \
|
||||
iomap_file_buffered_write(iocb, iter, ops)
|
||||
#endif
|
||||
|
||||
#ifndef KC_TIMER_CONTAINER_OF
|
||||
#define timer_container_of(var, callback_timer, timer_fieldname) \
|
||||
from_timer(var, callback_timer, timer_fieldname)
|
||||
|
||||
Reference in New Issue
Block a user