summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorTim Prouty <tprouty@samba.org>2009-01-26 15:39:40 -0800
committerTim Prouty <tprouty@samba.org>2009-01-29 15:29:33 -0800
commitb8f7cdbd79918bba0fea181f97fff5ab0c79192d (patch)
tree6716b36bb6421e0cff45dc224a1705bb396e8dd2 /source3/lib
parentaeb23872e25fb720140a10ce01a4211d228b6555 (diff)
downloadsamba-b8f7cdbd79918bba0fea181f97fff5ab0c79192d.tar.gz
samba-b8f7cdbd79918bba0fea181f97fff5ab0c79192d.tar.bz2
samba-b8f7cdbd79918bba0fea181f97fff5ab0c79192d.zip
s3: Add a new SMB_VFS_GET_ALLOC_SIZE vfs operation
This allows module implementors to customize what allocation size is returned to the client.
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/util.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 2485d1def5..195065a1e0 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -542,6 +542,15 @@ bool directory_exist_stat(char *dname,SMB_STRUCT_STAT *st)
}
/*******************************************************************
+ Returns the size in bytes of the named given the stat struct.
+********************************************************************/
+
+uint64_t get_file_size_stat(const SMB_STRUCT_STAT *sbuf)
+{
+ return sbuf->st_size;
+}
+
+/*******************************************************************
Returns the size in bytes of the named file.
********************************************************************/
@@ -551,7 +560,7 @@ SMB_OFF_T get_file_size(char *file_name)
buf.st_size = 0;
if(sys_stat(file_name,&buf) != 0)
return (SMB_OFF_T)-1;
- return(buf.st_size);
+ return get_file_size_stat(&buf);
}
/*******************************************************************