aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/smb2pdu.c
diff options
context:
space:
mode:
authorSteven French <smfrench@gmail.com>2013-10-09 21:55:53 -0400
committerSteve French <smfrench@gmail.com>2013-11-02 13:52:41 -0400
commitaf6a12ea8d4bb39a87527835b943bde4215897e5 (patch)
treea237a3054cd667520b22e4bf27009a1f36e79160 /fs/cifs/smb2pdu.c
parent2167114c6ea6e76fd84e368bae5389d37dd156aa (diff)
Query File System Alignment
In SMB3 it is now possible to query the file system alignment info, and the preferred (for performance) sector size and whether the underlying disk has no seek penalty (like SSD). Query this information at mount time for SMB3, and make it visible in /proc/fs/cifs/DebugData for debugging purposes. This alignment information and preferred sector size info will be helpful for the copy offload patches to setup the right chunks in the CopyChunk requests. Presumably the knowledge that the underlying disk is SSD could also help us make better readahead and writebehind decisions (something to look at in the future). Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/smb2pdu.c')
-rw-r--r--fs/cifs/smb2pdu.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index 7887cf50e5fb..8ab05b0d6778 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -2373,8 +2373,11 @@ SMB2_QFS_attr(const unsigned int xid, struct cifs_tcon *tcon,
2373 } else if (level == FS_ATTRIBUTE_INFORMATION) { 2373 } else if (level == FS_ATTRIBUTE_INFORMATION) {
2374 max_len = sizeof(FILE_SYSTEM_ATTRIBUTE_INFO); 2374 max_len = sizeof(FILE_SYSTEM_ATTRIBUTE_INFO);
2375 min_len = MIN_FS_ATTR_INFO_SIZE; 2375 min_len = MIN_FS_ATTR_INFO_SIZE;
2376 } else if (level == FS_SECTOR_SIZE_INFORMATION) {
2377 max_len = sizeof(struct smb3_fs_ss_info);
2378 min_len = sizeof(struct smb3_fs_ss_info);
2376 } else { 2379 } else {
2377 cifs_dbg(FYI, "Invalid qfsinfo level %d", level); 2380 cifs_dbg(FYI, "Invalid qfsinfo level %d\n", level);
2378 return -EINVAL; 2381 return -EINVAL;
2379 } 2382 }
2380 2383
@@ -2403,6 +2406,13 @@ SMB2_QFS_attr(const unsigned int xid, struct cifs_tcon *tcon,
2403 else if (level == FS_DEVICE_INFORMATION) 2406 else if (level == FS_DEVICE_INFORMATION)
2404 memcpy(&tcon->fsDevInfo, 4 /* RFC1001 len */ + offset 2407 memcpy(&tcon->fsDevInfo, 4 /* RFC1001 len */ + offset
2405 + (char *)&rsp->hdr, sizeof(FILE_SYSTEM_DEVICE_INFO)); 2408 + (char *)&rsp->hdr, sizeof(FILE_SYSTEM_DEVICE_INFO));
2409 else if (level == FS_SECTOR_SIZE_INFORMATION) {
2410 struct smb3_fs_ss_info *ss_info = (struct smb3_fs_ss_info *)
2411 (4 /* RFC1001 len */ + offset + (char *)&rsp->hdr);
2412 tcon->ss_flags = le32_to_cpu(ss_info->Flags);
2413 tcon->perf_sector_size =
2414 le32_to_cpu(ss_info->PhysicalBytesPerSectorForPerf);
2415 }
2406 2416
2407qfsattr_exit: 2417qfsattr_exit:
2408 free_rsp_buf(resp_buftype, iov.iov_base); 2418 free_rsp_buf(resp_buftype, iov.iov_base);