aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/cifs/smb2inode.c22
-rw-r--r--fs/cifs/smb2ops.c1
-rw-r--r--fs/cifs/smb2pdu.c11
-rw-r--r--fs/cifs/smb2proto.h5
4 files changed, 39 insertions, 0 deletions
diff --git a/fs/cifs/smb2inode.c b/fs/cifs/smb2inode.c
index 29058309229..1bd6b0f0c10 100644
--- a/fs/cifs/smb2inode.c
+++ b/fs/cifs/smb2inode.c
@@ -86,6 +86,10 @@ smb2_open_op_close(const unsigned int xid, struct cifs_tcon *tcon,
86 tmprc = SMB2_set_eof(xid, tcon, persistent_fid, volatile_fid, 86 tmprc = SMB2_set_eof(xid, tcon, persistent_fid, volatile_fid,
87 current->tgid, (__le64 *)data); 87 current->tgid, (__le64 *)data);
88 break; 88 break;
89 case SMB2_OP_SET_INFO:
90 tmprc = SMB2_set_info(xid, tcon, persistent_fid, volatile_fid,
91 (FILE_BASIC_INFO *)data);
92 break;
89 default: 93 default:
90 cERROR(1, "Invalid command"); 94 cERROR(1, "Invalid command");
91 break; 95 break;
@@ -232,3 +236,21 @@ smb2_set_path_size(const unsigned int xid, struct cifs_tcon *tcon,
232 FILE_WRITE_DATA, FILE_OPEN, 0, 0, &eof, 236 FILE_WRITE_DATA, FILE_OPEN, 0, 0, &eof,
233 SMB2_OP_SET_EOF); 237 SMB2_OP_SET_EOF);
234} 238}
239
240int
241smb2_set_file_info(struct inode *inode, const char *full_path,
242 FILE_BASIC_INFO *buf, const unsigned int xid)
243{
244 struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
245 struct tcon_link *tlink;
246 int rc;
247
248 tlink = cifs_sb_tlink(cifs_sb);
249 if (IS_ERR(tlink))
250 return PTR_ERR(tlink);
251 rc = smb2_open_op_close(xid, tlink_tcon(tlink), cifs_sb, full_path,
252 FILE_WRITE_ATTRIBUTES, FILE_OPEN, 0, 0, buf,
253 SMB2_OP_SET_INFO);
254 cifs_put_tlink(tlink);
255 return rc;
256}
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
index e0daf3a4dcc..52bc9312572 100644
--- a/fs/cifs/smb2ops.c
+++ b/fs/cifs/smb2ops.c
@@ -457,6 +457,7 @@ struct smb_version_operations smb21_operations = {
457 .query_file_info = smb2_query_file_info, 457 .query_file_info = smb2_query_file_info,
458 .set_path_size = smb2_set_path_size, 458 .set_path_size = smb2_set_path_size,
459 .set_file_size = smb2_set_file_size, 459 .set_file_size = smb2_set_file_size,
460 .set_file_info = smb2_set_file_info,
460 .build_path_to_root = smb2_build_path_to_root, 461 .build_path_to_root = smb2_build_path_to_root,
461 .mkdir = smb2_mkdir, 462 .mkdir = smb2_mkdir,
462 .mkdir_setinfo = smb2_mkdir_setinfo, 463 .mkdir_setinfo = smb2_mkdir_setinfo,
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index 74a8381400b..a1314f99b4c 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -1760,3 +1760,14 @@ SMB2_set_eof(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid,
1760 return send_set_info(xid, tcon, persistent_fid, volatile_fid, pid, 1760 return send_set_info(xid, tcon, persistent_fid, volatile_fid, pid,
1761 FILE_END_OF_FILE_INFORMATION, 1, &data, &size); 1761 FILE_END_OF_FILE_INFORMATION, 1, &data, &size);
1762} 1762}
1763
1764int
1765SMB2_set_info(const unsigned int xid, struct cifs_tcon *tcon,
1766 u64 persistent_fid, u64 volatile_fid, FILE_BASIC_INFO *buf)
1767{
1768 unsigned int size;
1769 size = sizeof(FILE_BASIC_INFO);
1770 return send_set_info(xid, tcon, persistent_fid, volatile_fid,
1771 current->tgid, FILE_BASIC_INFORMATION, 1,
1772 (void **)&buf, &size);
1773}
diff --git a/fs/cifs/smb2proto.h b/fs/cifs/smb2proto.h
index 3d486627953..27747243315 100644
--- a/fs/cifs/smb2proto.h
+++ b/fs/cifs/smb2proto.h
@@ -59,6 +59,8 @@ extern int smb2_query_path_info(const unsigned int xid, struct cifs_tcon *tcon,
59extern int smb2_set_path_size(const unsigned int xid, struct cifs_tcon *tcon, 59extern int smb2_set_path_size(const unsigned int xid, struct cifs_tcon *tcon,
60 const char *full_path, __u64 size, 60 const char *full_path, __u64 size,
61 struct cifs_sb_info *cifs_sb, bool set_alloc); 61 struct cifs_sb_info *cifs_sb, bool set_alloc);
62extern int smb2_set_file_info(struct inode *inode, const char *full_path,
63 FILE_BASIC_INFO *buf, const unsigned int xid);
62extern int smb2_mkdir(const unsigned int xid, struct cifs_tcon *tcon, 64extern int smb2_mkdir(const unsigned int xid, struct cifs_tcon *tcon,
63 const char *name, struct cifs_sb_info *cifs_sb); 65 const char *name, struct cifs_sb_info *cifs_sb);
64extern void smb2_mkdir_setinfo(struct inode *inode, const char *full_path, 66extern void smb2_mkdir_setinfo(struct inode *inode, const char *full_path,
@@ -124,5 +126,8 @@ extern int SMB2_set_hardlink(const unsigned int xid, struct cifs_tcon *tcon,
124extern int SMB2_set_eof(const unsigned int xid, struct cifs_tcon *tcon, 126extern int SMB2_set_eof(const unsigned int xid, struct cifs_tcon *tcon,
125 u64 persistent_fid, u64 volatile_fid, u32 pid, 127 u64 persistent_fid, u64 volatile_fid, u32 pid,
126 __le64 *eof); 128 __le64 *eof);
129extern int SMB2_set_info(const unsigned int xid, struct cifs_tcon *tcon,
130 u64 persistent_fid, u64 volatile_fid,
131 FILE_BASIC_INFO *buf);
127 132
128#endif /* _SMB2PROTO_H */ 133#endif /* _SMB2PROTO_H */