summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2008-05-15 20:45:30 +1000
committerAndrew Tridgell <tridge@samba.org>2008-05-15 20:45:30 +1000
commit0abc2e2020f40d018587eb265f2a1467fdba4c89 (patch)
tree0e7ccfca9a9e3a2a03bdf74e1bd2bf6a560fcc35 /source4
parentca3257b286ed2e1b87a7d56ba290d01cd2078023 (diff)
downloadsamba-0abc2e2020f40d018587eb265f2a1467fdba4c89.tar.gz
samba-0abc2e2020f40d018587eb265f2a1467fdba4c89.tar.bz2
samba-0abc2e2020f40d018587eb265f2a1467fdba4c89.zip
use a newer fsinfo level in smbclient, to support larger disks
(This used to be commit 1acc8077fb86c1e78724b010d149db166d98238d)
Diffstat (limited to 'source4')
-rw-r--r--source4/client/client.c9
-rw-r--r--source4/libcli/clifile.c11
2 files changed, 12 insertions, 8 deletions
diff --git a/source4/client/client.c b/source4/client/client.c
index 120a80ccd2..01197e8a9e 100644
--- a/source4/client/client.c
+++ b/source4/client/client.c
@@ -214,15 +214,18 @@ check the space on a device
****************************************************************************/
static int do_dskattr(struct smbclient_context *ctx)
{
- int total, bsize, avail;
+ uint32_t bsize;
+ uint64_t total, avail;
if (NT_STATUS_IS_ERR(smbcli_dskattr(ctx->cli->tree, &bsize, &total, &avail))) {
d_printf("Error in dskattr: %s\n",smbcli_errstr(ctx->cli->tree));
return 1;
}
- d_printf("\n\t\t%d blocks of size %d. %d blocks available\n",
- total, bsize, avail);
+ d_printf("\n\t\t%llu blocks of size %u. %llu blocks available\n",
+ (unsigned long long)total,
+ (unsigned)bsize,
+ (unsigned long long)avail);
return 0;
}
diff --git a/source4/libcli/clifile.c b/source4/libcli/clifile.c
index e59b7f9af3..2cf174060b 100644
--- a/source4/libcli/clifile.c
+++ b/source4/libcli/clifile.c
@@ -650,7 +650,8 @@ NTSTATUS smbcli_chkpath(struct smbcli_tree *tree, const char *path)
/****************************************************************************
Query disk space.
****************************************************************************/
-NTSTATUS smbcli_dskattr(struct smbcli_tree *tree, int *bsize, int *total, int *avail)
+NTSTATUS smbcli_dskattr(struct smbcli_tree *tree, uint32_t *bsize,
+ uint64_t *total, uint64_t *avail)
{
union smb_fsinfo fsinfo_parms;
TALLOC_CTX *mem_ctx;
@@ -658,12 +659,12 @@ NTSTATUS smbcli_dskattr(struct smbcli_tree *tree, int *bsize, int *total, int *a
mem_ctx = talloc_init("smbcli_dskattr");
- fsinfo_parms.dskattr.level = RAW_QFS_DSKATTR;
+ fsinfo_parms.dskattr.level = RAW_QFS_SIZE_INFO;
status = smb_raw_fsinfo(tree, mem_ctx, &fsinfo_parms);
if (NT_STATUS_IS_OK(status)) {
- *bsize = fsinfo_parms.dskattr.out.block_size;
- *total = fsinfo_parms.dskattr.out.units_total;
- *avail = fsinfo_parms.dskattr.out.units_free;
+ *bsize = fsinfo_parms.size_info.out.bytes_per_sector * fsinfo_parms.size_info.out.sectors_per_unit;
+ *total = fsinfo_parms.size_info.out.total_alloc_units;
+ *avail = fsinfo_parms.size_info.out.avail_alloc_units;
}
talloc_free(mem_ctx);