--- samba-3.5.8/source3/libsmb/clifsinfo.c.orig	2011-06-05 19:34:19.000000000 +0200
+++ samba-3.5.8/source3/libsmb/clifsinfo.c	2011-06-05 19:38:00.000000000 +0200
@@ -383,6 +383,68 @@
 	return ret;
 }
 
+bool cli_filesystem_size(struct cli_state *cli,
+				uint64_t *allocated,
+				uint64_t *available,
+				uint32_t *sectors_per_unit,
+				uint32_t *blocks_per_sector)
+{
+        bool ret = False;
+        uint16 setup;
+        char param[2];
+        char *rparam=NULL, *rdata=NULL;
+        unsigned int rparam_count=0, rdata_count=0;
+
+        setup = TRANSACT2_QFSINFO;
+
+        SSVAL(param, 0, SMB_QUERY_FS_SIZE_INFO);
+
+        if (!cli_send_trans(cli, SMBtrans2,
+                    NULL,
+                    0, 0,
+                    &setup, 1, 0,
+                    param, 2, 0,
+                    NULL, 0, 560)) {
+                goto cleanup;
+        }
+
+        if (!cli_receive_trans(cli, SMBtrans2,
+                              &rparam, &rparam_count,
+                              &rdata, &rdata_count)) {
+                goto cleanup;
+        }
+
+        if (cli_is_error(cli)) {
+                ret = False;
+                goto cleanup;
+        } else {
+                ret = True;
+        }
+
+        if (rdata_count < 24) {
+                goto cleanup;
+        }
+
+	if (allocated) {
+		*allocated = BIG_UINT(rdata, 0);
+	}
+	if (available) {
+		*available = BIG_UINT(rdata, 8);
+	}
+	if (sectors_per_unit) {
+		*sectors_per_unit = IVAL(rdata, 16);
+	}
+	if (blocks_per_sector) {
+		*blocks_per_sector = IVAL(rdata, 20);
+	}
+
+cleanup:
+        SAFE_FREE(rparam);
+        SAFE_FREE(rdata);
+
+        return ret;
+}
+
 bool cli_get_fs_full_size_info(struct cli_state *cli,
                                uint64_t *total_allocation_units,
                                uint64_t *caller_allocation_units,
