xfs: annotate functions that trip static checker locking checks

Add some lock annotations to helper functions that seem to have
unbalanced locking that confuses the static analyzers.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
Darrick J. Wong
2019-11-06 08:41:20 -08:00
parent cf085a1b5d
commit f755979355
2 changed files with 7 additions and 1 deletions

View File

@@ -2808,6 +2808,8 @@ xlog_state_do_iclog_callbacks(
struct xlog *log, struct xlog *log,
struct xlog_in_core *iclog, struct xlog_in_core *iclog,
bool aborted) bool aborted)
__releases(&log->l_icloglock)
__acquires(&log->l_icloglock)
{ {
spin_unlock(&log->l_icloglock); spin_unlock(&log->l_icloglock);
spin_lock(&iclog->ic_callback_lock); spin_lock(&iclog->ic_callback_lock);

View File

@@ -537,7 +537,11 @@ xlog_cil_force(struct xlog *log)
* by a spinlock. This matches the semantics of all the wait queues used in the * by a spinlock. This matches the semantics of all the wait queues used in the
* log code. * log code.
*/ */
static inline void xlog_wait(wait_queue_head_t *wq, spinlock_t *lock) static inline void
xlog_wait(
struct wait_queue_head *wq,
struct spinlock *lock)
__releases(lock)
{ {
DECLARE_WAITQUEUE(wait, current); DECLARE_WAITQUEUE(wait, current);