From 22afba62c9add7efa0de76defd8abb9b352473e2 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 12 Nov 2001 01:00:54 +0000 Subject: Fixed allocation bug in database prog. Some format fixes. Jeremy. (This used to be commit 9ff6b0c20cc88ef0bcd62a596fcb96f898b5b29d) --- source3/include/local.h | 3 +++ source3/include/smb_macros.h | 1 + 2 files changed, 4 insertions(+) (limited to 'source3/include') diff --git a/source3/include/local.h b/source3/include/local.h index 53ef564610..84f5a3d1df 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -189,4 +189,7 @@ /* the maximum age in seconds of a password. Should be a lp_ parameter */ #define MAX_PASSWORD_AGE (21*24*60*60) +/* Allocation roundup. */ +#define SMB_ROUNDUP_ALLOCATION_SIZE 0x100000 + #endif diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h index 42d66b676a..44b8c26da9 100644 --- a/source3/include/smb_macros.h +++ b/source3/include/smb_macros.h @@ -159,6 +159,7 @@ #define UNIXERROR(defclass,deferror) unix_error_packet(outbuf,defclass,deferror,__LINE__,__FILE__) #define SMB_ROUNDUP(x,g) (((x)+((g)-1))&~((g)-1)) +#define SMB_ROUNDUP_ALLOCATION(s) (SMB_ROUNDUP((SMB_OFF_T)((s)+1), ((SMB_OFF_T)SMB_ROUNDUP_ALLOCATION_SIZE))) /* Extra macros added by Ying Chen at IBM - speed increase by inlining. */ #define smb_buf(buf) (buf + smb_size + CVAL(buf,smb_wct)*2) -- cgit