s3: remove some duplicate quota code
authorBjörn Jacke <bj@sernet.de>
Sun, 2 Sep 2012 19:44:54 +0000 (21:44 +0200)
committerBjörn Jacke <bj@sernet.de>
Sun, 2 Sep 2012 19:44:54 +0000 (21:44 +0200)
source3/smbd/quotas.c

index caf02445dc5409715303c0a11533e15d3be1b908..d8bdb0225ca0296927bd29da7290fc68f62c11f9 100644 (file)
@@ -51,6 +51,7 @@ bool disk_quotas_vxfs(const char *name, char *path, uint64_t *bsize, uint64_t *d
 
 #endif /* VXFS_QUOTA */
 
+
 #ifdef LINUX
 
 #include <sys/types.h>
@@ -87,15 +88,6 @@ typedef struct _LINUX_SMB_DISK_QUOTA {
 #endif
 #include <rpc/xdr.h>
 
-static int my_xdr_getquota_args(XDR *xdrsp, struct getquota_args *args)
-{
-       if (!xdr_string(xdrsp, &args->gqa_pathp, RQ_PATHLEN ))
-               return(0);
-       if (!xdr_int(xdrsp, &args->gqa_uid))
-               return(0);
-       return (1);
-}
-
 static int my_xdr_getquota_rslt(XDR *xdrsp, struct getquota_rslt *gqr)
 {
        int quotastat;
@@ -613,15 +605,6 @@ bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *d
 #include <rpc/nettype.h>
 #include <rpc/xdr.h>
 
-static int my_xdr_getquota_args(XDR *xdrsp, struct getquota_args *args)
-{
-       if (!xdr_string(xdrsp, &args->gqa_pathp, RQ_PATHLEN ))
-               return(0);
-       if (!xdr_int(xdrsp, &args->gqa_uid))
-               return(0);
-       return (1);
-}
-
 static int my_xdr_getquota_rslt(XDR *xdrsp, struct getquota_rslt *gqr)
 {
        int quotastat;
@@ -1170,15 +1153,6 @@ bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *d
 #endif
 #include <rpc/xdr.h>
 
-static int my_xdr_getquota_args(XDR *xdrsp, struct getquota_args *args)
-{
-       if (!xdr_string(xdrsp, &args->gqa_pathp, RQ_PATHLEN ))
-               return(0);
-       if (!xdr_int(xdrsp, &args->gqa_uid))
-               return(0);
-       return (1);
-}
-
 static int my_xdr_getquota_rslt(XDR *xdrsp, struct getquota_rslt *gqr)
 {
        int quotastat;
@@ -1511,6 +1485,17 @@ bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *d
 
 #endif
 
+#if definedr(LINUX) || defined(SUNOS) || defined (__FreeBSD__) || defined(__DragonFly__)
+static int my_xdr_getquota_args(XDR *xdrsp, struct getquota_args *args)
+{
+       if (!xdr_string(xdrsp, &args->gqa_pathp, RQ_PATHLEN ))
+               return(0);
+       if (!xdr_int(xdrsp, &args->gqa_uid))
+               return(0);
+       return (1);
+}
+#endif
+
 #if defined(VXFS_QUOTA)
 
 /****************************************************************************