From 66a04ba7c115d3be111296000e93cc18a1a05ef6 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 4 Jun 2014 14:12:38 -0700 Subject: s3: libsmb : Move users of cli_dskattr to a 64-bit interface cli_disk_free(). Signed-off-by: Jeremy Allison Reviewed-by: Volker Lendecke --- source3/libsmb/clifile.c | 26 ++++++++++++++++++++++++++ source3/libsmb/proto.h | 1 + 2 files changed, 27 insertions(+) (limited to 'source3/libsmb') diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c index 70b769d1bd..8bb1512f78 100644 --- a/source3/libsmb/clifile.c +++ b/source3/libsmb/clifile.c @@ -4132,6 +4132,32 @@ NTSTATUS cli_dskattr(struct cli_state *cli, int *bsize, int *total, int *avail) return status; } +NTSTATUS cli_disk_size(struct cli_state *cli, uint64_t *bsize, uint64_t *total, uint64_t *avail) +{ + int old_bsize, old_total, old_avail; + NTSTATUS status; + + if (smbXcli_conn_protocol(cli->conn) >= PROTOCOL_SMB2_02) { + status = cli_smb2_dskattr(cli, &old_bsize, &old_total, &old_avail); + } else { + status = cli_dskattr(cli, &old_bsize, &old_total, &old_avail); + } + + if (!NT_STATUS_IS_OK(status)) { + return status; + } + if (bsize) { + *bsize = (uint64_t)old_bsize; + } + if (total) { + *total = (uint64_t)old_total; + } + if (avail) { + *avail = (uint64_t)old_avail; + } + return NT_STATUS_OK; +} + /**************************************************************************** Create and open a temporary file. ****************************************************************************/ diff --git a/source3/libsmb/proto.h b/source3/libsmb/proto.h index 525625cd30..63d2df4a37 100644 --- a/source3/libsmb/proto.h +++ b/source3/libsmb/proto.h @@ -516,6 +516,7 @@ struct tevent_req *cli_dskattr_send(TALLOC_CTX *mem_ctx, NTSTATUS cli_dskattr_recv(struct tevent_req *req, int *bsize, int *total, int *avail); NTSTATUS cli_dskattr(struct cli_state *cli, int *bsize, int *total, int *avail); +NTSTATUS cli_disk_size(struct cli_state *cli, uint64_t *bsize, uint64_t *total, uint64_t *avail); struct tevent_req *cli_ctemp_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct cli_state *cli, -- cgit