]> err.no Git - linux-2.6/commitdiff
[PATCH] nfsd: add lock annotations to e_start and e_stop
authorJosh Triplett <josht@us.ibm.com>
Mon, 2 Oct 2006 09:17:50 +0000 (02:17 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 2 Oct 2006 14:57:18 +0000 (07:57 -0700)
e_start acquires svc_export_cache.hash_lock, and e_stop releases it.  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>
Cc: Neil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/nfsd/export.c

index eccd2c2eb60de87d2c01c5ac6718360bfc626cdb..cfe141e5d7592630a58edd15447b1e023b99b04a 100644 (file)
@@ -1078,6 +1078,7 @@ exp_pseudoroot(struct auth_domain *clp, struct svc_fh *fhp,
 /* Iterator */
 
 static void *e_start(struct seq_file *m, loff_t *pos)
+       __acquires(svc_export_cache.hash_lock)
 {
        loff_t n = *pos;
        unsigned hash, export;
@@ -1131,6 +1132,7 @@ static void *e_next(struct seq_file *m, void *p, loff_t *pos)
 }
 
 static void e_stop(struct seq_file *m, void *p)
+       __releases(svc_export_cache.hash_lock)
 {
        read_unlock(&svc_export_cache.hash_lock);
        exp_readunlock();