[SCM] Samba Shared Repository - branch master updated

Andrew Bartlett abartlet at samba.org
Wed May 29 20:49:02 MDT 2013


The branch, master has been updated
       via  09aaa99 build-htmlman-nogit: Run build-htmlman-nogit with bash.
       via  fa3cca3 build-htmlman-git: Run build-htmlman-git with bash.
       via  737dd2a build-htmlman-nogit: manpages-3 has been moved to manpages.
       via  ce8bbdd build-htmlman-git: manpages-3 has been moved to manpages.
       via  0c67a29 docs-xml/.gitignore: manpages-3 has been moved to manpages.
       via  0b8b6fd vfs_glusterfs: Samba VFS module for glusterfs
       via  05578dc samba-tool/dns: Set secure zone update flag after creating new zone
       via  c22eb10 samba-tool/dns: Pass on additional flags when creating zones
       via  612fbc1 s4-dns: Support update of SOA records
       via  de2788a s4-rpc: dnsserver: When updating SOA record, use the specified serial
       via  cc103a8 s4-rpc: dnsserver: dns_name_equal() returns boolean
       via  b5c3ec0 s4-rpc: dnsserver: Fix removal of trailing '.' in soa mname
      from  3f24d69 build: Add missing new line to replaced python shebang line. (Fix bug #9909)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 09aaa991ef765405108c09c2059bbae2d897363e
Author: Karolin Seeger <kseeger at samba.org>
Date:   Wed May 29 10:25:25 2013 +0200

    build-htmlman-nogit: Run build-htmlman-nogit with bash.
    
    On debian/ubuntu, the "dash" which is sh, does not
    provide pushd/popd...
    
    Signed-off-by: Karolin Seeger <kseeger at samba.org>
    
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date(master): Thu May 30 04:48:06 CEST 2013 on sn-devel-104

commit fa3cca3fb0ab957604a29feda734f5bc7db7afdc
Author: Karolin Seeger <kseeger at samba.org>
Date:   Wed May 29 10:23:49 2013 +0200

    build-htmlman-git: Run build-htmlman-git with bash.
    
        On debian/ubuntu, the "dash" which is sh, does not
        provide pushd/popd...
    
    Signed-off-by: Karolin Seeger <kseeger at samba.org>
    
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 737dd2a9fd91a27affd61087639cdc1df21b1cc0
Author: Karolin Seeger <kseeger at samba.org>
Date:   Wed May 29 10:21:23 2013 +0200

    build-htmlman-nogit: manpages-3 has been moved to manpages.
    
    Signed-off-by: Karolin Seeger <kseeger at samba.org>
    
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit ce8bbdd9fc45bda5fb8900a83cc1a2e16a21af06
Author: Karolin Seeger <kseeger at samba.org>
Date:   Wed May 29 10:20:39 2013 +0200

    build-htmlman-git: manpages-3 has been moved to manpages.
    
    Signed-off-by: Karolin Seeger <kseeger at samba.org>
    
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 0c67a29976310ace5cb9966fdd9971bba24c62b6
Author: Karolin Seeger <kseeger at samba.org>
Date:   Wed May 29 10:19:10 2013 +0200

    docs-xml/.gitignore: manpages-3 has been moved to manpages.
    
    Signed-off-by: Karolin Seeger <kseeger at samba.org>
    
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 0b8b6fdc96f59895536d16de43a1494c5eef5c67
Author: Anand Avati <avati at redhat.com>
Date:   Wed May 29 07:21:46 2013 -0400

    vfs_glusterfs: Samba VFS module for glusterfs
    
    Implement a Samba VFS plugin for glusterfs based on gluster's gfapi.
    This is a "bottom" vfs plugin (not something to be stacked on top of
    another module), and translates (most) calls into closest actions
    on gfapi.
    
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Simo Sorce <idra at samba.org>
    Signed-off-by: Anand Avati <avati at redhat.com>

commit 05578dcdbfa1734ae7bafb70859a76f4cd2a023d
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Mon May 27 12:37:20 2013 +1000

    samba-tool/dns: Set secure zone update flag after creating new zone
    
    Windows DC ignores the secure update flag while creating new zone.  Windows
    performs another operation to set the secure update flag.
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>

commit c22eb103d865ed50a6c3ca89750245b92e17b493
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Mon May 27 12:26:36 2013 +1000

    samba-tool/dns: Pass on additional flags when creating zones
    
    Windows DCs require additional flags to be set when creating zones.
    
    This fixes bug #9599.
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>

commit 612fbc18c3bf5307bd71ef533a5b6a13c7ef78b6
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Dec 6 16:11:18 2012 +1100

    s4-dns: Support update of SOA records
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>

commit de2788acd1ee2136b673c5d1ddf5bab335b4675f
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Dec 6 16:06:35 2012 +1100

    s4-rpc: dnsserver: When updating SOA record, use the specified serial
    
    This makes sure that when updating SOA record, the serial is set to the value
    sent by client.  For all other records, serial is incremented.
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>

commit cc103a8187317047347a679e42b076de7d69d181
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Dec 6 16:05:26 2012 +1100

    s4-rpc: dnsserver: dns_name_equal() returns boolean
    
    Remove the remaining check for return value after strcmp() was changed to
    dns_name_equal().
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit b5c3ec0abc22145841b9b528cb55ec381e9c0d06
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Dec 6 16:04:32 2012 +1100

    s4-rpc: dnsserver: Fix removal of trailing '.' in soa mname
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 docs-xml/.gitignore                    |    2 +-
 python/samba/netcmd/dns.py             |   23 +-
 release-scripts/build-htmlman-git      |    4 +-
 release-scripts/build-htmlman-nogit    |    4 +-
 source3/modules/vfs_glusterfs.c        | 1493 ++++++++++++++++++++++++++++++++
 source3/modules/wscript_build          |   10 +
 source3/wscript                        |   19 +
 source4/rpc_server/dnsserver/dnsdata.c |    8 +-
 source4/rpc_server/dnsserver/dnsdb.c   |   15 +-
 9 files changed, 1558 insertions(+), 20 deletions(-)
 create mode 100644 source3/modules/vfs_glusterfs.c


Changeset truncated at 500 lines:

diff --git a/docs-xml/.gitignore b/docs-xml/.gitignore
index c3bb011..6dab9bb 100644
--- a/docs-xml/.gitignore
+++ b/docs-xml/.gitignore
@@ -14,7 +14,7 @@ smbdotconf/parameters.all.xml
 smbdotconf/parameters.global.xml
 smbdotconf/parameters.service.xml
 *.d
-output/manpages-3
+output/manpages
 Samba3-ByExample.tex
 Samba3-Developers-Guide.tex
 xslt/figures/*.pdf
diff --git a/python/samba/netcmd/dns.py b/python/samba/netcmd/dns.py
index 0306e51..137cd98 100644
--- a/python/samba/netcmd/dns.py
+++ b/python/samba/netcmd/dns.py
@@ -854,28 +854,40 @@ class cmd_zonecreate(Command):
             zone_create_info = dnsserver.DNS_RPC_ZONE_CREATE_INFO_W2K()
             zone_create_info.pszZoneName = zone
             zone_create_info.dwZoneType = dnsp.DNS_ZONE_TYPE_PRIMARY
-            zone_create_info.fAllowUpdate = dnsp.DNS_ZONE_UPDATE_SECURE
             zone_create_info.fAging = 0
+            zone_create_info.fDsIntegrated = 1
+            zone_create_info.fLoadExisting = 1
         elif client_version == dnsserver.DNS_CLIENT_VERSION_DOTNET:
             typeid = dnsserver.DNSSRV_TYPEID_ZONE_CREATE_DOTNET
             zone_create_info = dnsserver.DNS_RPC_ZONE_CREATE_INFO_DOTNET()
             zone_create_info.pszZoneName = zone
             zone_create_info.dwZoneType = dnsp.DNS_ZONE_TYPE_PRIMARY
-            zone_create_info.fAllowUpdate = dnsp.DNS_ZONE_UPDATE_SECURE
             zone_create_info.fAging = 0
+            zone_create_info.fDsIntegrated = 1
+            zone_create_info.fLoadExisting = 1
             zone_create_info.dwDpFlags = dnsserver.DNS_DP_DOMAIN_DEFAULT
         else:
             typeid = dnsserver.DNSSRV_TYPEID_ZONE_CREATE
             zone_create_info = dnsserver.DNS_RPC_ZONE_CREATE_INFO_LONGHORN()
             zone_create_info.pszZoneName = zone
             zone_create_info.dwZoneType = dnsp.DNS_ZONE_TYPE_PRIMARY
-            zone_create_info.fAllowUpdate = dnsp.DNS_ZONE_UPDATE_SECURE
             zone_create_info.fAging = 0
+            zone_create_info.fDsIntegrated = 1
+            zone_create_info.fLoadExisting = 1
             zone_create_info.dwDpFlags = dnsserver.DNS_DP_DOMAIN_DEFAULT
 
         res = dns_conn.DnssrvOperation2(client_version, 0, server, None,
                                         0, 'ZoneCreate', typeid,
                                         zone_create_info)
+
+        typeid = dnsserver.DNSSRV_TYPEID_NAME_AND_PARAM
+        name_and_param = dnsserver.DNS_RPC_NAME_AND_PARAM()
+        name_and_param.pszNodeName = 'AllowUpdate'
+        name_and_param.dwParam = dnsp.DNS_ZONE_UPDATE_SECURE
+
+        res = dns_conn.DnssrvOperation2(client_version, 0, server, zone,
+                                        0, 'ResetDwordProperty', typeid,
+                                        name_and_param)
         self.outf.write('Zone %s created successfully\n' % zone)
 
 
@@ -1066,11 +1078,12 @@ class cmd_update_record(Command):
          CNAME  fqdn_string
          NS     fqdn_string
          MX     "fqdn_string preference"
+         SOA    "fqdn_dns fqdn_email serial refresh retry expire minimumttl"
          SRV    "fqdn_string port priority weight"
          TXT    "'string1' 'string2' ..."
     """
 
-    synopsis = '%prog <server> <zone> <name> <A|AAAA|PTR|CNAME|NS|MX|SRV|TXT> <olddata> <newdata>'
+    synopsis = '%prog <server> <zone> <name> <A|AAAA|PTR|CNAME|NS|MX|SOA|SRV|TXT> <olddata> <newdata>'
 
     takes_args = [ 'server', 'zone', 'name', 'rtype', 'olddata', 'newdata' ]
 
@@ -1083,7 +1096,7 @@ class cmd_update_record(Command):
     def run(self, server, zone, name, rtype, olddata, newdata,
                 sambaopts=None, credopts=None, versionopts=None):
 
-        if rtype.upper() not in ('A','AAAA','PTR','CNAME','NS','MX','SRV','TXT'):
+        if rtype.upper() not in ('A','AAAA','PTR','CNAME','NS','MX','SOA','SRV','TXT'):
             raise CommandError('Updating record of type %s is not supported' % rtype)
 
         record_type = dns_type_flag(rtype)
diff --git a/release-scripts/build-htmlman-git b/release-scripts/build-htmlman-git
index 9079a4c..d85c703 100755
--- a/release-scripts/build-htmlman-git
+++ b/release-scripts/build-htmlman-git
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # Copyright (C) Michael Adam 2011
 #
@@ -44,7 +44,7 @@ test -e ${DOCS_DIR}/htmldocs/manpages && rm -rf ${DOCS_DIR}/htmldocs/manpages
 mkdir -p ${DOCS_DIR}/htmldocs/manpages
 
 rsync -Ca ${DOCS_XML_DIR}/output/htmldocs/samba.css ${DOCS_DIR}/htmldocs/
-rsync -Ca ${DOCS_XML_DIR}/output/htmldocs/manpages-3/ ${DOCS_DIR}/htmldocs/manpages
+rsync -Ca ${DOCS_XML_DIR}/output/htmldocs/manpages/ ${DOCS_DIR}/htmldocs/manpages
 
 echo "Success"
 exit
diff --git a/release-scripts/build-htmlman-nogit b/release-scripts/build-htmlman-nogit
index 3f3ff2d..57d0c42 100755
--- a/release-scripts/build-htmlman-nogit
+++ b/release-scripts/build-htmlman-nogit
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # Copyright (C) Michael Adam 2011
 #
@@ -47,7 +47,7 @@ test -e ${DOCS_DIR}/htmldocs/manpages && rm -rf ${DOCS_DIR}/htmldocs/manpages
 mkdir -p ${DOCS_DIR}/htmldocs/manpages
 
 rsync -Ca ${DOCS_XML_DIR}/output/htmldocs/samba.css ${DOCS_DIR}/htmldocs/
-rsync -Ca ${DOCS_XML_DIR}/output/htmldocs/manpages-3/ ${DOCS_DIR}/htmldocs/manpages
+rsync -Ca ${DOCS_XML_DIR}/output/htmldocs/manpages/ ${DOCS_DIR}/htmldocs/manpages
 
 echo "Success"
 exit
diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c
new file mode 100644
index 0000000..24e1bda
--- /dev/null
+++ b/source3/modules/vfs_glusterfs.c
@@ -0,0 +1,1493 @@
+/*
+   Unix SMB/CIFS implementation.
+
+   Wrap GlusterFS GFAPI calls in vfs functions.
+
+   Copyright (c) 2013 Anand Avati <avati at redhat.com>
+
+   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 3 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, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "includes.h"
+#include "smbd/smbd.h"
+#include <stdio.h>
+#include "api/glfs.h"
+#include "lib/util/dlinklist.h"
+
+#define DEFAULT_VOLFILE_SERVER "localhost"
+
+/*
+  TODO
+  ----
+  Short term:
+  - AIO support
+  - sendfile/recvfile support
+*/
+
+/* Helpers to provide 'integer' fds */
+
+/* This is global. gfapi's FD operations do not
+   require filesystem context.
+*/
+
+static glfs_fd_t **glfd_fd;
+static int glfd_fd_size;
+static int glfd_fd_used;
+
+static int glfd_fd_store(glfs_fd_t *glfd)
+{
+	int i;
+	void *tmp;
+
+	if (glfd_fd_size == glfd_fd_used) {
+		if (glfd_fd_size >= INT_MAX - 1) {
+			errno = ENOMEM;
+			return -1;
+		}
+
+		tmp = talloc_realloc(glfd_fd, glfd_fd, glfs_fd_t *,
+				     glfd_fd_size + 1);
+		if (tmp == NULL) {
+			errno = ENOMEM;
+			return -1;
+		}
+
+		glfd_fd = tmp;
+		glfd_fd[glfd_fd_size] = 0;
+		glfd_fd_size++;
+	}
+
+	for (i = 0; i < glfd_fd_size; i++) {
+		if (glfd_fd[i] == NULL) {
+			break;
+		}
+	}
+	glfd_fd_used++;
+	glfd_fd[i] = glfd;
+	return i;
+}
+
+static glfs_fd_t *glfd_fd_get(int i)
+{
+	if (i < 0 || i >= glfd_fd_size) {
+		return NULL;
+	}
+	return glfd_fd[i];
+}
+
+static glfs_fd_t *glfd_fd_clear(int i)
+{
+	glfs_fd_t *glfd = NULL;
+
+	if (i < 0 || i >= glfd_fd_size) {
+		return NULL;
+	}
+
+	glfd = glfd_fd[i];
+
+	glfd_fd[i] = 0;
+	glfd_fd_used--;
+	return glfd;
+}
+
+/* Helper to convert stat to stat_ex */
+
+static void smb_stat_ex_from_stat(struct stat_ex *dst, const struct stat *src)
+{
+	ZERO_STRUCTP(dst);
+
+	dst->st_ex_dev = src->st_dev;
+	dst->st_ex_ino = src->st_ino;
+	dst->st_ex_mode = src->st_mode;
+	dst->st_ex_nlink = src->st_nlink;
+	dst->st_ex_uid = src->st_uid;
+	dst->st_ex_gid = src->st_gid;
+	dst->st_ex_rdev = src->st_rdev;
+	dst->st_ex_size = src->st_size;
+	dst->st_ex_atime.tv_sec = src->st_atime;
+#ifdef STAT_HAVE_NSEC
+	dst->st_ex_atime.tv_nsec = src->st_atime_nsec;
+#endif
+	dst->st_ex_mtime.tv_sec = src->st_mtime;
+#ifdef STAT_HAVE_NSEC
+	dst->st_ex_mtime.tv_nsec = src->st_mtime_nsec;
+#endif
+	dst->st_ex_ctime.tv_sec = src->st_ctime;
+#ifdef STAT_HAVE_NSEC
+	dst->st_ex_ctime.tv_nsec = src->st_ctime_nsec;
+#endif
+	dst->st_ex_btime.tv_sec = src->st_mtime;
+#ifdef STAT_HAVE_NSEC
+	dst->st_ex_btime.tv_nsec = src->st_mtime_nsec;
+#endif
+	dst->st_ex_blksize = src->st_blksize;
+	dst->st_ex_blocks = src->st_blocks;
+}
+
+/* pre-opened glfs_t */
+
+static struct glfs_preopened {
+	char *volume;
+	glfs_t *fs;
+	int ref;
+	struct glfs_preopened *next, *prev;
+} *glfs_preopened;
+
+
+int glfs_set_preopened(const char *volume, glfs_t *fs)
+{
+	struct glfs_preopened *entry = NULL;
+
+	entry = talloc_zero(NULL, struct glfs_preopened);
+	if (!entry) {
+		errno = ENOMEM;
+		return -1;
+	}
+
+	entry->volume = talloc_strdup(entry, volume);
+	if (!entry->volume) {
+		talloc_free(entry);
+		errno = ENOMEM;
+		return -1;
+	}
+
+	entry->fs = fs;
+	entry->ref = 1;
+
+	DLIST_ADD(glfs_preopened, entry);
+
+	return 0;
+}
+
+static glfs_t *glfs_find_preopened(const char *volume)
+{
+	struct glfs_preopened *entry = NULL;
+
+	for (entry = glfs_preopened; entry; entry = entry->next) {
+		if (strcmp(entry->volume, volume) == 0) {
+			entry->ref++;
+			return entry->fs;
+		}
+	}
+
+	return NULL;
+}
+
+static void glfs_clear_preopened(glfs_t *fs)
+{
+	struct glfs_preopened *entry = NULL;
+
+	for (entry = glfs_preopened; entry; entry = entry->next) {
+		if (entry->fs == fs) {
+			if (--entry->ref)
+				return;
+
+			DLIST_REMOVE(glfs_preopened, entry);
+
+			glfs_fini(entry->fs);
+			talloc_free(entry);
+		}
+	}
+}
+
+/* Disk Operations */
+
+static int vfs_gluster_connect(struct vfs_handle_struct *handle,
+			       const char *service,
+			       const char *user)
+{
+	const char *volfile_server;
+	const char *volume;
+	const char *logfile;
+	int loglevel;
+	glfs_t *fs;
+	int ret;
+
+	logfile = lp_parm_const_string(SNUM(handle->conn), "glusterfs",
+				       "logfile", NULL);
+
+	loglevel = lp_parm_int(SNUM(handle->conn), "glusterfs", "loglevel", -1);
+
+	volfile_server = lp_parm_const_string(SNUM(handle->conn), "glusterfs",
+					       "volfile_server", NULL);
+	if (volfile_server == NULL) {
+		volfile_server = DEFAULT_VOLFILE_SERVER;
+	}
+
+	volume = lp_parm_const_string(SNUM(handle->conn), "glusterfs", "volume",
+				      NULL);
+	if (volume == NULL) {
+		volume = service;
+	}
+
+	fs = glfs_find_preopened(volume);
+	if (fs) {
+		goto found;
+	}
+
+	fs = glfs_new(volume);
+	if (fs == NULL) {
+		return -1;
+	}
+
+	ret = glfs_set_volfile_server(fs, "tcp", volfile_server, 0);
+	if (ret < 0) {
+		DEBUG(0, ("Failed to set volfile_server %s\n", volfile_server));
+		glfs_fini(fs);
+		return -1;
+	}
+
+	ret = glfs_set_xlator_option(fs, "*-md-cache", "cache-posix-acl",
+				     "true");
+	if (ret < 0) {
+		DEBUG(0, ("%s: Failed to set xlator options\n", volume));
+		glfs_fini(fs);
+		return -1;
+	}
+
+	ret = glfs_set_logging(fs, logfile, loglevel);
+	if (ret < 0) {
+		DEBUG(0, ("%s: Failed to set logfile %s loglevel %d\n",
+			  volume, logfile, loglevel));
+		glfs_fini(fs);
+		return -1;
+	}
+
+	ret = glfs_init(fs);
+	if (ret < 0) {
+		DEBUG(0, ("%s: Failed to initialize volume (%s)\n",
+			  volume, strerror(errno)));
+		glfs_fini(fs);
+		return -1;
+	}
+
+	ret = glfs_set_preopened(volume, fs);
+	if (ret < 0) {
+		DEBUG(0, ("%s: Failed to register volume (%s)\n",
+			  volume, strerror(errno)));
+		glfs_fini(fs);
+		return -1;
+	}
+found:
+	DEBUG(0, ("%s: Initialized volume from server %s\n",
+		  volume, volfile_server));
+	handle->data = fs;
+	return 0;
+}
+
+static void vfs_gluster_disconnect(struct vfs_handle_struct *handle)
+{
+	glfs_t *fs = NULL;
+
+	fs = handle->data;
+
+	glfs_clear_preopened(fs);
+}
+
+static uint64_t vfs_gluster_disk_free(struct vfs_handle_struct *handle,
+				      const char *path, bool small_query,
+				      uint64_t *bsize_p, uint64_t *dfree_p,
+				      uint64_t *dsize_p)
+{
+	struct statvfs statvfs = { 0, };
+	uint64_t dfree = 0;
+	int ret;
+
+	ret = glfs_statvfs(handle->data, path, &statvfs);
+	if (ret < 0) {
+		return -1;
+	}
+
+	dfree = statvfs.f_bsize * statvfs.f_bavail;
+
+	if (bsize_p != NULL) {
+		*bsize_p = statvfs.f_bsize;
+	}
+	if (dfree_p != NULL) {
+		*dfree_p = dfree;
+	}
+	if (dsize_p != NULL) {
+		*dsize_p = statvfs.f_bsize * statvfs.f_blocks;
+	}
+
+	return dfree;
+}
+
+static int vfs_gluster_get_quota(struct vfs_handle_struct *handle,
+				 enum SMB_QUOTA_TYPE qtype, unid_t id,
+				 SMB_DISK_QUOTA *qt)
+{
+	errno = ENOSYS;
+	return -1;
+}
+
+static int
+vfs_gluster_set_quota(struct vfs_handle_struct *handle,
+		      enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *qt)
+{
+	errno = ENOSYS;
+	return -1;
+}
+
+static int vfs_gluster_statvfs(struct vfs_handle_struct *handle,
+			       const char *path,
+			       struct vfs_statvfs_struct *vfs_statvfs)
+{
+	struct statvfs statvfs = { 0, };
+	int ret;
+
+	ret = glfs_statvfs(handle->data, path, &statvfs);
+	if (ret < 0) {
+		DEBUG(0, ("glfs_statvfs(%s) failed: %s\n",
+			  path, strerror(errno)));
+		return -1;
+	}
+
+	ZERO_STRUCTP(vfs_statvfs);
+
+	vfs_statvfs->OptimalTransferSize = statvfs.f_frsize;
+	vfs_statvfs->BlockSize = statvfs.f_bsize;
+	vfs_statvfs->TotalBlocks = statvfs.f_blocks;
+	vfs_statvfs->BlocksAvail = statvfs.f_bfree;
+	vfs_statvfs->UserBlocksAvail = statvfs.f_bavail;
+	vfs_statvfs->TotalFileNodes = statvfs.f_files;
+	vfs_statvfs->FreeFileNodes = statvfs.f_ffree;
+	vfs_statvfs->FsIdentifier = statvfs.f_fsid;
+	vfs_statvfs->FsCapabilities =
+	    FILE_CASE_SENSITIVE_SEARCH | FILE_CASE_PRESERVED_NAMES;
+
+	return ret;
+}
+


-- 
Samba Shared Repository


More information about the samba-cvs mailing list