The thing is, snprintf always NULL-terminates its output string, no
matter whether the input was NULL-terminated or not.
However, I looked at the snprintf man page again and found this
description for %s :
> If no l modifier is present: The const char * argument is expected to be
> a pointer to
need
> more NIH syndrome.
It would be cool to have support another backend, I guess.
However... It seems to me that once you make the decision to use
ZooKeeper and Java, Walrus or Hadoop is probably a more practical
choice for the upper layers.
I've never deployed either though, so I could be wr
Random thoughts:
Maybe something like a freely available dictionary would work, with
the key as the word, and the value as the definition.
You could grab git commits from the Linux kernel and make the key the
SHA, and the value the patch.
There's a lot of text in Project Gutenberg. I guess you'd
Speaking of CLD replication, I read a really good description of paxos recently:
http://the-paper-trail.org/blog/?p=173
It helps if you read the entries on two-phase locking and three-phase
locking first:
http://the-paper-trail.org/blog/?p=90
http://the-paper-trail.org/blog/?p=103
This is about
On Tue, Feb 9, 2010 at 5:33 PM, Jeff Garzik wrote:
> On 02/09/2010 07:21 PM, Pete Zaitcev wrote:
>>
>> On Tue, 09 Feb 2010 18:21:02 -0500
>> Jeff Garzik wrote:
>>
>>> So, the programs themselves have it right -- debug/verbose is an integer
>>> not a bool. The internal libraries get that wrong so
Signed-off-by: Colin McCabe
---
lib/Makefile.am |4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/Makefile.am b/lib/Makefile.am
index d3f1a5d..75b7233 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -10,10 +10,10 @@ INCLUDES= -I$(top_srcdir
Great news!
And thanks for your help in splitting what admittedly was a monster
patch into something more manageable. :)
Colin
On Fri, Feb 5, 2010 at 1:48 AM, Jeff Garzik wrote:
> On 01/15/2010 12:49 PM, Colin McCabe wrote:
>>
>> This patch moves CLD from using manual data s
Add support for processing XDR files to lib/Makefile.am
Signed-off-by: Colin McCabe
---
lib/Makefile.am |9 +
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/lib/Makefile.am b/lib/Makefile.am
index e6509e4..7d5f8c2 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
Signed-off-by: Colin McCabe
---
.gitignore |4
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/.gitignore b/.gitignore
index 79a4cd3..805fa22 100644
--- a/.gitignore
+++ b/.gitignore
@@ -32,5 +32,9 @@ cld-config.h*
cscope.*
ncscope.*
+# XDR files
+*_rpc.h
+*_rpc_xdr.c
Create the cldc_call_opts_get_data API. This allows users of the async CLD api
to access the GET buffer returned from CLD without playing with parts of the
cld_call_opts marked 'private, lib-owned.'
Signed-off-by: Colin McCabe
---
include/cldc.h |2 ++
lib/cldc.c
On Wed, Feb 3, 2010 at 2:27 PM, Jeff Garzik wrote:
> On 02/03/2010 08:45 AM, Colin McCabe wrote:
>>
>> When we create a static buffer for an inode name, and treat it like a
>> null-terminated string, it needs to be of length CLD_INODE_NAME_MAX + 1 so
>> that it c
not to do it often.
Signed-off-by: Colin McCabe
---
include/cld_msg.h |7 ---
include/cldc.h|4 ++--
lib/cldc.c| 24 +---
server/msg.c |7 +++
server/session.c | 12
5 files changed, 38 insertions(+), 16 deletions
This isn't strictly
necessary if all other checks are working perfectly, but it seems prudent.
Signed-off-by: Colin McCabe
---
include/cldc.h |2 +-
lib/cldc.c |4 ++--
tools/cldcli.c |1 +
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/include/cldc.h b/incl
On Tue, Feb 2, 2010 at 10:35 PM, Jeff Garzik wrote:
> On 01/29/2010 08:01 PM, Colin McCabe wrote:
>>
>> That seems reasonable. All of those functions could be looked at as
>> "common."
>>
>> The intention was to group together a bunch of function
not to do it often.
Signed-off-by: Colin McCabe
---
include/cld_msg.h |7 ---
include/cldc.h|4 ++--
lib/cldc.c| 24 +---
server/msg.c |7 +++
server/session.c | 12
tools/cldcli.c|2 +-
6 files changed, 39
ly, but it seems prudent.
Signed-off-by: Colin McCabe
---
include/cldc.h |2 +-
lib/cldc.c |4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/cldc.h b/include/cldc.h
index f1db7d2..0d72669 100644
--- a/include/cldc.h
+++ b/include/cldc.h
@@ -41,7 +41,7
That seems reasonable. All of those functions could be looked at as "common."
The intention was to group together a bunch of functions that were
useful for packet formatting. Although the bulk of the formatting is
done by XDR, there are some things that XDR doesn't do, like
generating and checking
On Tue, Jan 26, 2010 at 2:11 PM, Jeff Garzik wrote:
> Actually I poked at it this weekend, and was about to finish up. So hold
> off for another day, if you would.
>
> The answer is, there are two different build environments to consider for
> headers: the in-tree build environment, and the inst
possible.
I really don't want to put cld_msg_rpc_xdr.c in include/. But so far I
can't figure out how to have the header there, without the .c file...
Colin
On Wed, Jan 20, 2010 at 6:38 PM, Colin McCabe wrote:
> On Wed, Jan 20, 2010 at 5:38 PM, Jeff Garzik wrote:
>> On 01/1
On Wed, Jan 20, 2010 at 5:38 PM, Jeff Garzik wrote:
> On 01/15/2010 12:49 PM, Colin McCabe wrote:
>>
>> This patch moves CLD from using manual data serialization to using XDR
>> (via
>> rpcgen). Both the packet header and the message body are now serialized
>> an
On Sat, Jan 16, 2010 at 3:21 PM, Pete Zaitcev wrote:
> On Sat, 16 Jan 2010 13:38:26 -0800
> Colin McCabe wrote:
>
>> Shouldn't ncld_unlock and ncld_close return an error code rather than
>> just eating all errors? The server certainly does sometimes send back
&g
ions are
nonblocking. You have to have a state machine in your program anyway--
you might as well keep it simple and all in one place. What do you
guys think?
regards,
Colin
On Fri, Jan 15, 2010 at 10:53 PM, Pete Zaitcev wrote:
> On Fri, 15 Jan 2010 18:40:44 -0800
> Colin McCabe
On Fri, Jan 15, 2010 at 11:07 PM, Pete Zaitcev wrote:
> Although we share the libtimer.a among the parts that can link it
> statically, it turned out impossible to use from inside of libcldc
> as it was. So, this patch makes it available to library code by
> linking it in the same way we use libco
Hi all,
I saw Pete's post about "the evils of event-driven programming in CLD clients."
I tend to agree with him that the current API can be frustrating to think about.
I had a few thoughts about what might be a better API:
1) when starting the cld session, the user code could register a
"vtable
On Wed, Jan 13, 2010 at 4:10 PM, Jeff Garzik wrote:
> OK, final review. Please fix these problems and resend (some of these
> repeated from other emails; putting here to consolidate):
>
> * needs to build patch builds and runs against a fresh git repo clone +
> ./autogen.sh + ./configure + make
ong isn't big enough (because we're
on 32 bit), and then issues a warning.
And then it promotes to the gcc-specific long long type.
Colin
On Tue, Jan 12, 2010 at 11:24 AM, Jeff Garzik wrote:
> On 01/12/2010 01:25 PM, Colin McCabe wrote:
>>
>> util.c: In function ‘objid_in
issues a warning for some reason.
I guess gcc's C99 support is not perfect.
Colin
On Tue, Jan 12, 2010 at 6:29 AM, Jeff Garzik wrote:
> On 01/10/2010 08:10 AM, Colin McCabe wrote:
>>
>> All integer constants are squashed into ints (i.e. 32-bit) unless you
>> specify
>>
Hmm...I don't think chunkd needs a patch... at least at change a129ef0d5c.
It doesn't touch carg->u.get.buf or carg->u.get.size, since it never
calls cldc_get.
Colin
On Mon, Jan 11, 2010 at 5:26 AM, Jeff Garzik wrote:
> On 01/10/2010 10:22 AM, Colin McCabe wrote:
>>
Signed-off-by: Colin McCabe
---
server/cldu.c | 21 +
1 files changed, 9 insertions(+), 12 deletions(-)
diff --git a/server/cldu.c b/server/cldu.c
index d02eafd..dbad4db 100644
--- a/server/cldu.c
+++ b/server/cldu.c
@@ -545,8 +545,8 @@ static int cldu_put_cb(struct
All integer constants are squashed into ints (i.e. 32-bit) unless you specify
otherwise.
Signed-off-by: Colin McCabe
---
server/util.c |2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/server/util.c b/server/util.c
index 3c15123..63a3acb 100644
--- a/server/util.c
+++ b
Signed-off-by: Colin McCabe
---
.gitignore |4
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/.gitignore b/.gitignore
index 067bf1a..79a4cd3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -28,5 +28,9 @@ cldbadm
cld*.tar.gz
cld-config.h*
+# cscope files
+cscope
too few arguments, or arguments of the wrong types.
For non-GCC compilers, don't do anything (yet).
Signed-off-by: Colin McCabe
---
include/hail_log.h |9 -
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/include/hail_log.h b/include/hail_log.h
index d6794b4..88
compilers, don't do anything (yet).
Signed-off-by: Colin McCabe
---
include/hail_log.h |9 -
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/include/hail_log.h b/include/hail_log.h
index d6794b4..88074a3 100644
--- a/include/hail_log.h
+++ b/include/hail_log.h
@@
Signed-off-by: Colin McCabe
---
.gitignore |4
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/.gitignore b/.gitignore
index 067bf1a..79a4cd3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -28,5 +28,9 @@ cldbadm
cld*.tar.gz
cld-config.h*
+# cscope files
+cscope
duplicate email. I forgot the signoff originally.
Signed-off-by: Colin McCabe
---
include/hail_log.h |3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/include/hail_log.h b/include/hail_log.h
index d6794b4..ca26f22 100644
--- a/include/hail_log.h
+++ b/include/hail_log.h
GCC has a nifty ability to typecheck varargs functions that follow the printf
conventions. This change uses that in HAIL_LOG. If you build with -Wall, gcc
can now give warnings about HAIL_LOG invocations where there are too many or
too few arguments, or arguments of the wrong types.
---
include/ha
Signed-off-by: Colin McCabe
---
.gitignore |4
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/.gitignore b/.gitignore
index 067bf1a..79a4cd3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -28,5 +28,9 @@ cldbadm
cld*.tar.gz
cld-config.h*
+# cscope files
+cscope
I almost forgot-- Makefile.am needs to change.
Signed-off-by: Colin McCabe
---
include/Makefile.am |4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/Makefile.am b/include/Makefile.am
index f7539dd..4ea11c4 100644
--- a/include/Makefile.am
+++ b/include
Signed-off-by: Colin McCabe
---
server/cldu.c | 14 --
server/tabled.h |1 +
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/server/cldu.c b/server/cldu.c
index e66ec02..e256e6a 100644
--- a/server/cldu.c
+++ b/server/cldu.c
@@ -918,6 +918,11 @@ int cld_begin
Signed-off-by: Colin McCabe
---
server/cldu.c | 12 ++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/server/cldu.c b/server/cldu.c
index 0cf687f..da5f55f 100644
--- a/server/cldu.c
+++ b/server/cldu.c
@@ -615,8 +615,12 @@ int cld_begin(const char *thishost, const
Signed-off-by: Colin McCabe
---
include/cldc.h |7 ++---
lib/cldc-dns.c | 80 +---
tools/cldcli.c | 12 +---
3 files changed, 41 insertions(+), 58 deletions(-)
diff --git a/include/cldc.h b/include/cldc.h
index 1382a23..5419cc8
Signed-off-by: Colin McCabe
---
lib/cldc-dns.c | 10 +-
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/lib/cldc-dns.c b/lib/cldc-dns.c
index d58a8ba..1bf6355 100644
--- a/lib/cldc-dns.c
+++ b/lib/cldc-dns.c
@@ -46,7 +46,7 @@ int cldc_saveaddr(struct cldc_host *hp
Signed-off-by: Colin McCabe
---
server/cld.h |4 +-
server/cldb.c|7 ++--
server/msg.c | 50 +-
server/server.c | 87 -
server/session.c | 58 ++-
server
Signed-off-by: Colin McCabe
---
include/cldc.h |5 +--
lib/cldc.c | 98 +++-
tools/cldcli.c |2 +-
3 files changed, 43 insertions(+), 62 deletions(-)
diff --git a/include/cldc.h b/include/cldc.h
index 3f0deb5..1382a23 100644
Signed-off-by: Colin McCabe
---
include/hail_log.h | 31 +++
1 files changed, 31 insertions(+), 0 deletions(-)
create mode 100644 include/hail_log.h
diff --git a/include/hail_log.h b/include/hail_log.h
new file mode 100644
index 000..f825b89
--- /dev/null
This patch series creates some logging macros in hail_log.h and modifies cld
to use them. It also converts chunkd and tabled to use the new cld API.
version 3:
* move logging macros out of common.h and into hail_log.h
* add patches for chunkd and tabled
version 2:
* Rename CLD_DEBUG, etc. to HAIL
Signed-off-by: Colin McCabe
---
include/cld_msg.h | 10 --
include/cldc.h|1 +
include/common.h | 11 +++
3 files changed, 12 insertions(+), 10 deletions(-)
create mode 100644 include/common.h
diff --git a/include/cld_msg.h b/include/cld_msg.h
index 641b857
On Mon, Dec 14, 2009 at 12:36 PM, Jeff Garzik wrote:
> On 12/14/2009 02:23 AM, Colin McCabe wrote:
>>
>> Hi all,
>>
>> I think I'm going to respin this patch to be a lot smaller. Just
>> refactor one or two things, but leave the existing "verbose" a
e, Dec 8, 2009 at 4:11 PM, Colin McCabe wrote:
> This patch series creates a common.h and populates it with some function
> prototypes and logging stuff.
>
> version 2:
> * Rename CLD_DEBUG, etc. to HAIL_DEBUG
> * use angle brackets for including common.h from include/
>
> Col
On Wed, Dec 9, 2009 at 12:35 PM, Pete Zaitcev wrote:
> On Tue, 8 Dec 2009 16:11:55 -0800
> Colin McCabe wrote:
>
>> @@ -161,8 +153,8 @@ static void push_host(GList **host_list, struct
>> cldc_host *hp_in)
>> * This is not reentrant. Better be called before a
Signed-off-by: Colin McCabe
---
include/common.h | 27 +++
1 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/include/common.h b/include/common.h
index 52e5603..f6ad4f6 100644
--- a/include/common.h
+++ b/include/common.h
@@ -8,4 +8,31 @@ void __cld_rand64
Signed-off-by: Colin McCabe
---
lib/cldc-dns.c | 10 +-
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/lib/cldc-dns.c b/lib/cldc-dns.c
index d58a8ba..1bf6355 100644
--- a/lib/cldc-dns.c
+++ b/lib/cldc-dns.c
@@ -46,7 +46,7 @@ int cldc_saveaddr(struct cldc_host *hp
Signed-off-by: Colin McCabe
---
include/cldc.h |7 ++---
lib/cldc-dns.c | 80 +---
tools/cldcli.c | 12 +---
3 files changed, 41 insertions(+), 58 deletions(-)
diff --git a/include/cldc.h b/include/cldc.h
index 584e026..abec747
Signed-off-by: Colin McCabe
---
server/cld.h |4 +-
server/cldb.c|6 ++--
server/msg.c | 49 +-
server/server.c | 86 --
server/session.c | 57 ++--
server
Signed-off-by: Colin McCabe
---
include/cldc.h |4 +--
lib/cldc.c | 98 +++-
tools/cldcli.c |2 +-
3 files changed, 42 insertions(+), 62 deletions(-)
diff --git a/include/cldc.h b/include/cldc.h
index 3f0deb5..584e026 100644
Signed-off-by: Colin McCabe
---
include/cld_msg.h | 10 --
include/cldc.h|1 +
include/common.h | 11 +++
3 files changed, 12 insertions(+), 10 deletions(-)
create mode 100644 include/common.h
diff --git a/include/cld_msg.h b/include/cld_msg.h
index 641b857
This patch series creates a common.h and populates it with some function
prototypes and logging stuff.
version 2:
* Rename CLD_DEBUG, etc. to HAIL_DEBUG
* use angle brackets for including common.h from include/
Colin McCabe (6):
cld: Declare common.c functions in common.h
cld: create logging
On Tue, Dec 8, 2009 at 10:13 AM, Pete Zaitcev wrote:
> On Mon, 7 Dec 2009 16:43:02 -0800
> Colin McCabe wrote:
>
>> +++ b/server/cld.h
>> @@ -26,6 +26,7 @@
>> #include
>> #include "cldb.h"
>> #include
>> +#include "common.h"
Signed-off-by: Colin McCabe
---
lib/cldc-dns.c | 10 +-
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/lib/cldc-dns.c b/lib/cldc-dns.c
index 41bcf60..6e0aec0 100644
--- a/lib/cldc-dns.c
+++ b/lib/cldc-dns.c
@@ -46,7 +46,7 @@ int cldc_saveaddr(struct cldc_host *hp
Signed-off-by: Colin McCabe
---
include/cldc.h |7 ++---
lib/cldc-dns.c | 80 +---
tools/cldcli.c | 12 +---
3 files changed, 41 insertions(+), 58 deletions(-)
diff --git a/include/cldc.h b/include/cldc.h
index 70062cf..f0a1b37
From: Colin McCabe
Signed-off-by: Colin McCabe
---
server/cld.h |4 +-
server/cldb.c|6 ++--
server/msg.c | 49 +-
server/server.c | 86 --
server/session.c | 57
From: Colin McCabe
Signed-off-by: Colin McCabe
---
include/cldc.h |4 +--
lib/cldc.c | 98 +++-
tools/cldcli.c |2 +-
3 files changed, 42 insertions(+), 62 deletions(-)
diff --git a/include/cldc.h b/include/cldc.h
index 3f0deb5
From: Colin McCabe
Signed-off-by: Colin McCabe
---
include/cld_msg.h | 10 --
include/cldc.h|1 +
include/common.h | 11 +++
3 files changed, 12 insertions(+), 10 deletions(-)
create mode 100644 include/common.h
diff --git a/include/cld_msg.h b/include/cld_msg.h
From: Colin McCabe
Signed-off-by: Colin McCabe
---
include/common.h | 27 +++
1 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/include/common.h b/include/common.h
index 52e5603..30610d8 100644
--- a/include/common.h
+++ b/include/common.h
@@ -8,4 +8,31
This patch series creates a common.h and populates it with some function
prototypes and logging stuff.
The changes here are fairly minor and mostly consist of switching over to use
the new logging macros. Probably the most helpful one is CLD_DEBUG, which only
evaluates its arguments if log->verbos
I'm wondering if there's a function that will take a buffer full of
XDR data and an xdrproc_t, and print out a human readable version of
the data.
It seems like an obvious debugging tool, but I can't find a reference
to anything like this in the XDR docs.
I guess the obvious workaround is to deser
tly
need two extra parameters-- the logging function, and the verbose flag.
It's cleaner to condense this into one parameter.
2. The if (verbose) sess->act_log pattern leads to an excessive level of
indentation, which tends to make things more unclear.
version 2: add common.h
Signed-off-by: C
two extra parameters-- the logging function, and the verbose flag.
It's cleaner to condense this into one parameter.
2. The if (verbose) sess->act_log pattern leads to an excessive level of
indentation, which tends to make things more unclear.
What do you think?
Signed-off-by: C
CLD_MAX_MSG_SZ is clearly the right constant to use when checking if a message
the api user wants to send is too long.
Signed-off-by: Colin McCabe
---
lib/cldc.c |5 +
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/lib/cldc.c b/lib/cldc.c
index 7fe5214..0ab4f19 100644
D'oh!
Resending.
C.
On Sun, Dec 6, 2009 at 12:46 PM, Jeff Garzik wrote:
> On 12/06/2009 07:37 AM, Colin McCabe wrote:
>>
>> CLD_MAX_MSG_SZ is clearly the right constant to use when checking if a
>> message
>> the api user wants to send is too long.
>>
&g
CLD_MAX_MSG_SZ is clearly the right constant to use when checking if a message
the api user wants to send is too long.
I found this while working on the XDR stuff.
---
lib/cldc.c |5 +
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/lib/cldc.c b/lib/cldc.c
index 7fe5214..0a
Signed-off-by: Colin McCabe
---
lib/common.c | 27 +--
1 files changed, 13 insertions(+), 14 deletions(-)
diff --git a/lib/common.c b/lib/common.c
index 68f60f8..f139de0 100644
--- a/lib/common.c
+++ b/lib/common.c
@@ -61,26 +61,25 @@ const char *cld_errstr(enum
Signed-off-by: Colin McCabe
---
lib/common.c | 29 +++--
1 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/lib/common.c b/lib/common.c
index 68f60f8..db20e2a 100644
--- a/lib/common.c
+++ b/lib/common.c
@@ -1,4 +1,5 @@
+#include
#include
#include
From: cmccabe
Signed-off-by: Colin McCabe
---
test/it-works.c|1 +
test/load-file-event.c |1 +
test/lock-file-event.c |1 +
test/save-file-event.c |1 +
4 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/test/it-works.c b/test/it-works.c
index bd2f965
Oops... please ignore the From: line.
C.
On Fri, Nov 27, 2009 at 6:21 PM, Colin McCabe wrote:
> From: cmccabe
>
> Signed-off-by: Colin McCabe
>
> ---
> test/it-works.c|1 +
> test/load-file-event.c |1 +
> test/lock-file-event.c |1 +
> te
On Sat, Nov 28, 2009 at 1:23 AM, Jeff Garzik wrote:
> On 11/27/2009 06:20 PM, cmcc...@alumni.cmu.edu wrote:
>>
>> --- a/lib/common.c
>> +++ b/lib/common.c
>> @@ -56,6 +56,37 @@ const char *cld_errstr(enum cle_err_codes ecode)
>>return cld_errlist[ecode];
>> }
>>
>> +/** Read from a file d
76 matches
Mail list logo