summaryrefslogtreecommitdiffstats
path: root/source3/libsmb
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2014-06-04 14:12:38 -0700
committerJeremy Allison <jra@samba.org>2014-06-07 03:15:14 +0200
commit66a04ba7c115d3be111296000e93cc18a1a05ef6 (patch)
tree69a53e6cf365caf4f106b586a1bb9d296a886f4d /source3/libsmb
parent536c799f00d7bdd6a574b6bdbc0e9c742eeef8b5 (diff)
downloadsamba-66a04ba7c115d3be111296000e93cc18a1a05ef6.tar.gz
samba-66a04ba7c115d3be111296000e93cc18a1a05ef6.tar.xz
samba-66a04ba7c115d3be111296000e93cc18a1a05ef6.zip
s3: libsmb : Move users of cli_dskattr to a 64-bit interface cli_disk_free().
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/clifile.c26
-rw-r--r--source3/libsmb/proto.h1
2 files changed, 27 insertions, 0 deletions
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,