linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [afs] Add lock annotations to afs_proc_cell_servers_{start,stop}
@ 2006-07-25  0:30 Josh Triplett
  2006-07-26 14:22 ` David Howells
  0 siblings, 1 reply; 2+ messages in thread
From: Josh Triplett @ 2006-07-25  0:30 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andrew Morton, David Howells

afs_proc_cell_servers_start acquires a lock, and afs_proc_cell_servers_stop
releases that lock.  Add lock annotations to these two functions so that
sparse can check callers for lock pairing, and so that sparse will not
complain about these functions since they intentionally use locks in this
manner.

Signed-off-by: Josh Triplett <josh@freedesktop.org>
---
 fs/afs/proc.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/fs/afs/proc.c b/fs/afs/proc.c
index 101d21b..86463ec 100644
--- a/fs/afs/proc.c
+++ b/fs/afs/proc.c
@@ -775,6 +775,7 @@ static int afs_proc_cell_servers_release
  * first item
  */
 static void *afs_proc_cell_servers_start(struct seq_file *m, loff_t *_pos)
+	__acquires(m->private->sv_lock)
 {
 	struct list_head *_p;
 	struct afs_cell *cell = m->private;
@@ -823,6 +824,7 @@ static void *afs_proc_cell_servers_next(
  * clean up after reading from the cells list
  */
 static void afs_proc_cell_servers_stop(struct seq_file *p, void *v)
+	__releases(p->private->sv_lock)
 {
 	struct afs_cell *cell = p->private;
 



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] [afs] Add lock annotations to afs_proc_cell_servers_{start,stop}
  2006-07-25  0:30 [PATCH] [afs] Add lock annotations to afs_proc_cell_servers_{start,stop} Josh Triplett
@ 2006-07-26 14:22 ` David Howells
  0 siblings, 0 replies; 2+ messages in thread
From: David Howells @ 2006-07-26 14:22 UTC (permalink / raw)
  To: Josh Triplett; +Cc: linux-kernel, Andrew Morton, David Howells

Josh Triplett <josht@us.ibm.com> wrote:

> afs_proc_cell_servers_start acquires a lock, and afs_proc_cell_servers_stop
> releases that lock.  Add lock annotations to these two functions so that
> sparse can check callers for lock pairing, and so that sparse will not
> complain about these functions since they intentionally use locks in this
> manner.

Looks reasonable, though I'm surprised you can get this sort of checking to
work in sparse.

Acked-By: David Howells <dhowells@redhat.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-07-26 14:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-25  0:30 [PATCH] [afs] Add lock annotations to afs_proc_cell_servers_{start,stop} Josh Triplett
2006-07-26 14:22 ` David Howells

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).