summaryrefslogtreecommitdiff
path: root/source3/include/smb_macros.h
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-03-03 03:43:57 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:55:52 -0500
commit02fdabc2a7f0199bc5f42afb2c744f3c740122e4 (patch)
treeb3d1aa15b6da888095e2dcecd4976165babb7957 /source3/include/smb_macros.h
parent8dddd763d876cc7a340ffb7813f87187d77b84f2 (diff)
downloadsamba-02fdabc2a7f0199bc5f42afb2c744f3c740122e4.tar.gz
samba-02fdabc2a7f0199bc5f42afb2c744f3c740122e4.tar.bz2
samba-02fdabc2a7f0199bc5f42afb2c744f3c740122e4.zip
r5636: Re-add the allocation size - parameterized by share as
"allocation roundup size", by default set as 1Mb. From advice by BlueArc about Windows client behaviour. VC++ people can set this to zero to turn it off. Jeremy. (This used to be commit 833ca101772bfab65dbd79eb64f63464177f144e)
Diffstat (limited to 'source3/include/smb_macros.h')
-rw-r--r--source3/include/smb_macros.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h
index b1ac617f5c..4fa9ffa5ac 100644
--- a/source3/include/smb_macros.h
+++ b/source3/include/smb_macros.h
@@ -178,6 +178,8 @@
/* this is how errors are generated */
#define UNIXERROR(defclass,deferror) unix_error_packet(outbuf,defclass,deferror,__LINE__,__FILE__)
+#define SMB_ROUNDUP(x,r) ( ((x)%(r)) ? ( (((x)+(r))/(r))*(r) ) : (x))
+
/* Extra macros added by Ying Chen at IBM - speed increase by inlining. */
#define smb_buf(buf) (((char *)(buf)) + smb_size + CVAL(buf,smb_wct)*2)
#define smb_buflen(buf) (SVAL(buf,smb_vwv0 + (int)CVAL(buf, smb_wct)*2))