Loading fs/cifs/cifsglob.h +2 −0 Original line number Original line Diff line number Diff line Loading @@ -269,6 +269,8 @@ struct smb_version_operations { struct cifs_sb_info *); struct cifs_sb_info *); /* set fid protocol-specific info */ /* set fid protocol-specific info */ void (*set_fid)(struct cifsFileInfo *, struct cifs_fid *, __u32); void (*set_fid)(struct cifsFileInfo *, struct cifs_fid *, __u32); /* close a file */ int (*close)(const unsigned int, struct cifs_tcon *, struct cifs_fid *); }; }; struct smb_version_values { struct smb_version_values { Loading fs/cifs/file.c +7 −3 Original line number Original line Diff line number Diff line Loading @@ -326,10 +326,13 @@ void cifsFileInfo_put(struct cifsFileInfo *cifs_file) cancel_work_sync(&cifs_file->oplock_break); cancel_work_sync(&cifs_file->oplock_break); if (!tcon->need_reconnect && !cifs_file->invalidHandle) { if (!tcon->need_reconnect && !cifs_file->invalidHandle) { struct TCP_Server_Info *server = tcon->ses->server; unsigned int xid; unsigned int xid; int rc; int rc = -ENOSYS; xid = get_xid(); xid = get_xid(); rc = CIFSSMBClose(xid, tcon, cifs_file->fid.netfid); if (server->ops->close) rc = server->ops->close(xid, tcon, &cifs_file->fid); free_xid(xid); free_xid(xid); } } Loading Loading @@ -423,7 +426,8 @@ int cifs_open(struct inode *inode, struct file *file) cfile = cifs_new_fileinfo(&fid, file, tlink, oplock); cfile = cifs_new_fileinfo(&fid, file, tlink, oplock); if (cfile == NULL) { if (cfile == NULL) { CIFSSMBClose(xid, tcon, fid.netfid); if (tcon->ses->server->ops->close) tcon->ses->server->ops->close(xid, tcon, &fid); rc = -ENOMEM; rc = -ENOMEM; goto out; goto out; } } Loading fs/cifs/smb1ops.c +8 −0 Original line number Original line Diff line number Diff line Loading @@ -634,6 +634,13 @@ cifs_set_fid(struct cifsFileInfo *cfile, struct cifs_fid *fid, __u32 oplock) cinode->can_cache_brlcks = cinode->clientCanCacheAll; cinode->can_cache_brlcks = cinode->clientCanCacheAll; } } static int cifs_close_file(const unsigned int xid, struct cifs_tcon *tcon, struct cifs_fid *fid) { return CIFSSMBClose(xid, tcon, fid->netfid); } struct smb_version_operations smb1_operations = { struct smb_version_operations smb1_operations = { .send_cancel = send_nt_cancel, .send_cancel = send_nt_cancel, .compare_fids = cifs_compare_fids, .compare_fids = cifs_compare_fids, Loading Loading @@ -675,6 +682,7 @@ struct smb_version_operations smb1_operations = { .rename_pending_delete = cifs_rename_pending_delete, .rename_pending_delete = cifs_rename_pending_delete, .open = cifs_open_file, .open = cifs_open_file, .set_fid = cifs_set_fid, .set_fid = cifs_set_fid, .close = cifs_close_file, }; }; struct smb_version_values smb1_values = { struct smb_version_values smb1_values = { Loading Loading
fs/cifs/cifsglob.h +2 −0 Original line number Original line Diff line number Diff line Loading @@ -269,6 +269,8 @@ struct smb_version_operations { struct cifs_sb_info *); struct cifs_sb_info *); /* set fid protocol-specific info */ /* set fid protocol-specific info */ void (*set_fid)(struct cifsFileInfo *, struct cifs_fid *, __u32); void (*set_fid)(struct cifsFileInfo *, struct cifs_fid *, __u32); /* close a file */ int (*close)(const unsigned int, struct cifs_tcon *, struct cifs_fid *); }; }; struct smb_version_values { struct smb_version_values { Loading
fs/cifs/file.c +7 −3 Original line number Original line Diff line number Diff line Loading @@ -326,10 +326,13 @@ void cifsFileInfo_put(struct cifsFileInfo *cifs_file) cancel_work_sync(&cifs_file->oplock_break); cancel_work_sync(&cifs_file->oplock_break); if (!tcon->need_reconnect && !cifs_file->invalidHandle) { if (!tcon->need_reconnect && !cifs_file->invalidHandle) { struct TCP_Server_Info *server = tcon->ses->server; unsigned int xid; unsigned int xid; int rc; int rc = -ENOSYS; xid = get_xid(); xid = get_xid(); rc = CIFSSMBClose(xid, tcon, cifs_file->fid.netfid); if (server->ops->close) rc = server->ops->close(xid, tcon, &cifs_file->fid); free_xid(xid); free_xid(xid); } } Loading Loading @@ -423,7 +426,8 @@ int cifs_open(struct inode *inode, struct file *file) cfile = cifs_new_fileinfo(&fid, file, tlink, oplock); cfile = cifs_new_fileinfo(&fid, file, tlink, oplock); if (cfile == NULL) { if (cfile == NULL) { CIFSSMBClose(xid, tcon, fid.netfid); if (tcon->ses->server->ops->close) tcon->ses->server->ops->close(xid, tcon, &fid); rc = -ENOMEM; rc = -ENOMEM; goto out; goto out; } } Loading
fs/cifs/smb1ops.c +8 −0 Original line number Original line Diff line number Diff line Loading @@ -634,6 +634,13 @@ cifs_set_fid(struct cifsFileInfo *cfile, struct cifs_fid *fid, __u32 oplock) cinode->can_cache_brlcks = cinode->clientCanCacheAll; cinode->can_cache_brlcks = cinode->clientCanCacheAll; } } static int cifs_close_file(const unsigned int xid, struct cifs_tcon *tcon, struct cifs_fid *fid) { return CIFSSMBClose(xid, tcon, fid->netfid); } struct smb_version_operations smb1_operations = { struct smb_version_operations smb1_operations = { .send_cancel = send_nt_cancel, .send_cancel = send_nt_cancel, .compare_fids = cifs_compare_fids, .compare_fids = cifs_compare_fids, Loading Loading @@ -675,6 +682,7 @@ struct smb_version_operations smb1_operations = { .rename_pending_delete = cifs_rename_pending_delete, .rename_pending_delete = cifs_rename_pending_delete, .open = cifs_open_file, .open = cifs_open_file, .set_fid = cifs_set_fid, .set_fid = cifs_set_fid, .close = cifs_close_file, }; }; struct smb_version_values smb1_values = { struct smb_version_values smb1_values = { Loading