summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenrique Carvalho <henrique.carvalho@suse.com>2024-11-14 16:11:49 -0300
committerHenrique Carvalho <henrique.carvalho@suse.com>2024-11-14 16:31:41 -0300
commit00498482e0a152d56c768d6e0fdc216c68900e15 (patch)
tree2bd8706d23da79a74066feaa3392b8dfbd9bbb0e
parent38550a31a1e5d392efc466234a9f814f6fa3c709 (diff)
downloadlinux-00498482e0a152d56c768d6e0fdc216c68900e15.tar.gz
linux-00498482e0a152d56c768d6e0fdc216c68900e15.tar.bz2
linux-00498482e0a152d56c768d6e0fdc216c68900e15.zip
smb: client: remove ->close_getattr
Call smb2_close_getattr directly instead. Signed-off-by: Henrique Carvalho <henrique.carvalho@suse.com>
-rw-r--r--fs/smb/client/cifsglob.h3
-rw-r--r--fs/smb/client/file.c12
-rw-r--r--fs/smb/client/smb2ops.c4
-rw-r--r--fs/smb/client/smb2proto.h1
4 files changed, 4 insertions, 16 deletions
diff --git a/fs/smb/client/cifsglob.h b/fs/smb/client/cifsglob.h
index 7f8ac17f4f09..cdda8e61ba98 100644
--- a/fs/smb/client/cifsglob.h
+++ b/fs/smb/client/cifsglob.h
@@ -279,9 +279,6 @@ struct smb_version_operations {
umode_t mode, struct cifs_tcon *tcon,
const char *full_path,
struct cifs_sb_info *cifs_sb); /* send create hardlink request */
- /* close a file, returning file attributes and timestamps */
- int (*close_getattr)(const unsigned int xid, struct cifs_tcon *tcon,
- struct cifsFileInfo *pfile_info);
/* query remote filesystem */
int (*generate_signingkey)(struct cifs_ses *ses,
struct TCP_Server_Info *server);
diff --git a/fs/smb/client/file.c b/fs/smb/client/file.c
index 3b401c4e1af5..c7a615d78a62 100644
--- a/fs/smb/client/file.c
+++ b/fs/smb/client/file.c
@@ -716,16 +716,12 @@ void serverclose_work(struct work_struct *work)
struct cifs_tcon *tcon = tlink_tcon(cifs_file->tlink);
- struct TCP_Server_Info *server = tcon->ses->server;
int rc = 0;
int retries = 0;
int MAX_RETRIES = 4;
do {
- if (server->ops->close_getattr)
- rc = server->ops->close_getattr(0, tcon, cifs_file);
- else
- rc = smb2_close_file(0, tcon, &cifs_file->fid);
+ rc = smb2_close_getattr(0, tcon, cifs_file);
if (rc == -EBUSY || rc == -EAGAIN) {
retries++;
@@ -827,15 +823,11 @@ void _cifsFileInfo_put(struct cifsFileInfo *cifs_file,
cancel_work_sync(&cifs_file->oplock_break) : false;
if (!tcon->need_reconnect && !cifs_file->invalidHandle) {
- struct TCP_Server_Info *server = tcon->ses->server;
unsigned int xid;
int rc = 0;
xid = get_xid();
- if (server->ops->close_getattr)
- rc = server->ops->close_getattr(xid, tcon, cifs_file);
- else
- rc = smb2_close_file(xid, tcon, &cifs_file->fid);
+ rc = smb2_close_getattr(xid, tcon, cifs_file);
_free_xid(xid);
if (rc == -EBUSY || rc == -EAGAIN) {
diff --git a/fs/smb/client/smb2ops.c b/fs/smb/client/smb2ops.c
index b8e991b069d0..26836077b2e5 100644
--- a/fs/smb/client/smb2ops.c
+++ b/fs/smb/client/smb2ops.c
@@ -1450,7 +1450,7 @@ int smb2_close_file(const unsigned int xid, struct cifs_tcon *tcon, struct cifs_
return SMB2_close(xid, tcon, fid->persistent_fid, fid->volatile_fid);
}
-static int
+int
smb2_close_getattr(const unsigned int xid, struct cifs_tcon *tcon,
struct cifsFileInfo *cfile)
{
@@ -5088,7 +5088,6 @@ struct smb_version_operations smb21_operations = {
struct smb_version_operations smb30_operations = {
/* WSL tags introduced long after smb2.1, enable for SMB3, 3.11 only */
- .close_getattr = smb2_close_getattr,
.generate_signingkey = generate_smb30signingkey,
.calc_signature = smb3_calc_signature,
.parse_lease_buf = smb3_parse_lease_buf,
@@ -5101,7 +5100,6 @@ struct smb_version_operations smb30_operations = {
struct smb_version_operations smb311_operations = {
.posix_mkdir = smb311_posix_mkdir,
- .close_getattr = smb2_close_getattr,
.generate_signingkey = generate_smb311signingkey,
.calc_signature = smb3_calc_signature,
.parse_lease_buf = smb3_parse_lease_buf,
diff --git a/fs/smb/client/smb2proto.h b/fs/smb/client/smb2proto.h
index d9d0452bbb49..642971676a43 100644
--- a/fs/smb/client/smb2proto.h
+++ b/fs/smb/client/smb2proto.h
@@ -54,6 +54,7 @@ struct smb3_fs_context;
* All Prototypes
*****************************************************************
*/
+extern int smb2_close_getattr(const unsigned int xid, struct cifs_tcon *tcon, struct cifsFileInfo *cfile);
extern unsigned int smb_negotiate_rsize(struct cifs_tcon *tcon, struct smb3_fs_context *ctx);
extern unsigned int smb_negotiate_wsize(struct cifs_tcon *tcon, struct smb3_fs_context *ctx);
extern void smb_qfs_tcon(const unsigned int xid, struct cifs_tcon *tcon, struct cifs_sb_info *cifs_sb);