s3/vfs: remove unused SMB_VFS_DISK_FREE() small_query parameter
authorDavid Disseldorp <ddiss@samba.org>
Mon, 16 Feb 2015 18:26:24 +0000 (19:26 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 17 Feb 2015 04:37:20 +0000 (05:37 +0100)
The small_query parameter for SMB_VFS_DISK_FREE() was, prior to the
previous commit, used to obtain 16-bit wide free-space information for
the deprecated dskattr SMB_COM_QUERY_INFORMATION_DISK command.

With the dskattr handler now performing the 16-bit collapse directly,
the small_query parameter can be removed from the entire code path.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Feb 17 05:37:20 CET 2015 on sn-devel-104

19 files changed:
examples/VFS/skel_opaque.c
examples/VFS/skel_transparent.c
source3/include/vfs.h
source3/include/vfs_macros.h
source3/modules/vfs_cap.c
source3/modules/vfs_ceph.c
source3/modules/vfs_default.c
source3/modules/vfs_full_audit.c
source3/modules/vfs_glusterfs.c
source3/modules/vfs_gpfs.c
source3/modules/vfs_shadow_copy2.c
source3/modules/vfs_snapper.c
source3/modules/vfs_time_audit.c
source3/smbd/dfree.c
source3/smbd/proto.h
source3/smbd/reply.c
source3/smbd/trans2.c
source3/smbd/vfs.c
source3/torture/cmd_vfs.c

index b52c381572eb1b9ec97a87c65d50c508a0cfb4a8..2a53c8a9d31176497e8d229e15a5e5c49886b3d0 100644 (file)
@@ -45,7 +45,7 @@ static void skel_disconnect(vfs_handle_struct *handle)
 }
 
 static uint64_t skel_disk_free(vfs_handle_struct *handle, const char *path,
-                              bool small_query, uint64_t *bsize,
+                              uint64_t *bsize,
                               uint64_t *dfree, uint64_t *dsize)
 {
        *bsize = 0;
index 925e5200350c7178a8f665e085a30caf28fa5388..eb561db04312a679166f462485f42777a72a1203 100644 (file)
@@ -49,11 +49,10 @@ static void skel_disconnect(vfs_handle_struct *handle)
 }
 
 static uint64_t skel_disk_free(vfs_handle_struct *handle, const char *path,
-                              bool small_query, uint64_t *bsize,
+                              uint64_t *bsize,
                               uint64_t *dfree, uint64_t *dsize)
 {
-       return SMB_VFS_NEXT_DISK_FREE(handle, path, small_query, bsize,
-                                     dfree, dsize);
+       return SMB_VFS_NEXT_DISK_FREE(handle, path, bsize, dfree, dsize);
 }
 
 static int skel_get_quota(vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype,
index 1843ef428ee3f58f0b5c36038bf9b85849069915..3444f621683397d70b6f88889a6b9746f3d07088 100644 (file)
 /* Version 32 - Add "lease" to CREATE_FILE operation */
 /* Version 32 - Add "lease" to struct files_struct */
 /* Version 32 - Add SMB_VFS_READDIR_ATTR() */
-/* Version 32 - Add in and our create context blobs to create_file */
+/* Version 32 - Add in and out create context blobs to create_file */
+/* Version 32 - Remove unnecessary SMB_VFS_DISK_FREE() small_query parameter */
 
 #define SMB_VFS_INTERFACE_VERSION 32
 
@@ -503,7 +504,7 @@ struct vfs_fn_pointers {
 
        int (*connect_fn)(struct vfs_handle_struct *handle, const char *service, const char *user);
        void (*disconnect_fn)(struct vfs_handle_struct *handle);
-       uint64_t (*disk_free_fn)(struct vfs_handle_struct *handle, const char *path, bool small_query, uint64_t *bsize,
+       uint64_t (*disk_free_fn)(struct vfs_handle_struct *handle, const char *path, uint64_t *bsize,
                              uint64_t *dfree, uint64_t *dsize);
        int (*get_quota_fn)(struct vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *qt);
        int (*set_quota_fn)(struct vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *qt);
@@ -903,9 +904,8 @@ int smb_vfs_call_connect(struct vfs_handle_struct *handle,
                         const char *service, const char *user);
 void smb_vfs_call_disconnect(struct vfs_handle_struct *handle);
 uint64_t smb_vfs_call_disk_free(struct vfs_handle_struct *handle,
-                               const char *path, bool small_query,
-                               uint64_t *bsize, uint64_t *dfree,
-                               uint64_t *dsize);
+                               const char *path, uint64_t *bsize,
+                               uint64_t *dfree, uint64_t *dsize);
 int smb_vfs_call_get_quota(struct vfs_handle_struct *handle,
                           enum SMB_QUOTA_TYPE qtype, unid_t id,
                           SMB_DISK_QUOTA *qt);
index ef97b49e7e7a614a6f4b79c0a922111bfa4b6d4c..0cc442e010471558610b097edd6bf7d193eec1d7 100644 (file)
 #define SMB_VFS_NEXT_DISCONNECT(handle) \
        smb_vfs_call_disconnect((handle)->next)
 
-#define SMB_VFS_DISK_FREE(conn, path, small_query, bsize, dfree ,dsize) \
-       smb_vfs_call_disk_free((conn)->vfs_handles, (path), (small_query), (bsize), (dfree), (dsize))
-#define SMB_VFS_NEXT_DISK_FREE(handle, path, small_query, bsize, dfree ,dsize)\
-       smb_vfs_call_disk_free((handle)->next, (path), (small_query), (bsize), (dfree), (dsize))
+#define SMB_VFS_DISK_FREE(conn, path, bsize, dfree ,dsize) \
+       smb_vfs_call_disk_free((conn)->vfs_handles, (path), (bsize), (dfree), (dsize))
+#define SMB_VFS_NEXT_DISK_FREE(handle, path, bsize, dfree ,dsize)\
+       smb_vfs_call_disk_free((handle)->next, (path), (bsize), (dfree), (dsize))
 
 #define SMB_VFS_GET_QUOTA(conn, qtype, id, qt) \
        smb_vfs_call_get_quota((conn)->vfs_handles, (qtype), (id), (qt))
index c52e30c299d10e3ae64acd2f63daf76a1c0cb3ed..980010bdb5b5d22c365029b8d37ead442bd32bb3 100644 (file)
@@ -30,8 +30,7 @@ static char *capencode(TALLOC_CTX *ctx, const char *from);
 static char *capdecode(TALLOC_CTX *ctx, const char *from);
 
 static uint64_t cap_disk_free(vfs_handle_struct *handle, const char *path,
-       bool small_query, uint64_t *bsize,
-       uint64_t *dfree, uint64_t *dsize)
+                             uint64_t *bsize, uint64_t *dfree, uint64_t *dsize)
 {
        char *cappath = capencode(talloc_tos(), path);
 
@@ -39,8 +38,7 @@ static uint64_t cap_disk_free(vfs_handle_struct *handle, const char *path,
                errno = ENOMEM;
                return (uint64_t)-1;
        }
-       return SMB_VFS_NEXT_DISK_FREE(handle, cappath, small_query, bsize,
-                                       dfree, dsize);
+       return SMB_VFS_NEXT_DISK_FREE(handle, cappath, bsize, dfree, dsize);
 }
 
 static DIR *cap_opendir(vfs_handle_struct *handle, const char *fname, const char *mask, uint32 attr)
index b074e2d2cb807d01cb966dc3c6fdbbec06f1a1ba..096742863c2aee4f4c148907f6982e9928248706 100644 (file)
@@ -156,8 +156,9 @@ static void cephwrap_disconnect(struct vfs_handle_struct *handle)
 
 /* Disk operations */
 
-static uint64_t cephwrap_disk_free(struct vfs_handle_struct *handle,  const char *path, bool small_query, uint64_t *bsize,
-                              uint64_t *dfree, uint64_t *dsize)
+static uint64_t cephwrap_disk_free(struct vfs_handle_struct *handle,
+                                  const char *path, uint64_t *bsize,
+                                  uint64_t *dfree, uint64_t *dsize)
 {
        struct statvfs statvfs_buf;
        int ret;
@@ -169,7 +170,7 @@ static uint64_t cephwrap_disk_free(struct vfs_handle_struct *handle,  const char
                *bsize = statvfs_buf.f_bsize;
                *dfree = statvfs_buf.f_bavail;
                *dsize = statvfs_buf.f_blocks;
-               disk_norm(small_query, bsize, dfree, dsize);
+               disk_norm(bsize, dfree, dsize);
                DEBUG(10, ("[CEPH] bsize: %llu, dfree: %llu, dsize: %llu\n",
                        llu(*bsize), llu(*dfree), llu(*dsize)));
                return *dfree;
@@ -808,8 +809,8 @@ static int strict_allocate_ftruncate(struct vfs_handle_struct *handle, files_str
 
        /* available disk space is enough or not? */
        space_avail = get_dfree_info(fsp->conn,
-                                    fsp->fsp_name->base_name, false,
-                                    &bsize,&dfree,&dsize);
+                                    fsp->fsp_name->base_name,
+                                    &bsize, &dfree, &dsize);
        /* space_avail is 1k blocks */
        if (space_avail == (uint64_t)-1 ||
                        ((uint64_t)space_to_write/1024 > space_avail) ) {
index 5a4a187e59997d4120e814244de68bd0adf0f74c..31648f69fe484fa581addd16ccb5b626a63cb1f4 100644 (file)
@@ -54,12 +54,13 @@ static void vfswrap_disconnect(vfs_handle_struct *handle)
 
 /* Disk operations */
 
-static uint64_t vfswrap_disk_free(vfs_handle_struct *handle, const char *path, bool small_query, uint64_t *bsize,
-                              uint64_t *dfree, uint64_t *dsize)
+static uint64_t vfswrap_disk_free(vfs_handle_struct *handle, const char *path,
+                                 uint64_t *bsize, uint64_t *dfree,
+                                 uint64_t *dsize)
 {
        uint64_t result;
 
-       result = sys_disk_free(handle->conn, path, small_query, bsize, dfree, dsize);
+       result = sys_disk_free(handle->conn, path, bsize, dfree, dsize);
        return result;
 }
 
@@ -1873,8 +1874,8 @@ static int strict_allocate_ftruncate(vfs_handle_struct *handle, files_struct *fs
 
        /* available disk space is enough or not? */
        space_avail = get_dfree_info(fsp->conn,
-                                    fsp->fsp_name->base_name, false,
-                                    &bsize,&dfree,&dsize);
+                                    fsp->fsp_name->base_name,
+                                    &bsize, &dfree, &dsize);
        /* space_avail is 1k blocks */
        if (space_avail == (uint64_t)-1 ||
                        ((uint64_t)space_to_write/1024 > space_avail) ) {
index c5a9c0df64782566a7e6a831b695ac5f5e5cee7f..b7a4eeeeb44794f374cd1781725eeadc0efbb5cc 100644 (file)
@@ -647,14 +647,12 @@ static void smb_full_audit_disconnect(vfs_handle_struct *handle)
 }
 
 static uint64_t smb_full_audit_disk_free(vfs_handle_struct *handle,
-                                   const char *path,
-                                   bool small_query, uint64_t *bsize, 
+                                   const char *path, uint64_t *bsize,
                                    uint64_t *dfree, uint64_t *dsize)
 {
        uint64_t result;
 
-       result = SMB_VFS_NEXT_DISK_FREE(handle, path, small_query, bsize,
-                                       dfree, dsize);
+       result = SMB_VFS_NEXT_DISK_FREE(handle, path, bsize, dfree, dsize);
 
        /* Don't have a reasonable notion of failure here */
 
index e0cc85c0c8cccbda251924689894881ef52c0b29..09c789c790c4e3386c42bc6d17029c9001616496 100644 (file)
@@ -271,9 +271,8 @@ static void vfs_gluster_disconnect(struct vfs_handle_struct *handle)
 }
 
 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)
+                                     const char *path, uint64_t *bsize_p,
+                                     uint64_t *dfree_p, uint64_t *dsize_p)
 {
        struct statvfs statvfs = { 0, };
        int ret;
index 6ead65b943af2dfe802ea7d7b0c9e9c713a01580..b71b57ffcd2fde1867500278fb1a9b976e9a78d1 100644 (file)
@@ -2030,7 +2030,7 @@ static void vfs_gpfs_disk_free_quota(struct gpfs_quotaInfo qi, time_t cur_time,
 }
 
 static uint64_t vfs_gpfs_disk_free(vfs_handle_struct *handle, const char *path,
-                                  bool small_query, uint64_t *bsize,
+                                  uint64_t *bsize,
                                   uint64_t *dfree, uint64_t *dsize)
 {
        struct security_unix_token *utok;
@@ -2042,14 +2042,14 @@ static uint64_t vfs_gpfs_disk_free(vfs_handle_struct *handle, const char *path,
        SMB_VFS_HANDLE_GET_DATA(handle, config, struct gpfs_config_data,
                                return (uint64_t)-1);
        if (!config->dfreequota) {
-               return SMB_VFS_NEXT_DISK_FREE(handle, path, small_query,
+               return SMB_VFS_NEXT_DISK_FREE(handle, path,
                                              bsize, dfree, dsize);
        }
 
        err = sys_fsusage(path, dfree, dsize);
        if (err) {
                DEBUG (0, ("Could not get fs usage, errno %d\n", errno));
-               return SMB_VFS_NEXT_DISK_FREE(handle, path, small_query,
+               return SMB_VFS_NEXT_DISK_FREE(handle, path,
                                              bsize, dfree, dsize);
        }
 
@@ -2063,7 +2063,7 @@ static uint64_t vfs_gpfs_disk_free(vfs_handle_struct *handle, const char *path,
        err = vfs_gpfs_get_quotas(path, utok->uid, utok->gid, &fset_id,
                                  &qi_user, &qi_group, &qi_fset);
        if (err) {
-               return SMB_VFS_NEXT_DISK_FREE(handle, path, small_query,
+               return SMB_VFS_NEXT_DISK_FREE(handle, path,
                                              bsize, dfree, dsize);
        }
 
@@ -2078,7 +2078,7 @@ static uint64_t vfs_gpfs_disk_free(vfs_handle_struct *handle, const char *path,
                vfs_gpfs_disk_free_quota(qi_fset, cur_time, dfree, dsize);
        }
 
-       disk_norm(small_query, bsize, dfree, dsize);
+       disk_norm(bsize, dfree, dsize);
        return *dfree;
 }
 
index 439df5ddf4d68bd000be701b9012ae01ba8f45a7..2a7a3a954b81fbbaba29e8be4402893528a7cc23 100644 (file)
@@ -1732,9 +1732,8 @@ static int shadow_copy2_get_real_filename(struct vfs_handle_struct *handle,
 }
 
 static uint64_t shadow_copy2_disk_free(vfs_handle_struct *handle,
-                                      const char *path, bool small_query,
-                                      uint64_t *bsize, uint64_t *dfree,
-                                      uint64_t *dsize)
+                                      const char *path, uint64_t *bsize,
+                                      uint64_t *dfree, uint64_t *dsize)
 {
        time_t timestamp;
        char *stripped;
@@ -1747,7 +1746,7 @@ static uint64_t shadow_copy2_disk_free(vfs_handle_struct *handle,
                return -1;
        }
        if (timestamp == 0) {
-               return SMB_VFS_NEXT_DISK_FREE(handle, path, small_query,
+               return SMB_VFS_NEXT_DISK_FREE(handle, path,
                                              bsize, dfree, dsize);
        }
 
@@ -1757,8 +1756,7 @@ static uint64_t shadow_copy2_disk_free(vfs_handle_struct *handle,
                return -1;
        }
 
-       ret = SMB_VFS_NEXT_DISK_FREE(handle, conv, small_query, bsize, dfree,
-                                    dsize);
+       ret = SMB_VFS_NEXT_DISK_FREE(handle, conv, bsize, dfree, dsize);
 
        saved_errno = errno;
        TALLOC_FREE(conv);
index b5e762887e80ae585bbc888edb1ca7c1df4ad0a9..415514aa1fd0a4613b02aa943c007b6c21b3e1ca 100644 (file)
@@ -2151,9 +2151,8 @@ static int snapper_gmt_get_real_filename(struct vfs_handle_struct *handle,
 }
 
 static uint64_t snapper_gmt_disk_free(vfs_handle_struct *handle,
-                                     const char *path, bool small_query,
-                                     uint64_t *bsize, uint64_t *dfree,
-                                     uint64_t *dsize)
+                                     const char *path, uint64_t *bsize,
+                                     uint64_t *dfree, uint64_t *dsize)
 {
        time_t timestamp;
        char *stripped;
@@ -2166,7 +2165,7 @@ static uint64_t snapper_gmt_disk_free(vfs_handle_struct *handle,
                return -1;
        }
        if (timestamp == 0) {
-               return SMB_VFS_NEXT_DISK_FREE(handle, path, small_query,
+               return SMB_VFS_NEXT_DISK_FREE(handle, path,
                                              bsize, dfree, dsize);
        }
 
@@ -2176,8 +2175,7 @@ static uint64_t snapper_gmt_disk_free(vfs_handle_struct *handle,
                return -1;
        }
 
-       ret = SMB_VFS_NEXT_DISK_FREE(handle, conv, small_query, bsize, dfree,
-                                    dsize);
+       ret = SMB_VFS_NEXT_DISK_FREE(handle, conv, bsize, dfree, dsize);
 
        saved_errno = errno;
        TALLOC_FREE(conv);
index a1e825aa09a9307afdda939ac01c4e0a17c5a6f9..04552ec9d0cfadf9d69a1220288942332b38ec3d 100644 (file)
@@ -157,8 +157,7 @@ static void smb_time_audit_disconnect(vfs_handle_struct *handle)
 }
 
 static uint64_t smb_time_audit_disk_free(vfs_handle_struct *handle,
-                                        const char *path,
-                                        bool small_query, uint64_t *bsize,
+                                        const char *path, uint64_t *bsize,
                                         uint64_t *dfree, uint64_t *dsize)
 {
        uint64_t result;
@@ -166,8 +165,7 @@ static uint64_t smb_time_audit_disk_free(vfs_handle_struct *handle,
        double timediff;
 
        clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_DISK_FREE(handle, path, small_query, bsize,
-                                       dfree, dsize);
+       result = SMB_VFS_NEXT_DISK_FREE(handle, path, bsize, dfree, dsize);
        clock_gettime_mono(&ts2);
        timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
 
index d02c1bd66a6cc006097466c6323a1715c1cdd80a..bcefea5b274648ddd29bc45a9fd8a270eff05cf7 100644 (file)
  Normalise for DOS usage.
 ****************************************************************************/
 
-void disk_norm(bool small_query, uint64_t *bsize,uint64_t *dfree,uint64_t *dsize)
+void disk_norm(uint64_t *bsize, uint64_t *dfree, uint64_t *dsize)
 {
        /* check if the disk is beyond the max disk size */
        uint64_t maxdisksize = lp_max_disk_size();
        if (maxdisksize) {
                /* convert to blocks - and don't overflow */
                maxdisksize = ((maxdisksize*1024)/(*bsize))*1024;
-               if (*dsize > maxdisksize) *dsize = maxdisksize;
-               if (*dfree > maxdisksize) *dfree = maxdisksize-1; 
+               if (*dsize > maxdisksize) {
+                       *dsize = maxdisksize;
+               }
+               if (*dfree > maxdisksize) {
+                       *dfree = maxdisksize - 1;
+               }
                /* the -1 should stop applications getting div by 0
                   errors */
-       }  
-
-       if(small_query) {       
-               while (*dfree > WORDMAX || *dsize > WORDMAX || *bsize < 512) {
-                       *dfree /= 2;
-                       *dsize /= 2;
-                       *bsize *= 2;
-                       /*
-                        * Force max to fit in 16 bit fields.
-                        */
-                       if (*bsize > (WORDMAX*512)) {
-                               *bsize = (WORDMAX*512);
-                               if (*dsize > WORDMAX)
-                                       *dsize = WORDMAX;
-                               if (*dfree >  WORDMAX)
-                                       *dfree = WORDMAX;
-                               break;
-                       }
-               }
        }
 }
 
@@ -64,8 +49,8 @@ void disk_norm(bool small_query, uint64_t *bsize,uint64_t *dfree,uint64_t *dsize
  Return number of 1K blocks available on a path and total number.
 ****************************************************************************/
 
-uint64_t sys_disk_free(connection_struct *conn, const char *path, bool small_query, 
-                              uint64_t *bsize,uint64_t *dfree,uint64_t *dsize)
+uint64_t sys_disk_free(connection_struct *conn, const char *path,
+                      uint64_t *bsize, uint64_t *dfree, uint64_t *dsize)
 {
        uint64_t dfree_retval;
        uint64_t dfree_q = 0;
@@ -161,7 +146,7 @@ uint64_t sys_disk_free(connection_struct *conn, const char *path, bool small_que
                *dfree = MAX(1,*dfree);
        }
 
-       disk_norm(small_query,bsize,dfree,dsize);
+       disk_norm(bsize, dfree, dsize);
 
        if ((*bsize) < 1024) {
                dfree_retval = (*dfree)/(1024/(*bsize));
@@ -178,7 +163,6 @@ uint64_t sys_disk_free(connection_struct *conn, const char *path, bool small_que
 
 uint64_t get_dfree_info(connection_struct *conn,
                        const char *path,
-                       bool small_query,
                        uint64_t *bsize,
                        uint64_t *dfree,
                        uint64_t *dsize)
@@ -188,7 +172,7 @@ uint64_t get_dfree_info(connection_struct *conn,
        uint64_t dfree_ret;
 
        if (!dfree_cache_time) {
-               return SMB_VFS_DISK_FREE(conn,path,small_query,bsize,dfree,dsize);
+               return SMB_VFS_DISK_FREE(conn, path, bsize, dfree, dsize);
        }
 
        if (dfc && (conn->lastused - dfc->last_dfree_time < dfree_cache_time)) {
@@ -199,7 +183,7 @@ uint64_t get_dfree_info(connection_struct *conn,
                return dfc->dfree_ret;
        }
 
-       dfree_ret = SMB_VFS_DISK_FREE(conn,path,small_query,bsize,dfree,dsize);
+       dfree_ret = SMB_VFS_DISK_FREE(conn, path, bsize, dfree, dsize);
 
        if (dfree_ret == (uint64_t)-1) {
                /* Don't cache bad data. */
index 26a199c0a6267c2013850ad1e20ca6b016d1902e..f01bbbdfedc9c1c4208f16b76e57603dc20c92cd 100644 (file)
@@ -168,12 +168,11 @@ bool connections_snum_used(struct smbd_server_connection *unused, int snum);
 
 /* The following definitions come from smbd/dfree.c  */
 
-void disk_norm(bool small_query, uint64_t *bsize,uint64_t *dfree,uint64_t *dsize);
-uint64_t sys_disk_free(connection_struct *conn, const char *path, bool small_query,
+void disk_norm(uint64_t *bsize,uint64_t *dfree,uint64_t *dsize);
+uint64_t sys_disk_free(connection_struct *conn, const char *path,
                               uint64_t *bsize,uint64_t *dfree,uint64_t *dsize);
 uint64_t get_dfree_info(connection_struct *conn,
                        const char *path,
-                       bool small_query,
                        uint64_t *bsize,
                        uint64_t *dfree,
                        uint64_t *dsize);
index b6199bbef2cf54875c6df81cfdc537ee6c811acf..5761d4278bb5f7b9eb1e90868b8fea5f4d911dd6 100644 (file)
@@ -1460,7 +1460,7 @@ void reply_dskattr(struct smb_request *req)
        uint64_t dfree,dsize,bsize;
        START_PROFILE(SMBdskattr);
 
-       ret = get_dfree_info(conn, ".", false, &bsize, &dfree, &dsize);
+       ret = get_dfree_info(conn, ".", &bsize, &dfree, &dsize);
        if (ret == (uint64_t)-1) {
                reply_nterror(req, map_nt_error_from_unix(errno));
                END_PROFILE(SMBdskattr);
index 16498b36e56978bea4edb1ddb54cc31bb1ad70e7..c70ca2c24af6733a38fc38fdb1e01054e31d5a2c 100644 (file)
@@ -3214,6 +3214,7 @@ NTSTATUS smbd_do_qfsinfo(struct smbXsrv_connection *xconn,
        struct smb_filename smb_fname;
        SMB_STRUCT_STAT st;
        NTSTATUS status = NT_STATUS_OK;
+       uint64_t df_ret;
 
        if (fname == NULL || fname->base_name == NULL) {
                filename = ".";
@@ -3263,7 +3264,9 @@ NTSTATUS smbd_do_qfsinfo(struct smbXsrv_connection *xconn,
                {
                        uint64_t dfree,dsize,bsize,block_size,sectors_per_unit,bytes_per_sector;
                        data_len = 18;
-                       if (get_dfree_info(conn,filename,False,&bsize,&dfree,&dsize) == (uint64_t)-1) {
+                       df_ret = get_dfree_info(conn, filename, &bsize, &dfree,
+                                               &dsize);
+                       if (df_ret == (uint64_t)-1) {
                                return map_nt_error_from_unix(errno);
                        }
 
@@ -3413,7 +3416,9 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)st.st_ex_dev, (u
                {
                        uint64_t dfree,dsize,bsize,block_size,sectors_per_unit,bytes_per_sector;
                        data_len = 24;
-                       if (get_dfree_info(conn,filename,False,&bsize,&dfree,&dsize) == (uint64_t)-1) {
+                       df_ret = get_dfree_info(conn, filename, &bsize, &dfree,
+                                               &dsize);
+                       if (df_ret == (uint64_t)-1) {
                                return map_nt_error_from_unix(errno);
                        }
                        block_size = lp_block_size(snum);
@@ -3446,7 +3451,9 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)bsize, (unsigned
                {
                        uint64_t dfree,dsize,bsize,block_size,sectors_per_unit,bytes_per_sector;
                        data_len = 32;
-                       if (get_dfree_info(conn,filename,False,&bsize,&dfree,&dsize) == (uint64_t)-1) {
+                       df_ret = get_dfree_info(conn, filename, &bsize, &dfree,
+                                               &dsize);
+                       if (df_ret == (uint64_t)-1) {
                                return map_nt_error_from_unix(errno);
                        }
                        block_size = lp_block_size(snum);
index d10e0d67e905f7bd4a611e1ba8f04594a7b41e10..381bb8d2af1fbb679a3ded72c56aaa82d7d6b99f 100644 (file)
@@ -592,7 +592,7 @@ int vfs_allocate_file_space(files_struct *fsp, uint64_t len)
 
        len -= fsp->fsp_name->st.st_ex_size;
        len /= 1024; /* Len is now number of 1k blocks needed. */
-       space_avail = get_dfree_info(conn, fsp->fsp_name->base_name, false,
+       space_avail = get_dfree_info(conn, fsp->fsp_name->base_name,
                                     &bsize, &dfree, &dsize);
        if (space_avail == (uint64_t)-1) {
                return -1;
@@ -1392,13 +1392,11 @@ void smb_vfs_call_disconnect(struct vfs_handle_struct *handle)
 }
 
 uint64_t smb_vfs_call_disk_free(struct vfs_handle_struct *handle,
-                               const char *path, bool small_query,
-                               uint64_t *bsize, uint64_t *dfree,
-                               uint64_t *dsize)
+                               const char *path, uint64_t *bsize,
+                               uint64_t *dfree, uint64_t *dsize)
 {
        VFS_FIND(disk_free);
-       return handle->fns->disk_free_fn(handle, path, small_query, bsize, 
-                                        dfree, dsize);
+       return handle->fns->disk_free_fn(handle, path, bsize, dfree, dsize);
 }
 
 int smb_vfs_call_get_quota(struct vfs_handle_struct *handle,
index 1ccdfe33f9de0978133632fbd0efd4f31d7e8871..26e40c529362690d3b37b0e4309007aa5cb1fa69 100644 (file)
@@ -117,7 +117,7 @@ static NTSTATUS cmd_disk_free(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int ar
                return NT_STATUS_OK;
        }
 
-       diskfree = SMB_VFS_DISK_FREE(vfs->conn, argv[1], False, &bsize, &dfree, &dsize);
+       diskfree = SMB_VFS_DISK_FREE(vfs->conn, argv[1], &bsize, &dfree, &dsize);
        printf("disk_free: %lu, bsize = %lu, dfree = %lu, dsize = %lu\n",
                        (unsigned long)diskfree,
                        (unsigned long)bsize,