Skip to content

Commit

Permalink
[PATCH] lockdep: annotate direct io
Browse files Browse the repository at this point in the history
Teach special (rwsem-in-irq) locking code to the lock validator.  Has no
effect on non-lockdep kernels.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Ingo Molnar authored and Linus Torvalds committed Jul 3, 2006
1 parent 2b105ff commit d8aa905
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fs/direct-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ static void dio_complete(struct dio *dio, loff_t offset, ssize_t bytes)
if (dio->end_io && dio->result)
dio->end_io(dio->iocb, offset, bytes, dio->map_bh.b_private);
if (dio->lock_type == DIO_LOCKING)
up_read(&dio->inode->i_alloc_sem);
/* lockdep: non-owner release */
up_read_non_owner(&dio->inode->i_alloc_sem);
}

/*
Expand Down Expand Up @@ -1261,7 +1262,8 @@ __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
}

if (dio_lock_type == DIO_LOCKING)
down_read(&inode->i_alloc_sem);
/* lockdep: not the owner will release it */
down_read_non_owner(&inode->i_alloc_sem);
}

/*
Expand Down

0 comments on commit d8aa905

Please sign in to comment.