[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210127150029.13766-2-joshi.k@samsung.com>
Date: Wed, 27 Jan 2021 20:30:26 +0530
From: Kanchan Joshi <joshi.k@...sung.com>
To: axboe@...nel.dk, kbusch@...nel.org, hch@....de, sagi@...mberg.me
Cc: linux-nvme@...ts.infradead.org, io-uring@...r.kernel.org,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
javier.gonz@...sung.com, nj.shetty@...sung.com,
selvakuma.s1@...sung.com, Kanchan Joshi <joshi.k@...sung.com>
Subject: [RFC PATCH 1/4] block: introduce async ioctl operation
Add a new block-dev operation for async-ioctl.
Driver managing the block-dev can choose to implement it.
Signed-off-by: Kanchan Joshi <joshi.k@...sung.com>
---
include/linux/blkdev.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index f94ee3089e01..c9f6cc26d675 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1848,6 +1848,16 @@ static inline void blk_ksm_unregister(struct request_queue *q) { }
#endif /* CONFIG_BLK_INLINE_ENCRYPTION */
+struct pt_ioctl_ctx {
+ /* submitter task context */
+ struct task_struct *task;
+ /* callback supplied by upper layer */
+ void (*pt_complete)(struct pt_ioctl_ctx *ptioc, long ret);
+ /* driver-allocated data */
+ void *ioc_data;
+ /* to schedule task-work */
+ struct callback_head pt_work;
+};
struct block_device_operations {
blk_qc_t (*submit_bio) (struct bio *bio);
@@ -1856,6 +1866,8 @@ struct block_device_operations {
int (*rw_page)(struct block_device *, sector_t, struct page *, unsigned int);
int (*ioctl) (struct block_device *, fmode_t, unsigned, unsigned long);
int (*compat_ioctl) (struct block_device *, fmode_t, unsigned, unsigned long);
+ int (*async_ioctl) (struct block_device *, fmode_t, unsigned, unsigned long,
+ struct pt_ioctl_ctx *);
unsigned int (*check_events) (struct gendisk *disk,
unsigned int clearing);
void (*unlock_native_capacity) (struct gendisk *);
--
2.25.1
Powered by blists - more mailing lists