diff options
Diffstat (limited to 'fs/smb/client/inode.c')
-rw-r--r-- | fs/smb/client/inode.c | 54 |
1 files changed, 20 insertions, 34 deletions
diff --git a/fs/smb/client/inode.c b/fs/smb/client/inode.c index 6477dde13555..8ce5adbb1588 100644 --- a/fs/smb/client/inode.c +++ b/fs/smb/client/inode.c @@ -455,7 +455,7 @@ cifs_sfu_type(struct cifs_fattr *fattr, const char *path, oplock = REQ_OPLOCK; else oplock = 0; - rc = tcon->ses->server->ops->open(xid, &oparms, &oplock, NULL); + rc = smb2_open_file(xid, &oparms, &oplock, NULL); if (rc) { cifs_dbg(FYI, "check sfu type of %s, open rc = %d\n", path, rc); cifs_put_tlink(tlink); @@ -469,7 +469,7 @@ cifs_sfu_type(struct cifs_fattr *fattr, const char *path, io_parms.offset = 0; io_parms.length = 24; - rc = tcon->ses->server->ops->sync_read(xid, &fid, &io_parms, + rc = smb2_sync_read(xid, &fid, &io_parms, &bytes_read, &pbuf, &buf_type); if ((rc == 0) && (bytes_read >= 8)) { if (memcmp("IntxBLK", pbuf, 8) == 0) { @@ -519,7 +519,7 @@ cifs_sfu_type(struct cifs_fattr *fattr, const char *path, rc = -EOPNOTSUPP; /* or some unknown SFU type */ } - tcon->ses->server->ops->close(xid, tcon, &fid); + smb2_close_file(xid, tcon, &fid); cifs_put_tlink(tlink); return rc; } @@ -551,7 +551,7 @@ static int cifs_sfu_mode(struct cifs_fattr *fattr, const unsigned char *path, return -EOPNOTSUPP; } - rc = tcon->ses->server->ops->query_all_EAs(xid, tcon, path, + rc = smb2_query_eas(xid, tcon, path, "SETFILEBITS", ea_value, 4 /* size of buf */, cifs_sb); cifs_put_tlink(tlink); @@ -734,7 +734,7 @@ cifs_get_file_info(struct file *filp) } xid = get_xid(); - rc = server->ops->query_file_info(xid, tcon, cfile, &data); + rc = smb2_query_file_info(xid, tcon, cfile, &data); switch (rc) { case 0: /* TODO: add support to query reparse tag */ @@ -817,7 +817,7 @@ static void cifs_set_fattr_ino(int xid, struct cifs_tcon *tcon, struct super_blo * If we have an inode pass a NULL tcon to ensure we don't * make a round trip to the server. This only works for SMB2+. */ - rc = server->ops->get_srv_inum(xid, *inode ? NULL : tcon, cifs_sb, full_path, + rc = smb2_get_srv_inum(xid, *inode ? NULL : tcon, cifs_sb, full_path, &fattr->cf_uniqueid, data); if (rc) { /* @@ -867,7 +867,7 @@ static int reparse_info_to_fattr(struct cifs_open_info_data *data, int rc = 0; if (!tag && server->ops->query_reparse_point) { - rc = server->ops->query_reparse_point(xid, tcon, cifs_sb, + rc = smb2_query_reparse_point(xid, tcon, cifs_sb, full_path, &tag, &rsp_iov, &rsp_buftype); if (!rc) @@ -880,11 +880,6 @@ static int reparse_info_to_fattr(struct cifs_open_info_data *data, rc = -EOPNOTSUPP; data->reparse.tag = tag; if (!data->reparse.tag) { - if (server->ops->query_symlink) { - rc = server->ops->query_symlink(xid, tcon, - cifs_sb, full_path, - &data->symlink_target); - } if (rc == -EOPNOTSUPP) data->reparse.tag = IO_REPARSE_TAG_INTERNAL; } @@ -910,7 +905,7 @@ static int reparse_info_to_fattr(struct cifs_open_info_data *data, if (data->symlink_target || data->reparse.buf) { rc = 0; } else if (iov && server->ops->parse_reparse_point) { - rc = server->ops->parse_reparse_point(cifs_sb, + rc = smb2_parse_reparse_point(cifs_sb, iov, data); } break; @@ -953,7 +948,7 @@ static int cifs_get_fattr(struct cifs_open_info_data *data, */ if (!data) { - rc = server->ops->query_path_info(xid, tcon, cifs_sb, + rc = smb2_query_path_info(xid, tcon, cifs_sb, full_path, &tmp_data); data = &tmp_data; } @@ -1100,7 +1095,7 @@ static int smb311_posix_get_fattr(struct cifs_open_info_data *data, * 1. Fetch file metadata if not provided (data) */ if (!data) { - rc = server->ops->query_path_info(xid, tcon, cifs_sb, + rc = smb2_query_path_info(xid, tcon, cifs_sb, full_path, &tmp_data); data = &tmp_data; } @@ -1408,7 +1403,7 @@ cifs_set_file_info(struct inode *inode, struct iattr *attrs, unsigned int xid, info_buf.CreationTime = 0; /* don't change */ info_buf.Attributes = cpu_to_le32(dosattr); - return server->ops->set_file_info(inode, full_path, &info_buf, xid); + return smb2_set_file_info(inode, full_path, &info_buf, xid); } @@ -1480,7 +1475,7 @@ retry_std_delete: goto psx_del_no_retry; } - rc = server->ops->unlink(xid, tcon, full_path, cifs_sb, dentry); + rc = smb2_unlink(xid, tcon, full_path, cifs_sb, dentry); psx_del_no_retry: if (!rc) { @@ -1490,15 +1485,6 @@ psx_del_no_retry: } } else if (rc == -ENOENT) { d_drop(dentry); - } else if (rc == -EBUSY) { - if (server->ops->rename_pending_delete) { - rc = server->ops->rename_pending_delete(full_path, - dentry, xid); - if (rc == 0) { - cifs_mark_open_handles_for_deleted_file(inode, full_path); - cifs_drop_nlink(inode); - } - } } else if ((rc == -EACCES) && (dosattr == 0) && inode) { attrs = kzalloc(sizeof(*attrs), GFP_KERNEL); if (attrs == NULL) { @@ -1590,7 +1576,7 @@ cifs_mkdir_qinfo(struct inode *parent, struct dentry *dentry, umode_t mode, struct TCP_Server_Info *server = tcon->ses->server; if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) && (mode & S_IWUGO) == 0 && server->ops->mkdir_setinfo) - server->ops->mkdir_setinfo(inode, full_path, cifs_sb, + smb2_mkdir_setinfo(inode, full_path, cifs_sb, tcon, xid); if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DYNPERM) inode->i_mode = (mode | S_IFDIR); @@ -1656,7 +1642,7 @@ int cifs_mkdir(struct mnt_idmap *idmap, struct inode *inode, } /* BB add setting the equivalent of mode via CreateX w/ACLs */ - rc = server->ops->mkdir(xid, inode, mode, tcon, full_path, cifs_sb); + rc = smb2_mkdir(xid, inode, mode, tcon, full_path, cifs_sb); if (rc) { cifs_dbg(FYI, "cifs_mkdir returned 0x%x\n", rc); d_drop(direntry); @@ -1726,7 +1712,7 @@ int cifs_rmdir(struct inode *inode, struct dentry *direntry) goto rmdir_exit; } - rc = server->ops->rmdir(xid, tcon, full_path, cifs_sb); + rc = smb2_rmdir(xid, tcon, full_path, cifs_sb); cifs_put_tlink(tlink); if (!rc) { @@ -1777,7 +1763,7 @@ cifs_do_rename(const unsigned int xid, struct dentry *from_dentry, return -ENOSYS; /* try path-based rename first */ - rc = server->ops->rename(xid, tcon, from_dentry, + rc = smb2_rename_path(xid, tcon, from_dentry, from_path, to_path, cifs_sb); /* @@ -2195,7 +2181,7 @@ int cifs_fiemap(struct inode *inode, struct fiemap_extent_info *fei, u64 start, return -EINVAL; if (server->ops->fiemap) { - rc = server->ops->fiemap(tcon, cfile, fei, start, len); + rc = smb3_fiemap(tcon, cfile, fei, start, len); cifsFileInfo_put(cfile); return rc; } @@ -2260,7 +2246,7 @@ cifs_set_file_size(struct inode *inode, struct iattr *attrs, tcon = tlink_tcon(open_file->tlink); server = tcon->ses->server; if (server->ops->set_file_size) - rc = server->ops->set_file_size(xid, tcon, open_file, + rc = smb2_set_file_size(xid, tcon, open_file, attrs->ia_size, false); else rc = -ENOSYS; @@ -2286,7 +2272,7 @@ cifs_set_file_size(struct inode *inode, struct iattr *attrs, * an error setting it by handle. */ if (server->ops->set_path_size) - rc = server->ops->set_path_size(xid, tcon, full_path, + rc = smb2_set_path_size(xid, tcon, full_path, attrs->ia_size, cifs_sb, false, dentry); else rc = -ENOSYS; @@ -2383,7 +2369,7 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs) rc = cifs_get_writable_file(cifsInode, FIND_WR_ANY, &wfile); if (!rc) { tcon = tlink_tcon(wfile->tlink); - rc = tcon->ses->server->ops->flush(xid, tcon, &wfile->fid); + rc = smb2_flush_file(xid, tcon, &wfile->fid); cifsFileInfo_put(wfile); if (rc) goto cifs_setattr_exit; |