mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
block: Annotate the queue limits functions
Let the thread-safety checker verify whether every start of a queue limits update is followed by a call to a function that finishes a queue limits update. Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Hannes Reinecke <hare@kernel.org> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> Link: https://patch.msgid.link/8f71062b6d0fcf2b80bc8cda701c453224755439.1780682325.git.bvanassche@acm.org Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
7e712f292e
commit
08d912bc44
|
|
@ -1092,15 +1092,17 @@ static inline unsigned int blk_boundary_sectors_left(sector_t offset,
|
|||
*/
|
||||
static inline struct queue_limits
|
||||
queue_limits_start_update(struct request_queue *q)
|
||||
__acquires(&q->limits_lock)
|
||||
{
|
||||
mutex_lock(&q->limits_lock);
|
||||
return q->limits;
|
||||
}
|
||||
int queue_limits_commit_update_frozen(struct request_queue *q,
|
||||
struct queue_limits *lim);
|
||||
struct queue_limits *lim) __releases(&q->limits_lock);
|
||||
int queue_limits_commit_update(struct request_queue *q,
|
||||
struct queue_limits *lim);
|
||||
int queue_limits_set(struct request_queue *q, struct queue_limits *lim);
|
||||
struct queue_limits *lim) __releases(&q->limits_lock);
|
||||
int queue_limits_set(struct request_queue *q, struct queue_limits *lim)
|
||||
__must_not_hold(&q->limits_lock);
|
||||
int blk_validate_limits(struct queue_limits *lim);
|
||||
|
||||
/**
|
||||
|
|
@ -1112,6 +1114,7 @@ int blk_validate_limits(struct queue_limits *lim);
|
|||
* starting update.
|
||||
*/
|
||||
static inline void queue_limits_cancel_update(struct request_queue *q)
|
||||
__releases(&q->limits_lock)
|
||||
{
|
||||
mutex_unlock(&q->limits_lock);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user