diff mbox series

[4/7] add llseek_nowait() for struct file_operations

Message ID 20230726102603.155522-5-hao.xu@linux.dev (mailing list archive)
State New, archived
Headers show
Series io_uring lseek | expand

Commit Message

Hao Xu July 26, 2023, 10:26 a.m. UTC
From: Hao Xu <howeyxu@tencent.com>

Add a new function member llseek_nowait() in struct file_operations for
nowait llseek. It act just like llseek() but has an extra boolean
parameter called nowait to indicate if it's a nowait try, avoid IO and
locks if so.

Signed-off-by: Hao Xu <howeyxu@tencent.com>
---
 include/linux/fs.h | 1 +
 1 file changed, 1 insertion(+)

Comments

Matthew Wilcox July 27, 2023, 1:25 p.m. UTC | #1
On Wed, Jul 26, 2023 at 06:26:00PM +0800, Hao Xu wrote:
> +	loff_t (*llseek_nowait)(struct file *, loff_t, int, bool);

You don't have to name the struct file, but an unnamed int and an
unnamed bool is just not acceptable.
diff mbox series

Patch

diff --git a/include/linux/fs.h b/include/linux/fs.h
index f3e315e8efdd..d37290da2d7e 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1823,6 +1823,7 @@  struct file_operations {
 	int (*uring_cmd)(struct io_uring_cmd *ioucmd, unsigned int issue_flags);
 	int (*uring_cmd_iopoll)(struct io_uring_cmd *, struct io_comp_batch *,
 				unsigned int poll_flags);
+	loff_t (*llseek_nowait)(struct file *, loff_t, int, bool);
 } __randomize_layout;
 
 struct inode_operations {