[Parted-commits] GNU Parted Official Repository: Changes to 'stable-1.8.x'

David Cantrell dcantrell-guest at alioth.debian.org
Tue Jul 31 19:42:01 UTC 2007


 NEWS                   |   17 ++++++++++++++++
 libparted/arch/linux.c |   51 ++++++++++++++++++++++++++++++++++++++++++++-----
 2 files changed, 63 insertions(+), 5 deletions(-)

New commits:
commit 609b7ae6d274e479027bb46c4bd10227cd921803
Author: David Cantrell <dcantrel at mortise.boston.redhat.com>
Date:   Tue Jul 31 15:41:22 2007 -0400

    Probe for all device-mapper devices.
    
    Add _dm_probe_all() from Debian and patch linux_probe_all() to probe for
    device-mapper devices after probing for standard devices.

diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
index 0981be0..cb9605f 100644
--- a/libparted/arch/linux.c
+++ b/libparted/arch/linux.c
@@ -390,6 +390,39 @@ next:
         close(fd);
         return 0;
 }
+
+static int
+_probe_dm_devices ()
+{
+       DIR*            mapper_dir;
+       struct dirent*  dent;
+       char            buf [512];      /* readdir(3) claims d_name[256] */
+       struct stat     st;
+
+       mapper_dir = opendir ("/dev/mapper");
+       if (!mapper_dir)
+               return 0;
+
+       /* Search the /dev/mapper directory for devices w/ the same major
+        * number that was returned from _probe_lvm_major().
+        */
+       while ((dent = readdir (mapper_dir))) {
+               if (strcmp (dent->d_name, ".")  == 0 ||
+                   strcmp (dent->d_name, "..") == 0)
+                       continue;
+
+               snprintf (buf, sizeof (buf), "/dev/mapper/%s", dent->d_name);
+
+               if (stat (buf, &st) != 0)
+                       continue;
+
+               if (_is_dm_major(major(st.st_rdev)))
+                       _ped_device_probe (buf);
+       }
+       closedir (mapper_dir);
+
+       return 1;
+}
 #endif
 
 static int
@@ -1903,11 +1936,19 @@ linux_probe_all ()
          */
         _probe_standard_devices ();
 
- 	/* /sys/block is more reliable and consistent; fall back to using
- 	 * /proc/partitions if the former is unavailable, however.
- 	 */
- 	if (!_probe_sys_block ())
- 		_probe_proc_partitions ();
+#ifdef ENABLE_DEVICE_MAPPER
+        /* device-mapper devices aren't listed in /proc/partitions; or, if
+         * they are, they're listed as dm-X.  So, instead of relying on that,
+         * we do our own checks.
+         */
+        _probe_dm_devices ();
+#endif
+
+        /* /sys/block is more reliable and consistent; fall back to using
+         * /proc/partitions if the former is unavailable, however.
+         */
+        if (!_probe_sys_block ())
+                _probe_proc_partitions ();
 }
 
 static char*

commit 93abb3e4886d99219c198b0396324dbee3453de0
Author: David Cantrell <dcantrel at mortise.boston.redhat.com>
Date:   Tue Jul 31 15:35:27 2007 -0400

    Updated NEWS file preparing for 1.8.8.

diff --git a/NEWS b/NEWS
index 92be739..536ec1a 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,20 @@
+1.8.8
+=====
+
+GNU parted is now licensed under the GNU General Public License version 3
+or higher.  See the COPYING file for more details.
+
+libparted:
+-
+-
+-
+
+parted:
+-
+-
+-
+
+
 1.8.7
 =====
 



More information about the Parted-commits mailing list