1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-21 18:04:06 +03:00

s4/client: add FS_SECTOR_SIZE_INFORMATION query support

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
David Disseldorp 2015-03-13 00:46:21 +01:00 committed by Jeremy Allison
parent ba9fd54bdf
commit 664dca2b44
3 changed files with 44 additions and 1 deletions

View File

@ -1620,6 +1620,7 @@ fsinfo_level_t fsinfo_levels[] = {
{"quota-information", RAW_QFS_QUOTA_INFORMATION},
{"fullsize-information", RAW_QFS_FULL_SIZE_INFORMATION},
{"objectid", RAW_QFS_OBJECTID_INFORMATION},
{"sector-size-info", RAW_QFS_SECTOR_SIZE_INFORMATION},
{NULL, RAW_QFS_GENERIC}
};
@ -1763,6 +1764,22 @@ static int cmd_fsinfo(struct smbclient_context *ctx, const char **args)
(unsigned long long) fsinfo.objectid_information.out.unknown[4],
(unsigned long long) fsinfo.objectid_information.out.unknown[5] );
break;
case RAW_QFS_SECTOR_SIZE_INFORMATION:
d_printf("\tlogical_bytes_per_sector: %u\n",
(unsigned)fsinfo.sector_size_info.out.logical_bytes_per_sector);
d_printf("\tphys_bytes_per_sector_atomic: %u\n",
(unsigned)fsinfo.sector_size_info.out.phys_bytes_per_sector_atomic);
d_printf("\tphys_bytes_per_sector_perf: %u\n",
(unsigned)fsinfo.sector_size_info.out.phys_bytes_per_sector_perf);
d_printf("\tfs_effective_phys_bytes_per_sector_atomic: %u\n",
(unsigned)fsinfo.sector_size_info.out.fs_effective_phys_bytes_per_sector_atomic);
d_printf("\tflags: 0x%x\n",
(unsigned)fsinfo.sector_size_info.out.flags);
d_printf("\tbyte_off_sector_align: %u\n",
(unsigned)fsinfo.sector_size_info.out.byte_off_sector_align);
d_printf("\tbyte_off_partition_align: %u\n",
(unsigned)fsinfo.sector_size_info.out.byte_off_partition_align);
break;
case RAW_QFS_GENERIC:
d_printf("\twrong level returned\n");
break;

View File

@ -1167,7 +1167,9 @@ enum smb_fsinfo_level {
RAW_QFS_ATTRIBUTE_INFORMATION = SMB_QFS_ATTRIBUTE_INFORMATION,
RAW_QFS_QUOTA_INFORMATION = SMB_QFS_QUOTA_INFORMATION,
RAW_QFS_FULL_SIZE_INFORMATION = SMB_QFS_FULL_SIZE_INFORMATION,
RAW_QFS_OBJECTID_INFORMATION = SMB_QFS_OBJECTID_INFORMATION};
RAW_QFS_OBJECTID_INFORMATION = SMB_QFS_OBJECTID_INFORMATION,
RAW_QFS_SECTOR_SIZE_INFORMATION = SMB_QFS_SECTOR_SIZE_INFORMATION,
};
/* union for fsinfo() backend call. Note that there are no in
@ -1331,6 +1333,22 @@ union smb_fsinfo {
uint64_t unknown[6];
} out;
} objectid_information;
/* trans2 RAW_QFS_SECTOR_SIZE_INFORMATION interface */
struct {
enum smb_fsinfo_level level;
struct smb2_handle handle; /* only for smb2 */
struct {
uint32_t logical_bytes_per_sector;
uint32_t phys_bytes_per_sector_atomic;
uint32_t phys_bytes_per_sector_perf;
uint32_t fs_effective_phys_bytes_per_sector_atomic;
uint32_t flags;
uint32_t byte_off_sector_align;
uint32_t byte_off_partition_align;
} out;
} sector_size_info;
};

View File

@ -63,6 +63,7 @@ Found 4 aliased levels
#define SMB_QFS_QUOTA_INFORMATION 1006
#define SMB_QFS_FULL_SIZE_INFORMATION 1007
#define SMB_QFS_OBJECTID_INFORMATION 1008
#define SMB_QFS_SECTOR_SIZE_INFORMATION 1011
/* trans2 qfileinfo/qpathinfo */
@ -283,6 +284,13 @@ Found 0 aliased levels
#define QFS_TYPE_MOUNTED 0x20
#define QFS_TYPE_VIRTUAL 0x40
/* SMB_QFS_SECTOR_SIZE_INFORMATION values */
#define QFS_SSINFO_FLAGS_ALIGNED_DEVICE 0x00000001
#define QFS_SSINFO_FLAGS_PARTITION_ALIGNED_ON_DEVICE 0x00000002
#define QFS_SSINFO_FLAGS_NO_SEEK_PENALTY 0x00000004
#define QFS_SSINFO_FLAGS_TRIM_ENABLED 0x00000008
#define QFS_SSINFO_OFFSET_UNKNOWN 0xffffffff
/*
* Thursby MAC extensions....