From 84dcdf228fddb68b58ed0fada6d92ec0a070df85 Mon Sep 17 00:00:00 2001 From: Sears Russell Date: Thu, 5 Oct 2006 00:46:18 +0000 Subject: [PATCH] Documentation Fix --- lladd/bufferManager.h | 1 + lladd/bufferPool.h | 4 +++- lladd/common.h | 6 +++--- lladd/constants.h | 3 ++- lladd/consumer.h | 4 +++- src/lladd/page.h | 4 ++++ src/lladd/pageFile.c | 12 ++++++------ 7 files changed, 22 insertions(+), 12 deletions(-) diff --git a/lladd/bufferManager.h b/lladd/bufferManager.h index c675880..ad96c5a 100644 --- a/lladd/bufferManager.h +++ b/lladd/bufferManager.h @@ -97,6 +97,7 @@ typedef struct Page_s Page_s; typedef struct Page_s Page; /** + * @param xid The transaction that is pinning the page (used by page-level locking implementations.) * @param pageid ID of the page you want to load * @return fully formed Page type */ diff --git a/lladd/bufferPool.h b/lladd/bufferPool.h index a8af16e..21823e4 100644 --- a/lladd/bufferPool.h +++ b/lladd/bufferPool.h @@ -41,7 +41,9 @@ terms specified in this license. ---*/ /** - * @file Functions to manage the in-memory pool of free page buffers. + * @file + * + * Functions to manage the in-memory pool of free page buffers. * $Id$ */ diff --git a/lladd/common.h b/lladd/common.h index 35b576a..e3b5a99 100644 --- a/lladd/common.h +++ b/lladd/common.h @@ -47,10 +47,10 @@ terms specified in this license. * http://sources.redhat.com/autobook/ * * The idea behind this file is twofold. First, we want to keep as - * much of the #ifdef portability nonsense in here as possible. - * Second, we allow users to #include headers that in turn #include + * much of the \#ifdef portability nonsense in here as possible. + * Second, we allow users to \#include headers that in turn \#include * common.h. If they do so, then their code should continue to 'do - * the right thing' and build, even though they do not #include the + * the right thing' and build, even though they do not \#include the * config.h file that all of the LLADD stuff uses. * * @todo Need to make sure every .c file actually includes this thing, and diff --git a/lladd/constants.h b/lladd/constants.h index 1eb878f..d425bb7 100644 --- a/lladd/constants.h +++ b/lladd/constants.h @@ -44,7 +44,7 @@ terms specified in this license. * * defines various constants * - * @todo Sometime, LLADD's #includes need to be cleaned up. In + * @todo Sometime, LLADD's \#includes need to be cleaned up. In * particular, we should make sure everything directly or indirectly * includes this file, common.h, and constants.h * @@ -222,5 +222,6 @@ extern const short SLOT_TYPE_LENGTHS[]; #define TALLOC_REGION_SIZE 100 // Pages +#define FILE_PERM (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) #endif diff --git a/lladd/consumer.h b/lladd/consumer.h index ac132d5..baa0238 100644 --- a/lladd/consumer.h +++ b/lladd/consumer.h @@ -28,7 +28,9 @@ void Tconsumer_close(int xid, lladdConsumer_t * it); @param xid Transaction id @param it The consumer @param key Can be null if there is no key. - @param value Can be null if there is no value, but both can't be null. (Or can they???) + @param keySize Length of key in bytes + @param val Can be null if there is no value, but both can't be null. (Or can they???) + @param valSize Length of value in bytes. @return Error. Blocks when full. diff --git a/src/lladd/page.h b/src/lladd/page.h index 7b665dd..da3adef 100644 --- a/src/lladd/page.h +++ b/src/lladd/page.h @@ -204,6 +204,9 @@ void pageDeInit(); * does not update dirtyPages. Similarly, if the page is already * dirty, there is no need to udpate dirtyPages. * + * @param xid The transaction that is writing to the page, or -1 if + * outside of a transaction. + * * @param page You must have a writelock on page before calling this * function. * @@ -243,6 +246,7 @@ void writeRecord(int xid, Page * page, lsn_t lsn, recordid rid, const void *dat) void writeRecordUnlocked(int xid, Page * page, lsn_t lsn, recordid rid, const void *dat); /** * @param xid transaction ID + * @param page a pointer to the pinned page that contains the record. * @param rid the record to be written * @param dat buffer for data * @return 0 on success, lladd error code on failure diff --git a/src/lladd/pageFile.c b/src/lladd/pageFile.c index dd2b6f2..298b437 100644 --- a/src/lladd/pageFile.c +++ b/src/lladd/pageFile.c @@ -13,7 +13,7 @@ #include #include -/** For O_DIRECT. It's unclear that this is the correct thing to #define, but it works under linux. */ +/** For O_DIRECT. It's unclear that this is the correct thing to \#define, but it works under linux. */ #define __USE_GNU #include @@ -122,17 +122,15 @@ void pageWrite(Page * ret) { void openPageFile() { DEBUG("Opening storefile.\n"); - if(pageFile_isDurable) { #ifdef PAGE_FILE_O_DIRECT - stable = open (STORE_FILE, O_CREAT | O_RDWR | O_DIRECT, S_IRWXU | S_IRWXG | S_IRWXO); + stable = open (STORE_FILE, O_CREAT | O_RDWR | O_DIRECT, FILE_PERM); //S_IRWXU | S_IRWXG | S_IRWXO); #else - stable = open (STORE_FILE, O_CREAT | O_RDWR, S_IRWXU | S_IRWXG | S_IRWXO); + stable = open (STORE_FILE, O_CREAT | O_RDWR, FILE_PERM);//S_IRWXU | S_IRWXG | S_IRWXO); #endif - } else { + if(!pageFile_isDurable) { fprintf(stderr, "\n**********\n"); fprintf (stderr, "pageFile.c: pageFile_isDurable==0; the page file will not force writes to disk.\n"); fprintf (stderr, " Transactions will not be durable if the system crashes.\n**********\n"); - stable = open (STORE_FILE, O_CREAT | O_RDWR , S_IRWXU | S_IRWXG | S_IRWXO); } if(stable == -1) { perror("couldn't open storefile"); @@ -145,6 +143,7 @@ void openPageFile() { } void forcePageFile() { + if(pageFile_isDurable) { #ifndef PAGE_FILE_O_DIRECT #ifdef HAVE_FDATASYNC fdatasync(stable); @@ -152,6 +151,7 @@ void forcePageFile() { fsync(stable); #endif // HAVE_FDATASYNC #endif // PAGE_FILE_O_DIRECT + } } void closePageFile() {