CIFS: Replace netfid with cifs_fid struct in cifsFileInfo
This is help us to extend the code for future protocols that can use another fid mechanism (as SMB2 that has it divided into two parts: persistent and violatile). Also rename variables and refactor the code around the changes. Reviewed-by: Jeff Layton <jlayton@samba.org> Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org> Signed-off-by: Steve French <smfrench@gmail.com>
This commit is contained in:

committed by
Steve French

parent
cbe6f439f5
commit
4b4de76e35
@@ -294,7 +294,7 @@ int cifs_get_file_info_unix(struct file *filp)
|
||||
struct cifs_tcon *tcon = tlink_tcon(cfile->tlink);
|
||||
|
||||
xid = get_xid();
|
||||
rc = CIFSSMBUnixQFileInfo(xid, tcon, cfile->netfid, &find_data);
|
||||
rc = CIFSSMBUnixQFileInfo(xid, tcon, cfile->fid.netfid, &find_data);
|
||||
if (!rc) {
|
||||
cifs_unix_basic_to_fattr(&fattr, &find_data, cifs_sb);
|
||||
} else if (rc == -EREMOTE) {
|
||||
@@ -562,7 +562,7 @@ int cifs_get_file_info(struct file *filp)
|
||||
struct cifs_tcon *tcon = tlink_tcon(cfile->tlink);
|
||||
|
||||
xid = get_xid();
|
||||
rc = CIFSSMBQFileInfo(xid, tcon, cfile->netfid, &find_data);
|
||||
rc = CIFSSMBQFileInfo(xid, tcon, cfile->fid.netfid, &find_data);
|
||||
switch (rc) {
|
||||
case 0:
|
||||
cifs_all_info_to_fattr(&fattr, &find_data, cifs_sb, false);
|
||||
@@ -930,7 +930,7 @@ cifs_set_file_info(struct inode *inode, struct iattr *attrs, unsigned int xid,
|
||||
*/
|
||||
open_file = find_writable_file(cifsInode, true);
|
||||
if (open_file) {
|
||||
netfid = open_file->netfid;
|
||||
netfid = open_file->fid.netfid;
|
||||
netpid = open_file->pid;
|
||||
pTcon = tlink_tcon(open_file->tlink);
|
||||
goto set_via_filehandle;
|
||||
@@ -1887,7 +1887,7 @@ cifs_set_file_size(struct inode *inode, struct iattr *attrs,
|
||||
*/
|
||||
open_file = find_writable_file(cifsInode, true);
|
||||
if (open_file) {
|
||||
__u16 nfid = open_file->netfid;
|
||||
__u16 nfid = open_file->fid.netfid;
|
||||
__u32 npid = open_file->pid;
|
||||
pTcon = tlink_tcon(open_file->tlink);
|
||||
rc = CIFSSMBSetFileSize(xid, pTcon, attrs->ia_size, nfid,
|
||||
@@ -2061,7 +2061,7 @@ cifs_setattr_unix(struct dentry *direntry, struct iattr *attrs)
|
||||
args->device = 0;
|
||||
open_file = find_writable_file(cifsInode, true);
|
||||
if (open_file) {
|
||||
u16 nfid = open_file->netfid;
|
||||
u16 nfid = open_file->fid.netfid;
|
||||
u32 npid = open_file->pid;
|
||||
pTcon = tlink_tcon(open_file->tlink);
|
||||
rc = CIFSSMBUnixSetFileInfo(xid, pTcon, args, nfid, npid);
|
||||
|
Reference in New Issue
Block a user