diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/cifs/cifsglob.h | 2 | ||||
-rw-r--r-- | fs/cifs/file.c | 10 | ||||
-rw-r--r-- | fs/cifs/smb1ops.c | 8 |
3 files changed, 17 insertions, 3 deletions
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index e649fac7d6fe..39bf2f3e866a 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h | |||
@@ -269,6 +269,8 @@ struct smb_version_operations { | |||
269 | struct cifs_sb_info *); | 269 | struct cifs_sb_info *); |
270 | /* set fid protocol-specific info */ | 270 | /* set fid protocol-specific info */ |
271 | void (*set_fid)(struct cifsFileInfo *, struct cifs_fid *, __u32); | 271 | void (*set_fid)(struct cifsFileInfo *, struct cifs_fid *, __u32); |
272 | /* close a file */ | ||
273 | int (*close)(const unsigned int, struct cifs_tcon *, struct cifs_fid *); | ||
272 | }; | 274 | }; |
273 | 275 | ||
274 | struct smb_version_values { | 276 | struct smb_version_values { |
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 1246cf74e1fb..14938ee4f6e4 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
@@ -326,10 +326,13 @@ void cifsFileInfo_put(struct cifsFileInfo *cifs_file) | |||
326 | cancel_work_sync(&cifs_file->oplock_break); | 326 | cancel_work_sync(&cifs_file->oplock_break); |
327 | 327 | ||
328 | if (!tcon->need_reconnect && !cifs_file->invalidHandle) { | 328 | if (!tcon->need_reconnect && !cifs_file->invalidHandle) { |
329 | struct TCP_Server_Info *server = tcon->ses->server; | ||
329 | unsigned int xid; | 330 | unsigned int xid; |
330 | int rc; | 331 | int rc = -ENOSYS; |
332 | |||
331 | xid = get_xid(); | 333 | xid = get_xid(); |
332 | rc = CIFSSMBClose(xid, tcon, cifs_file->fid.netfid); | 334 | if (server->ops->close) |
335 | rc = server->ops->close(xid, tcon, &cifs_file->fid); | ||
333 | free_xid(xid); | 336 | free_xid(xid); |
334 | } | 337 | } |
335 | 338 | ||
@@ -423,7 +426,8 @@ int cifs_open(struct inode *inode, struct file *file) | |||
423 | 426 | ||
424 | cfile = cifs_new_fileinfo(&fid, file, tlink, oplock); | 427 | cfile = cifs_new_fileinfo(&fid, file, tlink, oplock); |
425 | if (cfile == NULL) { | 428 | if (cfile == NULL) { |
426 | CIFSSMBClose(xid, tcon, fid.netfid); | 429 | if (tcon->ses->server->ops->close) |
430 | tcon->ses->server->ops->close(xid, tcon, &fid); | ||
427 | rc = -ENOMEM; | 431 | rc = -ENOMEM; |
428 | goto out; | 432 | goto out; |
429 | } | 433 | } |
diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c index 907b30865000..bb758476e139 100644 --- a/fs/cifs/smb1ops.c +++ b/fs/cifs/smb1ops.c | |||
@@ -634,6 +634,13 @@ cifs_set_fid(struct cifsFileInfo *cfile, struct cifs_fid *fid, __u32 oplock) | |||
634 | cinode->can_cache_brlcks = cinode->clientCanCacheAll; | 634 | cinode->can_cache_brlcks = cinode->clientCanCacheAll; |
635 | } | 635 | } |
636 | 636 | ||
637 | static int | ||
638 | cifs_close_file(const unsigned int xid, struct cifs_tcon *tcon, | ||
639 | struct cifs_fid *fid) | ||
640 | { | ||
641 | return CIFSSMBClose(xid, tcon, fid->netfid); | ||
642 | } | ||
643 | |||
637 | struct smb_version_operations smb1_operations = { | 644 | struct smb_version_operations smb1_operations = { |
638 | .send_cancel = send_nt_cancel, | 645 | .send_cancel = send_nt_cancel, |
639 | .compare_fids = cifs_compare_fids, | 646 | .compare_fids = cifs_compare_fids, |
@@ -675,6 +682,7 @@ struct smb_version_operations smb1_operations = { | |||
675 | .rename_pending_delete = cifs_rename_pending_delete, | 682 | .rename_pending_delete = cifs_rename_pending_delete, |
676 | .open = cifs_open_file, | 683 | .open = cifs_open_file, |
677 | .set_fid = cifs_set_fid, | 684 | .set_fid = cifs_set_fid, |
685 | .close = cifs_close_file, | ||
678 | }; | 686 | }; |
679 | 687 | ||
680 | struct smb_version_values smb1_values = { | 688 | struct smb_version_values smb1_values = { |