summaryrefslogtreecommitdiff
path: root/fs/smb/client/dir.c
diff options
context:
space:
mode:
authorHenrique Carvalho <henrique.carvalho@suse.com>2024-11-12 16:48:09 -0300
committerEnzo Matsumiya <ematsumiya@suse.de>2024-11-13 15:49:46 -0300
commit472697f67cf64a2461ad1842927f3c8cc539f37e (patch)
tree37bb1e46b0884721d35eb5d902aaf1bcf88374b0 /fs/smb/client/dir.c
parent8e5cdf186897806453d95697985d2eb21a4730a7 (diff)
downloadlinux-hw24-hc-wip.tar.gz
linux-hw24-hc-wip.tar.bz2
linux-hw24-hc-wip.zip
smb: client: replace function pointers of common operations for thehw24-hc-wip
common function Signed-off-by: Henrique Carvalho <henrique.carvalho@suse.com>
Diffstat (limited to 'fs/smb/client/dir.c')
-rw-r--r--fs/smb/client/dir.c32
1 files changed, 10 insertions, 22 deletions
diff --git a/fs/smb/client/dir.c b/fs/smb/client/dir.c
index 66248c1e78da..01bb87eaf1f2 100644
--- a/fs/smb/client/dir.c
+++ b/fs/smb/client/dir.c
@@ -228,11 +228,6 @@ static int cifs_do_create(struct inode *inode, struct dentry *direntry, unsigned
* ACLs
*/
- if (!server->ops->open) {
- rc = -ENOSYS;
- goto out;
- }
-
/*
* if we're not using unix extensions, see if we need to set
* ATTR_READONLY on the create call
@@ -251,7 +246,7 @@ retry_open:
.fid = fid,
.mode = mode,
};
- rc = server->ops->open(xid, &oparms, oplock, buf);
+ rc = smb2_open_file(xid, &oparms, oplock, buf);
if (rc) {
cifs_dbg(FYI, "cifs_create returned 0x%x\n", rc);
if (rc == -EACCES && rdwr_for_fscache == 1) {
@@ -268,8 +263,7 @@ retry_open:
/* TODO: Add support for calling POSIX query info here, but passing in fid */
rc = cifs_get_inode_info(&newinode, full_path, buf, inode->i_sb, xid, fid);
if (newinode) {
- if (server->ops->set_lease_key)
- server->ops->set_lease_key(newinode, fid);
+ smb2_set_lease_key(newinode, fid);
if ((*oplock & CIFS_CREATE_ACTION) && S_ISREG(newinode->i_mode)) {
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DYNPERM)
newinode->i_mode = mode;
@@ -304,8 +298,7 @@ out:
return rc;
out_err:
- if (server->ops->close)
- server->ops->close(xid, tcon, fid);
+ smb2_close_file(xid, tcon, fid);
if (newinode)
iput(newinode);
goto out;
@@ -376,9 +369,7 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
server = tcon->ses->server;
- if (server->ops->new_lease_key)
- server->ops->new_lease_key(&fid);
-
+ smb2_new_lease_key(&fid);
cifs_add_pending_open(&fid, tlink, &open);
rc = cifs_do_create(inode, direntry, xid, tlink, oflags, mode,
@@ -393,8 +384,7 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
rc = finish_open(file, direntry, generic_file_open);
if (rc) {
- if (server->ops->close)
- server->ops->close(xid, tcon, &fid);
+ smb2_close_file(xid, tcon, &fid);
cifs_del_pending_open(&open);
goto out;
}
@@ -409,8 +399,7 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
file_info = cifs_new_fileinfo(&fid, file, tlink, oplock, buf.symlink_target);
if (file_info == NULL) {
- if (server->ops->close)
- server->ops->close(xid, tcon, &fid);
+ smb2_close_file(xid, tcon, &fid);
cifs_del_pending_open(&open);
rc = -ENOMEM;
goto out;
@@ -463,12 +452,11 @@ int cifs_create(struct mnt_idmap *idmap, struct inode *inode,
tcon = tlink_tcon(tlink);
server = tcon->ses->server;
- if (server->ops->new_lease_key)
- server->ops->new_lease_key(&fid);
+ smb2_new_lease_key(&fid);
rc = cifs_do_create(inode, direntry, xid, tlink, oflags, mode, &oplock, &fid, &buf);
- if (!rc && server->ops->close)
- server->ops->close(xid, tcon, &fid);
+ if (!rc)
+ smb2_close_file(xid, tcon, &fid);
cifs_free_open_info(&buf);
cifs_put_tlink(tlink);
@@ -511,7 +499,7 @@ int cifs_mknod(struct mnt_idmap *idmap, struct inode *inode,
trace_smb3_mknod_enter(xid, tcon->ses->Suid, tcon->tid, full_path);
- rc = tcon->ses->server->ops->make_node(xid, inode, direntry, tcon,
+ rc = smb2_make_node(xid, inode, direntry, tcon,
full_path, mode,
device_number);