@@ -53,11 +53,11 @@ int io_unregister_pbuf_ring(struct io_ring_ctx *ctx, void __user *arg);
53
53
54
54
unsigned int __io_put_kbuf (struct io_kiocb * req , unsigned issue_flags );
55
55
56
- void io_kbuf_recycle_legacy (struct io_kiocb * req , unsigned issue_flags );
56
+ bool io_kbuf_recycle_legacy (struct io_kiocb * req , unsigned issue_flags );
57
57
58
58
void * io_pbuf_get_address (struct io_ring_ctx * ctx , unsigned long bgid );
59
59
60
- static inline void io_kbuf_recycle_ring (struct io_kiocb * req )
60
+ static inline bool io_kbuf_recycle_ring (struct io_kiocb * req )
61
61
{
62
62
/*
63
63
* We don't need to recycle for REQ_F_BUFFER_RING, we can just clear
@@ -80,8 +80,10 @@ static inline void io_kbuf_recycle_ring(struct io_kiocb *req)
80
80
} else {
81
81
req -> buf_index = req -> buf_list -> bgid ;
82
82
req -> flags &= ~REQ_F_BUFFER_RING ;
83
+ return true;
83
84
}
84
85
}
86
+ return false;
85
87
}
86
88
87
89
static inline bool io_do_buffer_select (struct io_kiocb * req )
@@ -91,12 +93,13 @@ static inline bool io_do_buffer_select(struct io_kiocb *req)
91
93
return !(req -> flags & (REQ_F_BUFFER_SELECTED |REQ_F_BUFFER_RING ));
92
94
}
93
95
94
- static inline void io_kbuf_recycle (struct io_kiocb * req , unsigned issue_flags )
96
+ static inline bool io_kbuf_recycle (struct io_kiocb * req , unsigned issue_flags )
95
97
{
96
98
if (req -> flags & REQ_F_BUFFER_SELECTED )
97
- io_kbuf_recycle_legacy (req , issue_flags );
99
+ return io_kbuf_recycle_legacy (req , issue_flags );
98
100
if (req -> flags & REQ_F_BUFFER_RING )
99
- io_kbuf_recycle_ring (req );
101
+ return io_kbuf_recycle_ring (req );
102
+ return false;
100
103
}
101
104
102
105
static inline unsigned int __io_put_kbuf_list (struct io_kiocb * req ,
0 commit comments