lkml.org 
[lkml]   [2021]   [Jan]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC PATCH 1/4] block: introduce async ioctl operation
Date
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@samsung.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
\
 
 \ /
  Last update: 2021-01-27 17:01    [W:0.072 / U:0.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site