提交 2dd2dfa0 编写于 作者: J Jeff Layton 提交者: Steve French

Rename CIFSSMBSetFileTimes to CIFSSMBSetFileInfo and add PID arg

The new name is more clear since this is also used to set file
attributes. We'll need the pid_of_opener arg so that we can
pass in filehandles of other pids and spare ourselves an open
call.
Signed-off-by: NJeff Layton <jlayton@redhat.com>
Signed-off-by: NSteve French <sfrench@us.ibm.com>
上级 6fc000e5
...@@ -176,8 +176,9 @@ extern int CIFSSMBSetPathInfo(const int xid, struct cifsTconInfo *tcon, ...@@ -176,8 +176,9 @@ extern int CIFSSMBSetPathInfo(const int xid, struct cifsTconInfo *tcon,
const char *fileName, const FILE_BASIC_INFO *data, const char *fileName, const FILE_BASIC_INFO *data,
const struct nls_table *nls_codepage, const struct nls_table *nls_codepage,
int remap_special_chars); int remap_special_chars);
extern int CIFSSMBSetFileTimes(const int xid, struct cifsTconInfo *tcon, extern int CIFSSMBSetFileInfo(const int xid, struct cifsTconInfo *tcon,
const FILE_BASIC_INFO *data, __u16 fid); const FILE_BASIC_INFO *data, __u16 fid,
__u32 pid_of_opener);
#if 0 #if 0
extern int CIFSSMBSetAttrLegacy(int xid, struct cifsTconInfo *tcon, extern int CIFSSMBSetAttrLegacy(int xid, struct cifsTconInfo *tcon,
char *fileName, __u16 dos_attributes, char *fileName, __u16 dos_attributes,
......
...@@ -4816,8 +4816,8 @@ CIFSSMBSetFileSize(const int xid, struct cifsTconInfo *tcon, __u64 size, ...@@ -4816,8 +4816,8 @@ CIFSSMBSetFileSize(const int xid, struct cifsTconInfo *tcon, __u64 size,
time and resort to the original setpathinfo level which takes the ancient time and resort to the original setpathinfo level which takes the ancient
DOS time format with 2 second granularity */ DOS time format with 2 second granularity */
int int
CIFSSMBSetFileTimes(const int xid, struct cifsTconInfo *tcon, CIFSSMBSetFileInfo(const int xid, struct cifsTconInfo *tcon,
const FILE_BASIC_INFO *data, __u16 fid) const FILE_BASIC_INFO *data, __u16 fid, __u32 pid_of_opener)
{ {
struct smb_com_transaction2_sfi_req *pSMB = NULL; struct smb_com_transaction2_sfi_req *pSMB = NULL;
char *data_offset; char *data_offset;
...@@ -4830,11 +4830,8 @@ CIFSSMBSetFileTimes(const int xid, struct cifsTconInfo *tcon, ...@@ -4830,11 +4830,8 @@ CIFSSMBSetFileTimes(const int xid, struct cifsTconInfo *tcon,
if (rc) if (rc)
return rc; return rc;
/* At this point there is no need to override the current pid pSMB->hdr.Pid = cpu_to_le16((__u16)pid_of_opener);
with the pid of the opener, but that could change if we someday pSMB->hdr.PidHigh = cpu_to_le16((__u16)(pid_of_opener >> 16));
use an existing handle (rather than opening one on the fly) */
/* pSMB->hdr.Pid = cpu_to_le16((__u16)pid_of_opener);
pSMB->hdr.PidHigh = cpu_to_le16((__u16)(pid_of_opener >> 16));*/
params = 6; params = 6;
pSMB->MaxSetupCount = 0; pSMB->MaxSetupCount = 0;
......
...@@ -767,9 +767,10 @@ int cifs_unlink(struct inode *inode, struct dentry *direntry) ...@@ -767,9 +767,10 @@ int cifs_unlink(struct inode *inode, struct dentry *direntry)
cifs_sb->mnt_cifs_flags & cifs_sb->mnt_cifs_flags &
CIFS_MOUNT_MAP_SPECIAL_CHR); CIFS_MOUNT_MAP_SPECIAL_CHR);
if (rc == 0) { if (rc == 0) {
rc = CIFSSMBSetFileTimes(xid, pTcon, rc = CIFSSMBSetFileInfo(xid, pTcon,
pinfo_buf, pinfo_buf,
netfid); netfid,
current->tgid);
CIFSSMBClose(xid, pTcon, netfid); CIFSSMBClose(xid, pTcon, netfid);
} }
} }
...@@ -1702,8 +1703,8 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs) ...@@ -1702,8 +1703,8 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs)
cifs_sb->mnt_cifs_flags & cifs_sb->mnt_cifs_flags &
CIFS_MOUNT_MAP_SPECIAL_CHR); CIFS_MOUNT_MAP_SPECIAL_CHR);
if (rc == 0) { if (rc == 0) {
rc = CIFSSMBSetFileTimes(xid, pTcon, &time_buf, rc = CIFSSMBSetFileInfo(xid, pTcon, &time_buf,
netfid); netfid, current->tgid);
CIFSSMBClose(xid, pTcon, netfid); CIFSSMBClose(xid, pTcon, netfid);
} else { } else {
/* BB For even older servers we could convert time_buf /* BB For even older servers we could convert time_buf
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册