diff options
author | Pavel Shilovsky <pshilovsky@samba.org> | 2012-09-18 19:20:33 -0400 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2012-09-24 22:46:30 -0400 |
commit | 95a3f2f377735ed13e42d3b8039aa1d73af2c90e (patch) | |
tree | d3deb073515ef6396d0aef390ce558237580b1dc /fs | |
parent | 2e44b2887882134abf353b28867b82645e9f0856 (diff) |
CIFS: Move oplock break to ops struct
Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org>
Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/cifs/cifsglob.h | 4 | ||||
-rw-r--r-- | fs/cifs/file.c | 7 | ||||
-rw-r--r-- | fs/cifs/smb1ops.c | 10 |
3 files changed, 17 insertions, 4 deletions
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index 3eb59ed6904a..a95c56dc7058 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h | |||
@@ -178,6 +178,7 @@ struct cifs_readdata; | |||
178 | struct cifs_writedata; | 178 | struct cifs_writedata; |
179 | struct cifs_io_parms; | 179 | struct cifs_io_parms; |
180 | struct cifs_search_info; | 180 | struct cifs_search_info; |
181 | struct cifsInodeInfo; | ||
181 | 182 | ||
182 | struct smb_version_operations { | 183 | struct smb_version_operations { |
183 | int (*send_cancel)(struct TCP_Server_Info *, void *, | 184 | int (*send_cancel)(struct TCP_Server_Info *, void *, |
@@ -330,6 +331,9 @@ struct smb_version_operations { | |||
330 | unsigned int (*calc_smb_size)(void *); | 331 | unsigned int (*calc_smb_size)(void *); |
331 | /* check for STATUS_PENDING and process it in a positive case */ | 332 | /* check for STATUS_PENDING and process it in a positive case */ |
332 | bool (*is_status_pending)(char *, struct TCP_Server_Info *, int); | 333 | bool (*is_status_pending)(char *, struct TCP_Server_Info *, int); |
334 | /* send oplock break response */ | ||
335 | int (*oplock_response)(struct cifs_tcon *, struct cifs_fid *, | ||
336 | struct cifsInodeInfo *); | ||
333 | }; | 337 | }; |
334 | 338 | ||
335 | struct smb_version_values { | 339 | struct smb_version_values { |
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index fb6b4413255b..2418618118b6 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
@@ -3404,6 +3404,7 @@ void cifs_oplock_break(struct work_struct *work) | |||
3404 | oplock_break); | 3404 | oplock_break); |
3405 | struct inode *inode = cfile->dentry->d_inode; | 3405 | struct inode *inode = cfile->dentry->d_inode; |
3406 | struct cifsInodeInfo *cinode = CIFS_I(inode); | 3406 | struct cifsInodeInfo *cinode = CIFS_I(inode); |
3407 | struct cifs_tcon *tcon = tlink_tcon(cfile->tlink); | ||
3407 | int rc = 0; | 3408 | int rc = 0; |
3408 | 3409 | ||
3409 | if (inode && S_ISREG(inode->i_mode)) { | 3410 | if (inode && S_ISREG(inode->i_mode)) { |
@@ -3431,10 +3432,8 @@ void cifs_oplock_break(struct work_struct *work) | |||
3431 | * disconnected since oplock already released by the server | 3432 | * disconnected since oplock already released by the server |
3432 | */ | 3433 | */ |
3433 | if (!cfile->oplock_break_cancelled) { | 3434 | if (!cfile->oplock_break_cancelled) { |
3434 | rc = CIFSSMBLock(0, tlink_tcon(cfile->tlink), cfile->fid.netfid, | 3435 | rc = tcon->ses->server->ops->oplock_response(tcon, &cfile->fid, |
3435 | current->tgid, 0, 0, 0, 0, | 3436 | cinode); |
3436 | LOCKING_ANDX_OPLOCK_RELEASE, false, | ||
3437 | cinode->clientCanCacheRead ? 1 : 0); | ||
3438 | cFYI(1, "Oplock release rc = %d", rc); | 3437 | cFYI(1, "Oplock release rc = %d", rc); |
3439 | } | 3438 | } |
3440 | } | 3439 | } |
diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c index 068d609bd02a..f55b2e3476e8 100644 --- a/fs/cifs/smb1ops.c +++ b/fs/cifs/smb1ops.c | |||
@@ -863,6 +863,15 @@ cifs_close_dir(const unsigned int xid, struct cifs_tcon *tcon, | |||
863 | return CIFSFindClose(xid, tcon, fid->netfid); | 863 | return CIFSFindClose(xid, tcon, fid->netfid); |
864 | } | 864 | } |
865 | 865 | ||
866 | static int | ||
867 | cifs_oplock_response(struct cifs_tcon *tcon, struct cifs_fid *fid, | ||
868 | struct cifsInodeInfo *cinode) | ||
869 | { | ||
870 | return CIFSSMBLock(0, tcon, fid->netfid, current->tgid, 0, 0, 0, 0, | ||
871 | LOCKING_ANDX_OPLOCK_RELEASE, false, | ||
872 | cinode->clientCanCacheRead ? 1 : 0); | ||
873 | } | ||
874 | |||
866 | struct smb_version_operations smb1_operations = { | 875 | struct smb_version_operations smb1_operations = { |
867 | .send_cancel = send_nt_cancel, | 876 | .send_cancel = send_nt_cancel, |
868 | .compare_fids = cifs_compare_fids, | 877 | .compare_fids = cifs_compare_fids, |
@@ -922,6 +931,7 @@ struct smb_version_operations smb1_operations = { | |||
922 | .query_dir_next = cifs_query_dir_next, | 931 | .query_dir_next = cifs_query_dir_next, |
923 | .close_dir = cifs_close_dir, | 932 | .close_dir = cifs_close_dir, |
924 | .calc_smb_size = smbCalcSize, | 933 | .calc_smb_size = smbCalcSize, |
934 | .oplock_response = cifs_oplock_response, | ||
925 | }; | 935 | }; |
926 | 936 | ||
927 | struct smb_version_values smb1_values = { | 937 | struct smb_version_values smb1_values = { |