summaryrefslogtreecommitdiff
path: root/source4/ntvfs/posix/pvfs_fsinfo.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-09-20 07:28:43 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:58:52 -0500
commit8a1c3ddd947039bf3b62efd94d3429359b593e15 (patch)
tree624a515f2654edd6854e7567173d9ce083eb925d /source4/ntvfs/posix/pvfs_fsinfo.c
parent421c0d2a187481c74ebee0937be9ba0a47752fa6 (diff)
downloadsamba-8a1c3ddd947039bf3b62efd94d3429359b593e15.tar.gz
samba-8a1c3ddd947039bf3b62efd94d3429359b593e15.tar.bz2
samba-8a1c3ddd947039bf3b62efd94d3429359b593e15.zip
r2436: the second big lump of posix vfs code.
this is still just a skeleton, and many of the functions are just based on the simple vfs backend, they are there to allow me to run smbtorture tests against the real parts of the posix backend. (This used to be commit f2fa7fe565e89360dba3bb5434d3a6a36f398348)
Diffstat (limited to 'source4/ntvfs/posix/pvfs_fsinfo.c')
-rw-r--r--source4/ntvfs/posix/pvfs_fsinfo.c65
1 files changed, 65 insertions, 0 deletions
diff --git a/source4/ntvfs/posix/pvfs_fsinfo.c b/source4/ntvfs/posix/pvfs_fsinfo.c
new file mode 100644
index 0000000000..826e331b84
--- /dev/null
+++ b/source4/ntvfs/posix/pvfs_fsinfo.c
@@ -0,0 +1,65 @@
+/*
+ Unix SMB/CIFS implementation.
+
+ POSIX NTVFS backend - fsinfo
+
+ Copyright (C) Andrew Tridgell 2004
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#include "include/includes.h"
+#include "vfs_posix.h"
+
+
+/*
+ return filesystem space info
+*/
+NTSTATUS pvfs_fsinfo(struct smbsrv_request *req, union smb_fsinfo *fs)
+{
+ struct pvfs_state *pvfs = req->tcon->ntvfs_private;
+ struct stat st;
+
+ if (fs->generic.level != RAW_QFS_GENERIC) {
+ return ntvfs_map_fsinfo(req, fs);
+ }
+
+ if (sys_fsusage(pvfs->base_directory,
+ &fs->generic.out.blocks_free,
+ &fs->generic.out.blocks_total) == -1) {
+ return pvfs_map_errno(pvfs, errno);
+ }
+
+ fs->generic.out.block_size = 512;
+
+ if (stat(pvfs->base_directory, &st) != 0) {
+ return NT_STATUS_DISK_CORRUPT_ERROR;
+ }
+
+ fs->generic.out.fs_id = st.st_ino;
+ unix_to_nt_time(&fs->generic.out.create_time, st.st_ctime);
+ fs->generic.out.serial_number = st.st_ino;
+ fs->generic.out.fs_attr = 0;
+ fs->generic.out.max_file_component_length = 255;
+ fs->generic.out.device_type = 0;
+ fs->generic.out.device_characteristics = 0;
+ fs->generic.out.quota_soft = 0;
+ fs->generic.out.quota_hard = 0;
+ fs->generic.out.quota_flags = 0;
+ fs->generic.out.volume_name = talloc_strdup(req, pvfs->share_name);
+ fs->generic.out.fs_type = req->tcon->fs_type;
+
+ return NT_STATUS_OK;
+}