All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jun'ichi Nomura" <j-nomura@ce.jp.nec.com>
To: LVM2 development <lvm-devel@redhat.com>, jim@meyering.net
Cc: device-mapper development <dm-devel@redhat.com>
Subject: Re: [lvm-devel] new device-mapper required to build latest lvm from cvs
Date: Wed, 25 Jul 2007 16:01:13 -0400	[thread overview]
Message-ID: <46A7AC09.2070502@ce.jp.nec.com> (raw)
In-Reply-To: <46A7AB23.7050306@ce.jp.nec.com>

[-- Attachment #1: Type: text/plain, Size: 503 bytes --]

> lvm_fclose() calls dm_fclose(), which cause the linker to
> bring libdm-file.o in liblvm.a. Then there happens a conflict
> of create_dir().
> 
> Attached is a patch for device-mapper to rename the function
> and export it. It alone fixes the build error.
> 
> A patch for LVM2 to use the exported function will follow.

This is the patch for LVM2.
LVM2's create_dir() is left there for the case LVM2 specific
something could be put in future.

Thanks,
-- 
Jun'ichi Nomura, NEC Corporation of America

[-- Attachment #2: lvm2-use-dm_create_dir.patch --]
[-- Type: text/x-patch, Size: 1275 bytes --]

Use dm_create_dir() instead of its own.

Index: LVM2.work/lib/misc/lvm-file.c
===================================================================
--- LVM2.work.orig/lib/misc/lvm-file.c
+++ LVM2.work/lib/misc/lvm-file.c
@@ -140,54 +140,9 @@ int dir_exists(const char *path)
 	return 1;
 }
 
-static int _create_dir_recursive(const char *dir)
-{
-	char *orig, *s;
-	int rc;
-
-	log_verbose("Creating directory \"%s\"", dir);
-	/* Create parent directories */
-	orig = s = dm_strdup(dir);
-	while ((s = strchr(s, '/')) != NULL) {
-		*s = '\0';
-		if (*orig) {
-			rc = mkdir(orig, 0777);
-			if (rc < 0 && errno != EEXIST) {
-				if (errno != EROFS)
-					log_sys_error("mkdir", orig);
-				dm_free(orig);
-				return 0;
-			}
-		}
-		*s++ = '/';
-	}
-	dm_free(orig);
-
-	/* Create final directory */
-	rc = mkdir(dir, 0777);
-	if (rc < 0 && errno != EEXIST) {
-		if (errno != EROFS)
-			log_sys_error("mkdir", dir);
-		return 0;
-	}
-	return 1;
-}
-
 int create_dir(const char *dir)
 {
-	struct stat info;
-
-	if (!*dir)
-		return 1;
-
-	if (stat(dir, &info) < 0)
-		return _create_dir_recursive(dir);
-
-	if (S_ISDIR(info.st_mode))
-		return 1;
-
-	log_error("Directory \"%s\" not found", dir);
-	return 0;
+	return dm_create_dir(dir);
 }
 
 int is_empty_dir(const char *dir)

[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



WARNING: multiple messages have this Message-ID (diff)
From: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
To: lvm-devel@redhat.com
Subject: new device-mapper required to build latest lvm from cvs
Date: Wed, 25 Jul 2007 16:01:13 -0400	[thread overview]
Message-ID: <46A7AC09.2070502@ce.jp.nec.com> (raw)
In-Reply-To: <46A7AB23.7050306@ce.jp.nec.com>

> lvm_fclose() calls dm_fclose(), which cause the linker to
> bring libdm-file.o in liblvm.a. Then there happens a conflict
> of create_dir().
> 
> Attached is a patch for device-mapper to rename the function
> and export it. It alone fixes the build error.
> 
> A patch for LVM2 to use the exported function will follow.

This is the patch for LVM2.
LVM2's create_dir() is left there for the case LVM2 specific
something could be put in future.

Thanks,
-- 
Jun'ichi Nomura, NEC Corporation of America
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lvm2-use-dm_create_dir.patch
Type: text/x-patch
Size: 1275 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20070725/7c07d538/attachment.bin>

  reply	other threads:[~2007-07-25 20:01 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-24 17:51 new device-mapper required to build latest lvm from cvs Jim Meyering
2007-07-25 19:57 ` [lvm-devel] " Jun'ichi Nomura
2007-07-25 19:57   ` Jun'ichi Nomura
2007-07-25 20:01   ` Jun'ichi Nomura [this message]
2007-07-25 20:01     ` Jun'ichi Nomura
2007-07-25 20:10     ` Alasdair G Kergon
2007-07-25 20:32       ` Alasdair G Kergon
2007-07-25 21:04         ` Jun'ichi Nomura
2007-07-26 18:38           ` Jun'ichi Nomura
2007-07-26 20:34             ` Jun'ichi Nomura
2007-07-26 18:39           ` Jun'ichi Nomura
2007-07-25 20:43       ` Jun'ichi Nomura
2007-07-28 13:06   ` [lvm-devel] " Jim Meyering
2007-07-28 13:06     ` Jim Meyering

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46A7AC09.2070502@ce.jp.nec.com \
    --to=j-nomura@ce.jp.nec.com \
    --cc=dm-devel@redhat.com \
    --cc=jim@meyering.net \
    --cc=lvm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.