diff options
author | Jeff Layton <jlayton@redhat.com> | 2011-07-26 12:20:17 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2011-07-31 17:21:20 -0400 |
commit | ad635942c869ad8fc9af270d4998c42b4e978b32 (patch) | |
tree | b199a039df4aacd26224302b7c29193171e4d444 /fs/cifs/cifsfs.c | |
parent | 5980fc966bb347801f3fcc39a2ef2a1e14fbf8cb (diff) |
cifs: simplify refcounting for oplock breaks
Currently, we take a sb->s_active reference and a cifsFileInfo reference
when an oplock break workqueue job is queued. This is unnecessary and
more complicated than it needs to be. Also as Al points out,
deactivate_super has non-trivial locking implications so it's best to
avoid that if we can.
Instead, just cancel any pending oplock breaks for this filehandle
synchronously in cifsFileInfo_put after taking it off the lists.
That should ensure that this job doesn't outlive the structures it
depends on.
Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/cifsfs.c')
-rw-r--r-- | fs/cifs/cifsfs.c | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index 865517470967..212e5629cc1d 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c | |||
@@ -86,24 +86,6 @@ extern mempool_t *cifs_sm_req_poolp; | |||
86 | extern mempool_t *cifs_req_poolp; | 86 | extern mempool_t *cifs_req_poolp; |
87 | extern mempool_t *cifs_mid_poolp; | 87 | extern mempool_t *cifs_mid_poolp; |
88 | 88 | ||
89 | void | ||
90 | cifs_sb_active(struct super_block *sb) | ||
91 | { | ||
92 | struct cifs_sb_info *server = CIFS_SB(sb); | ||
93 | |||
94 | if (atomic_inc_return(&server->active) == 1) | ||
95 | atomic_inc(&sb->s_active); | ||
96 | } | ||
97 | |||
98 | void | ||
99 | cifs_sb_deactive(struct super_block *sb) | ||
100 | { | ||
101 | struct cifs_sb_info *server = CIFS_SB(sb); | ||
102 | |||
103 | if (atomic_dec_and_test(&server->active)) | ||
104 | deactivate_super(sb); | ||
105 | } | ||
106 | |||
107 | static int | 89 | static int |
108 | cifs_read_super(struct super_block *sb) | 90 | cifs_read_super(struct super_block *sb) |
109 | { | 91 | { |