* nfs-utils atomicio.c
@ 2010-07-16 19:35 Jim Rees
[not found] ` <20100716193508.GA14878-8f4Pc2RrbJmHXe+LvDLADg@public.gmane.org>
0 siblings, 1 reply; 9+ messages in thread
From: Jim Rees @ 2010-07-16 19:35 UTC (permalink / raw)
To: linux-nfs
Someone should move atomicio.c into nfs-utils/support/nfs. There are
currently two copies, in idmapd and spnfsd, and I'm about to add a third.
I'll move it if no one has a better idea or beats me to it.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: nfs-utils atomicio.c
[not found] ` <20100716193508.GA14878-8f4Pc2RrbJmHXe+LvDLADg@public.gmane.org>
@ 2010-07-16 20:09 ` David P. Quigley
[not found] ` <1279310952.8180.0.camel-88+Bj4OksMGWPftkNcioYDMZycKHmlmlfvIqQ387n9k@public.gmane.org>
0 siblings, 1 reply; 9+ messages in thread
From: David P. Quigley @ 2010-07-16 20:09 UTC (permalink / raw)
To: Jim Rees; +Cc: linux-nfs
On Fri, 2010-07-16 at 15:35 -0400, Jim Rees wrote:
> Someone should move atomicio.c into nfs-utils/support/nfs. There are
> currently two copies, in idmapd and spnfsd, and I'm about to add a third.
> I'll move it if no one has a better idea or beats me to it.
I agree with this move as I have a label mapping daemon based off of
idmapd which uses it as well (although not merged yet). My patch set
actually moves this file to support/nfs as well.
Dave
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: nfs-utils atomicio.c
[not found] ` <1279310952.8180.0.camel-88+Bj4OksMGWPftkNcioYDMZycKHmlmlfvIqQ387n9k@public.gmane.org>
@ 2010-07-16 20:53 ` Jim Rees
[not found] ` <20100716205355.GA7962-8f4Pc2RrbJmHXe+LvDLADg@public.gmane.org>
0 siblings, 1 reply; 9+ messages in thread
From: Jim Rees @ 2010-07-16 20:53 UTC (permalink / raw)
To: David P. Quigley; +Cc: linux-nfs
David P. Quigley wrote:
I agree with this move as I have a label mapping daemon based off of
idmapd which uses it as well (although not merged yet). My patch set
actually moves this file to support/nfs as well.
I don't suppose you'd like to isolate just the move and submit that?
strlcat and strlcpy should probably go too.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: nfs-utils atomicio.c
[not found] ` <20100716205355.GA7962-8f4Pc2RrbJmHXe+LvDLADg@public.gmane.org>
@ 2010-07-16 21:02 ` Steve Dickson
[not found] ` <4C40C8DF.8030107-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 9+ messages in thread
From: Steve Dickson @ 2010-07-16 21:02 UTC (permalink / raw)
To: Jim Rees; +Cc: David P. Quigley, linux-nfs
On 07/16/2010 04:53 PM, Jim Rees wrote:
> David P. Quigley wrote:
>
> I agree with this move as I have a label mapping daemon based off of
> idmapd which uses it as well (although not merged yet). My patch set
> actually moves this file to support/nfs as well.
>
> I don't suppose you'd like to isolate just the move and submit that?
I'll take care of it...
>
> strlcat and strlcpy should probably go too.
Anything else?
steved.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: nfs-utils atomicio.c
[not found] ` <4C40C8DF.8030107-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
@ 2010-07-16 22:06 ` Jim Rees
[not found] ` <20100716220609.GA7828-8f4Pc2RrbJmHXe+LvDLADg@public.gmane.org>
0 siblings, 1 reply; 9+ messages in thread
From: Jim Rees @ 2010-07-16 22:06 UTC (permalink / raw)
To: Steve Dickson; +Cc: David P. Quigley, linux-nfs
Steve Dickson wrote:
> strlcat and strlcpy should probably go too.
Anything else?
I don't see any other library functions that should move. Configure should
check for strlcat and strlcpy, and not compile them if there are system
versions. Again, I'll do that if no one beats me to it.
On a related note, I've been using benny's pnfs-nfs-utils.git tree as a base
for adding the block layout helper, as suggested by the wiki. Is that
correct?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: nfs-utils atomicio.c
[not found] ` <20100716220609.GA7828-8f4Pc2RrbJmHXe+LvDLADg@public.gmane.org>
@ 2010-07-16 22:33 ` David P. Quigley
[not found] ` <1279319622.8180.2.camel-88+Bj4OksMGWPftkNcioYDMZycKHmlmlfvIqQ387n9k@public.gmane.org>
0 siblings, 1 reply; 9+ messages in thread
From: David P. Quigley @ 2010-07-16 22:33 UTC (permalink / raw)
To: Jim Rees; +Cc: Steve Dickson, linux-nfs
[-- Attachment #1: Type: text/plain, Size: 979 bytes --]
On Fri, 2010-07-16 at 18:06 -0400, Jim Rees wrote:
> Steve Dickson wrote:
>
> > strlcat and strlcpy should probably go too.
> Anything else?
>
> I don't see any other library functions that should move. Configure should
> check for strlcat and strlcpy, and not compile them if there are system
> versions. Again, I'll do that if no one beats me to it.
>
> On a related note, I've been using benny's pnfs-nfs-utils.git tree as a base
> for adding the block layout helper, as suggested by the wiki. Is that
> correct?
Just got back from dinner and I'm heading out soon for the weekend but
here is the patch that I have. It should apply on top of
2ef57222b10a91f4b96a06808d05a47e8f4c14f7 and moves strlcat and strlcpy
as well. The only think you might have to check is I know at some point
some changes were made to cfg.c and cfg.h make sure the ones I have in
this patch are the new ones instead of the old ones. I'd take a closer
look but I'm short on time here.
Dave
[-- Attachment #2: 0001-Move-common-code-into-support.patch --]
[-- Type: text/x-patch, Size: 4920 bytes --]
>From a370d18feae6e1f99183a3da1e290fcea3b697e0 Mon Sep 17 00:00:00 2001
From: David P. Quigley <dpquigl@tycho.nsa.gov>
Date: Tue, 22 Jun 2010 12:35:27 -0400
Subject: [PATCH] Move common code into support
There are several source files and headers present in the ./utils/idmapd
directory which are also usable in a doimapd daemon. Because of this we move
that support into the support directory such that it can be shared by both
daemons.
---
{utils/idmapd => support/include}/cfg.h | 7 +++++++
support/include/nfslib.h | 5 +++++
{utils/idmapd => support/include}/queue.h | 0
support/nfs/Makefile.am | 3 ++-
{utils/idmapd => support/nfs}/atomicio.c | 0
{utils/idmapd => support/nfs}/cfg.c | 0
{utils/idmapd => support/nfs}/strlcat.c | 0
{utils/idmapd => support/nfs}/strlcpy.c | 0
utils/idmapd/Makefile.am | 8 +-------
utils/idmapd/idmapd.c | 11 -----------
10 files changed, 15 insertions(+), 19 deletions(-)
rename {utils/idmapd => support/include}/cfg.h (95%)
rename {utils/idmapd => support/include}/queue.h (100%)
rename {utils/idmapd => support/nfs}/atomicio.c (100%)
rename {utils/idmapd => support/nfs}/cfg.c (100%)
rename {utils/idmapd => support/nfs}/strlcat.c (100%)
rename {utils/idmapd => support/nfs}/strlcpy.c (100%)
diff --git a/utils/idmapd/cfg.h b/support/include/cfg.h
similarity index 95%
rename from utils/idmapd/cfg.h
rename to support/include/cfg.h
index c1ca940..aa39acf 100644
--- a/utils/idmapd/cfg.h
+++ b/support/include/cfg.h
@@ -35,6 +35,13 @@
#include "queue.h"
+/* From Niels */
+#define CONF_SAVE(w, f) do { \
+ char *p = f; \
+ if (p != NULL) \
+ (w) = p; \
+} while (0)
+
struct conf_list_node {
TAILQ_ENTRY(conf_list_node) link;
char *field;
diff --git a/support/include/nfslib.h b/support/include/nfslib.h
index 422b012..aaa9e4b 100644
--- a/support/include/nfslib.h
+++ b/support/include/nfslib.h
@@ -155,4 +155,9 @@ void closeall(int min);
int svctcp_socket (u_long __number, int __reuse);
int svcudp_socket (u_long __number, int __reuse);
+/* Misc shared code prototypes */
+size_t strlcat(char *, const char *, size_t);
+size_t strlcpy(char *, const char *, size_t);
+ssize_t atomicio(ssize_t (*f) (int, void*, size_t),
+ int, void *, size_t);
#endif /* NFSLIB_H */
diff --git a/utils/idmapd/queue.h b/support/include/queue.h
similarity index 100%
rename from utils/idmapd/queue.h
rename to support/include/queue.h
diff --git a/support/nfs/Makefile.am b/support/nfs/Makefile.am
index 87f3949..a9753ed 100644
--- a/support/nfs/Makefile.am
+++ b/support/nfs/Makefile.am
@@ -4,7 +4,8 @@ noinst_LIBRARIES = libnfs.a
libnfs_a_SOURCES = exports.c rmtab.c xio.c rpcmisc.c rpcdispatch.c \
xlog.c xcommon.c wildmat.c nfssvc.c nfsclient.c \
nfsexport.c getfh.c nfsctl.c \
- svc_socket.c cacheio.c closeall.c nfs_mntent.c
+ svc_socket.c cacheio.c closeall.c nfs_mntent.c \
+ cfg.c atomicio.c strlcpy.c strlcat.c
MAINTAINERCLEANFILES = Makefile.in
diff --git a/utils/idmapd/atomicio.c b/support/nfs/atomicio.c
similarity index 100%
rename from utils/idmapd/atomicio.c
rename to support/nfs/atomicio.c
diff --git a/utils/idmapd/cfg.c b/support/nfs/cfg.c
similarity index 100%
rename from utils/idmapd/cfg.c
rename to support/nfs/cfg.c
diff --git a/utils/idmapd/strlcat.c b/support/nfs/strlcat.c
similarity index 100%
rename from utils/idmapd/strlcat.c
rename to support/nfs/strlcat.c
diff --git a/utils/idmapd/strlcpy.c b/support/nfs/strlcpy.c
similarity index 100%
rename from utils/idmapd/strlcpy.c
rename to support/nfs/strlcpy.c
diff --git a/utils/idmapd/Makefile.am b/utils/idmapd/Makefile.am
index eb393df..3f2acac 100644
--- a/utils/idmapd/Makefile.am
+++ b/utils/idmapd/Makefile.am
@@ -13,15 +13,9 @@ EXTRA_DIST = \
idmapd.conf
idmapd_SOURCES = \
- atomicio.c \
- cfg.c \
idmapd.c \
- strlcat.c \
- strlcpy.c \
\
- cfg.h \
- nfs_idmap.h \
- queue.h
+ nfs_idmap.h
idmapd_LDADD = -levent -lnfsidmap ../../support/nfs/libnfs.a
diff --git a/utils/idmapd/idmapd.c b/utils/idmapd/idmapd.c
index 6b5971c..73187bb 100644
--- a/utils/idmapd/idmapd.c
+++ b/utils/idmapd/idmapd.c
@@ -90,13 +90,6 @@
#define NFS4NOBODY_GROUP "nobody"
#endif
-/* From Niels */
-#define CONF_SAVE(w, f) do { \
- char *p = f; \
- if (p != NULL) \
- (w) = p; \
-} while (0)
-
#define IC_IDNAME 0
#define IC_IDNAME_CHAN NFSD_DIR "/nfs4.idtoname/channel"
#define IC_IDNAME_FLUSH NFSD_DIR "/nfs4.idtoname/flush"
@@ -141,10 +134,6 @@ static int nfsdopen(void);
static int nfsdopenone(struct idmap_client *);
static void nfsdreopen(void);
-size_t strlcat(char *, const char *, size_t);
-size_t strlcpy(char *, const char *, size_t);
-ssize_t atomicio(ssize_t (*f) (int, void*, size_t),
- int, void *, size_t);
void mydaemon(int, int);
void release_parent(void);
--
1.6.2.5
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: nfs-utils atomicio.c
[not found] ` <1279319622.8180.2.camel-88+Bj4OksMGWPftkNcioYDMZycKHmlmlfvIqQ387n9k@public.gmane.org>
@ 2010-07-19 15:28 ` Steve Dickson
2010-07-19 15:33 ` Steve Dickson
1 sibling, 0 replies; 9+ messages in thread
From: Steve Dickson @ 2010-07-19 15:28 UTC (permalink / raw)
To: David P. Quigley; +Cc: Jim Rees, linux-nfs
Hey David,
On 07/16/2010 06:33 PM, David P. Quigley wrote:
> On Fri, 2010-07-16 at 18:06 -0400, Jim Rees wrote:
>> Steve Dickson wrote:
>>
>> > strlcat and strlcpy should probably go too.
>> Anything else?
>>
>> I don't see any other library functions that should move. Configure should
>> check for strlcat and strlcpy, and not compile them if there are system
>> versions. Again, I'll do that if no one beats me to it.
>>
>> On a related note, I've been using benny's pnfs-nfs-utils.git tree as a base
>> for adding the block layout helper, as suggested by the wiki. Is that
>> correct?
>
> Just got back from dinner and I'm heading out soon for the weekend but
> here is the patch that I have. It should apply on top of
> 2ef57222b10a91f4b96a06808d05a47e8f4c14f7 and moves strlcat and strlcpy
> as well. The only think you might have to check is I know at some point
> some changes were made to cfg.c and cfg.h make sure the ones I have in
> this patch are the new ones instead of the old ones. I'd take a closer
> look but I'm short on time here.
Thanks for being so proactive... but... there is no utils/idmapd/cfg.[ch]
files in my upstream repo... so where is that coming from??
steved.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: nfs-utils atomicio.c
[not found] ` <1279319622.8180.2.camel-88+Bj4OksMGWPftkNcioYDMZycKHmlmlfvIqQ387n9k@public.gmane.org>
2010-07-19 15:28 ` Steve Dickson
@ 2010-07-19 15:33 ` Steve Dickson
[not found] ` <4C447034.4020006-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
1 sibling, 1 reply; 9+ messages in thread
From: Steve Dickson @ 2010-07-19 15:33 UTC (permalink / raw)
To: David P. Quigley; +Cc: Jim Rees, linux-nfs
On 07/16/2010 06:33 PM, David P. Quigley wrote:
> On Fri, 2010-07-16 at 18:06 -0400, Jim Rees wrote:
>> Steve Dickson wrote:
>>
>> > strlcat and strlcpy should probably go too.
>> Anything else?
>>
>> I don't see any other library functions that should move. Configure should
>> check for strlcat and strlcpy, and not compile them if there are system
>> versions. Again, I'll do that if no one beats me to it.
>>
>> On a related note, I've been using benny's pnfs-nfs-utils.git tree as a base
>> for adding the block layout helper, as suggested by the wiki. Is that
>> correct?
>
> Just got back from dinner and I'm heading out soon for the weekend but
> here is the patch that I have. It should apply on top of
> 2ef57222b10a91f4b96a06808d05a47e8f4c14f7 and moves strlcat and strlcpy
> as well. The only think you might have to check is I know at some point
> some changes were made to cfg.c and cfg.h make sure the ones I have in
> this patch are the new ones instead of the old ones. I'd take a closer
> look but I'm short on time here.
>
>
Question: Is there a reason need a private version of queue.h, instead
of using the one ins /usr/include/sys?
steved.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: nfs-utils atomicio.c
[not found] ` <4C447034.4020006-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
@ 2010-07-19 16:30 ` David P. Quigley
0 siblings, 0 replies; 9+ messages in thread
From: David P. Quigley @ 2010-07-19 16:30 UTC (permalink / raw)
To: Steve Dickson; +Cc: Jim Rees, linux-nfs
On Mon, 2010-07-19 at 11:33 -0400, Steve Dickson wrote:
>
> On 07/16/2010 06:33 PM, David P. Quigley wrote:
> > On Fri, 2010-07-16 at 18:06 -0400, Jim Rees wrote:
> >> Steve Dickson wrote:
> >>
> >> > strlcat and strlcpy should probably go too.
> >> Anything else?
> >>
> >> I don't see any other library functions that should move. Configure should
> >> check for strlcat and strlcpy, and not compile them if there are system
> >> versions. Again, I'll do that if no one beats me to it.
> >>
> >> On a related note, I've been using benny's pnfs-nfs-utils.git tree as a base
> >> for adding the block layout helper, as suggested by the wiki. Is that
> >> correct?
> >
> > Just got back from dinner and I'm heading out soon for the weekend but
> > here is the patch that I have. It should apply on top of
> > 2ef57222b10a91f4b96a06808d05a47e8f4c14f7 and moves strlcat and strlcpy
> > as well. The only think you might have to check is I know at some point
> > some changes were made to cfg.c and cfg.h make sure the ones I have in
> > this patch are the new ones instead of the old ones. I'd take a closer
> > look but I'm short on time here.
> >
> >
> Question: Is there a reason need a private version of queue.h, instead
> of using the one ins /usr/include/sys?
>
> steved.
Hello Steve,
At one point there was a cfg.c and cfg.h for idmapd. That was
probably when I first made this patch a year or so ago. I use guilt for
patch management so I've been rebasing those patches onto newer versions
for a while. Its possible that those files were moved or removed since
then. I think I remember hearing that someone redid the config files for
nfs. If that is the case cfg.c and cfg.h can go away. It is very
possible that they were just rolled forward with the patch rebasing.
Additionally if queue.h from /usr/include/sys is what is being used now
we can get rid of the private copy from my patch as well. I didn't have
a reason for keeping a private copy other than the fact the idmapd was
using it and I was going to as well so I moved it into the support
directory. I should have given the patch a bit more of a look over
before I left for the weekend but I was running really short on time
when I sent it out.
Dave
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2010-07-19 16:40 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-16 19:35 nfs-utils atomicio.c Jim Rees
[not found] ` <20100716193508.GA14878-8f4Pc2RrbJmHXe+LvDLADg@public.gmane.org>
2010-07-16 20:09 ` David P. Quigley
[not found] ` <1279310952.8180.0.camel-88+Bj4OksMGWPftkNcioYDMZycKHmlmlfvIqQ387n9k@public.gmane.org>
2010-07-16 20:53 ` Jim Rees
[not found] ` <20100716205355.GA7962-8f4Pc2RrbJmHXe+LvDLADg@public.gmane.org>
2010-07-16 21:02 ` Steve Dickson
[not found] ` <4C40C8DF.8030107-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
2010-07-16 22:06 ` Jim Rees
[not found] ` <20100716220609.GA7828-8f4Pc2RrbJmHXe+LvDLADg@public.gmane.org>
2010-07-16 22:33 ` David P. Quigley
[not found] ` <1279319622.8180.2.camel-88+Bj4OksMGWPftkNcioYDMZycKHmlmlfvIqQ387n9k@public.gmane.org>
2010-07-19 15:28 ` Steve Dickson
2010-07-19 15:33 ` Steve Dickson
[not found] ` <4C447034.4020006-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
2010-07-19 16:30 ` David P. Quigley
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.