summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-10-20 17:33:17 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:05:08 -0500
commita5b339c799b39d5147c6d31f94cc0b2ea9c865db (patch)
tree0382efacfd7b5d944f1c1903df0243956e67cbab /source3/smbd
parentfc8292f38151705e520880acbf57a87982e4325c (diff)
downloadsamba-a5b339c799b39d5147c6d31f94cc0b2ea9c865db.tar.gz
samba-a5b339c799b39d5147c6d31f94cc0b2ea9c865db.tar.bz2
samba-a5b339c799b39d5147c6d31f94cc0b2ea9c865db.zip
r11232: Added ab's POSIX statvfs vfs call. Sorry for the delay ab.
Jeremy. (This used to be commit af8545806770a7530eecc184bdd230ca14999884)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/trans2.c33
-rw-r--r--source3/smbd/vfs-wrap.c5
-rw-r--r--source3/smbd/vfs.c1
3 files changed, 39 insertions, 0 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index cfb630a572..155f8b384c 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -4,6 +4,7 @@
Copyright (C) Jeremy Allison 1994-2003
Copyright (C) Stefan (metze) Metzmacher 2003
Copyright (C) Volker Lendecke 2005
+ Copyright (C) Steve French 2005
Extensively modified by Andrew Tridgell, 1995
@@ -2403,6 +2404,38 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)bsize, (unsigned
CIFS_UNIX_POSIX_PATHNAMES_CAP))); /* We have POSIX ACLs and pathname capability. */
break;
+ case SMB_QUERY_POSIX_FS_INFO:
+ {
+ int rc;
+ vfs_statvfs_struct svfs;
+
+ if (!lp_unix_extensions())
+ return ERROR_DOS(ERRDOS,ERRunknownlevel);
+
+ rc = SMB_VFS_STATVFS(conn, ".", &svfs);
+
+ if (!rc) {
+ data_len = 56;
+ SIVAL(pdata,0,svfs.OptimalTransferSize);
+ SIVAL(pdata,4,svfs.BlockSize);
+ SBIG_UINT(pdata,8,svfs.TotalBlocks);
+ SBIG_UINT(pdata,16,svfs.BlocksAvail);
+ SBIG_UINT(pdata,24,svfs.UserBlocksAvail);
+ SBIG_UINT(pdata,32,svfs.TotalFileNodes);
+ SBIG_UINT(pdata,40,svfs.FreeFileNodes);
+ SBIG_UINT(pdata,48,svfs.FsIdentifier);
+ DEBUG(5,("call_trans2qfsinfo : SMB_QUERY_POSIX_FS_INFO succsessful\n"));
+#ifdef EOPNOTSUPP
+ } else if (rc == EOPNOTSUPP) {
+ return ERROR_DOS(ERRDOS, ERRunknownlevel);
+#endif /* EOPNOTSUPP */
+ } else {
+ DEBUG(0,("vfs_statvfs() failed for service [%s]\n",lp_servicename(SNUM(conn))));
+ return ERROR_DOS(ERRSRV,ERRerror);
+ }
+ break;
+ }
+
case SMB_MAC_QUERY_FS_INFO:
/*
* Thursby MAC extension... ONLY on NTFS filesystems
diff --git a/source3/smbd/vfs-wrap.c b/source3/smbd/vfs-wrap.c
index c203af0c55..bbb7b5bb30 100644
--- a/source3/smbd/vfs-wrap.c
+++ b/source3/smbd/vfs-wrap.c
@@ -86,6 +86,11 @@ int vfswrap_get_shadow_copy_data(struct vfs_handle_struct *handle, struct files_
return -1; /* Not implemented. */
}
+int vfswrap_statvfs(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *path, vfs_statvfs_struct *statbuf)
+{
+ return sys_statvfs(path, statbuf);
+}
+
/* Directory operations */
SMB_STRUCT_DIR *vfswrap_opendir(vfs_handle_struct *handle, connection_struct *conn, const char *fname, const char *mask, uint32 attr)
diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c
index 67970f203a..52966d59ae 100644
--- a/source3/smbd/vfs.c
+++ b/source3/smbd/vfs.c
@@ -57,6 +57,7 @@ static struct vfs_ops default_vfs = {
vfswrap_get_quota,
vfswrap_set_quota,
vfswrap_get_shadow_copy_data,
+ vfswrap_statvfs,
/* Directory operations */