From 79c1cdb83fe25d753ce3e38b9554d8604a3cb8df Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Tue, 20 Feb 2007 03:13:41 +0000 Subject: [PATCH] windows-afs3-directory-format-20070219 correct the documentation of the directory format in the headers --- src/WINNT/afsd/cm_dir.h | 15 ++++++++++----- src/WINNT/afsd/cm_dnlc.h | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/WINNT/afsd/cm_dir.h b/src/WINNT/afsd/cm_dir.h index 4348d71b3..d53a14a02 100644 --- a/src/WINNT/afsd/cm_dir.h +++ b/src/WINNT/afsd/cm_dir.h @@ -10,8 +10,13 @@ #ifndef __CM_DIR_ENV__ #define __CM_DIR_ENV__ 1 +/* These data structures are derived from src/dir/dir.h and should not + * be changed as they describe AFS3 wire protocol. + * + */ + #define CM_DIR_PAGESIZE 2048 /* bytes per page */ -#define CM_DIR_NHASHENT 256 /* entries in the hash tbl == NHSIZE */ +#define CM_DIR_NHASHENT 128 /* entries in the dir hash tbl */ #define CM_DIR_MAXPAGES 128 /* max pages in a dir */ #define CM_DIR_BIGMAXPAGES 1023 /* new big max pages */ #define CM_DIR_EPP 64 /* dir entries per page */ @@ -35,10 +40,10 @@ typedef struct cm_dirFid { typedef struct cm_pageHeader { /* A page header entry. */ unsigned short pgcount; /* number of pages, or 0 if old-style */ - unsigned short tag; /* 1234 in network byte order */ + unsigned short tag; /* '1234' in network byte order */ char freeCount; /* unused, info in dirHeader structure */ char freeBitmap[CM_DIR_EPP/8]; - char padding[32-(5+CM_DIR_EPP/8)]; /* pad to one 32-byte entry */ + char padding[CM_DIR_CHUNKSIZE-(5+CM_DIR_EPP/8)];/* pad to one 32-byte entry */ } cm_pageHeader_t; /* a total of 13 32-byte entries, 1 for the header that in all pages, and @@ -56,11 +61,11 @@ typedef struct cm_dirHeader { */ typedef struct cm_dirEntry { /* A directory entry */ - char flag; + char flag; /* this must be FFIRST (1) */ char length; /* currently unused */ unsigned short next; cm_dirFid_t fid; - char name[16]; + char name[1]; /* the real length is determined with strlen() */ } cm_dirEntry_t; #ifdef UNUSED diff --git a/src/WINNT/afsd/cm_dnlc.h b/src/WINNT/afsd/cm_dnlc.h index eb896c0b2..21428cd60 100644 --- a/src/WINNT/afsd/cm_dnlc.h +++ b/src/WINNT/afsd/cm_dnlc.h @@ -11,7 +11,7 @@ #define CM_AFSNCNAMESIZE 40 /* multiple of 8 (for 64-bit) */ #define NCSIZE 512 -#define NHSIZE 256 /* must be power of 2 == CM_DIR_NHASHENT */ +#define NHSIZE 256 /* must be power of 2 */ #define CM_DNLC_MAGIC ('D' | 'N' <<8 | 'L'<<16 | 'C'<<24) -- 2.39.5