提交 896440d5 编写于 作者: J Josh Triplett 提交者: Linus Torvalds

[PATCH] nfsd: add lock annotations to e_start and e_stop

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: NJosh Triplett <josh@freedesktop.org>
Cc: Neil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 bc6f02e5
...@@ -1078,6 +1078,7 @@ exp_pseudoroot(struct auth_domain *clp, struct svc_fh *fhp, ...@@ -1078,6 +1078,7 @@ exp_pseudoroot(struct auth_domain *clp, struct svc_fh *fhp,
/* Iterator */ /* Iterator */
static void *e_start(struct seq_file *m, loff_t *pos) static void *e_start(struct seq_file *m, loff_t *pos)
__acquires(svc_export_cache.hash_lock)
{ {
loff_t n = *pos; loff_t n = *pos;
unsigned hash, export; unsigned hash, export;
...@@ -1131,6 +1132,7 @@ static void *e_next(struct seq_file *m, void *p, loff_t *pos) ...@@ -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) static void e_stop(struct seq_file *m, void *p)
__releases(svc_export_cache.hash_lock)
{ {
read_unlock(&svc_export_cache.hash_lock); read_unlock(&svc_export_cache.hash_lock);
exp_readunlock(); exp_readunlock();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册