Hello community,
here is the log from the commit of package device-mapper
checked in at Mon Dec 10 23:47:48 CET 2007.
--------
--- device-mapper/device-mapper.changes 2007-11-22 14:08:19.000000000 +0100
+++ /mounts/work_src_done/STABLE/device-mapper/device-mapper.changes 2007-12-10 11:26:57.000000000 +0100
@@ -1,0 +2,8 @@
+Mon Dec 10 11:25:40 CET 2007 - fehr@suse.de
+
+- update to new version 1.02.23
+ Add readahead support to libdevmapper and dmsetup.
+ Fix double free in a libdevmapper-event error path.
+ Allow a DM_DEV_DIR environment variable to override /dev.
+
+-------------------------------------------------------------------
Old:
----
device-mapper.1.02.22.tar.bz2
New:
----
device-mapper.1.02.23.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ device-mapper.spec ++++++
--- /var/tmp/diff_new_pack.L18617/_old 2007-12-10 23:46:42.000000000 +0100
+++ /var/tmp/diff_new_pack.L18617/_new 2007-12-10 23:46:42.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package device-mapper (Version 1.02.22)
+# spec file for package device-mapper (Version 1.02.23)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -13,7 +13,7 @@
License: GPL v2 or later; LGPL v2.1 or later
Group: System/Base
AutoReqProv: on
-Version: 1.02.22
+Version: 1.02.23
Release: 1
Summary: Device Mapper Tools
Source: device-mapper.%{version}.tar.bz2
@@ -100,6 +100,11 @@
/usr/include/libdevmapper.h
%changelog
+* Mon Dec 10 2007 - fehr@suse.de
+- update to new version 1.02.23
+ Add readahead support to libdevmapper and dmsetup.
+ Fix double free in a libdevmapper-event error path.
+ Allow a DM_DEV_DIR environment variable to override /dev.
* Thu Nov 22 2007 - fehr@suse.de
- update to new version 1.02.22
Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1.
++++++ device-mapper.1.02.22.tar.bz2 -> device-mapper.1.02.23.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/device-mapper.1.02.22/configure new/device-mapper.1.02.23/configure
--- old/device-mapper.1.02.22/configure 2007-08-14 21:11:31.000000000 +0200
+++ new/device-mapper.1.02.23/configure 2007-10-10 02:02:03.000000000 +0200
@@ -708,6 +708,7 @@
DEVICE_MODE
DMEVENTD
PKGCONFIG
+LIB_PTHREAD
LTLIBOBJS'
ac_subst_files=''
ac_precious_vars='build_alias
@@ -1316,7 +1317,7 @@
--with-kernel-dir=DIR linux kernel source in DIR
--with-kernel-version=VERSION linux kernel version
--with-tmp-dir=DIR temp dir to make kernel patches [/tmp/kerndiff]
- --with-interface=IFACE Choose kernel interface (ioctl or fs) [ioctl]
+ --with-interface=IFACE Choose kernel interface (ioctl) [ioctl]
--with-dmeventd-pidfile=PATH dmeventd pidfile [/var/run/dmeventd.pid]
--with-dmeventd-path=PATH dmeventd path [${exec_prefix}/sbin/dmeventd]
@@ -6176,6 +6177,99 @@
{ echo "$as_me:$LINENO: WARNING: Disabling selinux" >&5
echo "$as_me: WARNING: Disabling selinux" >&2;}
fi
+
+ # With --enable-static_link and selinux enabled, linking dmsetup
+ # fails on at least Debian unstable due to unsatisfied references
+ # to pthread_mutex_lock and _unlock. See if we need -lpthread.
+ if test "$STATIC_LINK-$HAVE_SELINUX" = yes-yes; then
+ dm_saved_libs=$LIBS
+ LIBS="$LIBS -static"
+ { echo "$as_me:$LINENO: checking for library containing pthread_mutex_lock" >&5
+echo $ECHO_N "checking for library containing pthread_mutex_lock... $ECHO_C" >&6; }
+if test "${ac_cv_search_pthread_mutex_lock+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_mutex_lock ();
+int
+main ()
+{
+return pthread_mutex_lock ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' pthread; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_search_pthread_mutex_lock=$ac_res
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext
+ if test "${ac_cv_search_pthread_mutex_lock+set}" = set; then
+ break
+fi
+done
+if test "${ac_cv_search_pthread_mutex_lock+set}" = set; then
+ :
+else
+ ac_cv_search_pthread_mutex_lock=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_search_pthread_mutex_lock" >&5
+echo "${ECHO_T}$ac_cv_search_pthread_mutex_lock" >&6; }
+ac_res=$ac_cv_search_pthread_mutex_lock
+if test "$ac_res" != no; then
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+ test "$ac_cv_search_pthread_mutex_lock" = "none required" ||
+ LIB_PTHREAD=-lpthread
+fi
+
+ LIBS=$dm_saved_libs
+ fi
fi
################################################################################
@@ -6492,10 +6586,10 @@
interface=ioctl
fi
-if [ "x$interface" != xfs -a "x$interface" != xioctl ];
+if [ "x$interface" != xioctl ];
then
- { { echo "$as_me:$LINENO: error: --with-interface=ioctl or --with-interface=fs required" >&5
-echo "$as_me: error: --with-interface=ioctl or --with-interface=fs required" >&2;}
+ { { echo "$as_me:$LINENO: error: --with-interface=ioctl required. fs no longer supported." >&5
+echo "$as_me: error: --with-interface=ioctl required. fs no longer supported." >&2;}
{ (exit 1); exit 1; }; }
fi
{ echo "$as_me:$LINENO: result: $interface" >&5
@@ -6552,7 +6646,7 @@
else
cat >>confdefs.h <<_ACEOF
-#define DMEVENTD_PATH "$dmeventd_pref/sbin/dmeventd"
+#define DMEVENTD_PATH "$dmeventd_prefix/sbin/dmeventd"
_ACEOF
fi
@@ -6589,6 +6683,7 @@
+
################################################################################
ac_config_files="$ac_config_files Makefile make.tmpl include/Makefile dmsetup/Makefile lib/Makefile lib/libdevmapper.pc dmeventd/Makefile dmeventd/libdevmapper-event.pc kernel/Makefile man/Makefile po/Makefile"
@@ -7312,10 +7407,11 @@
DEVICE_MODE!$DEVICE_MODE$ac_delim
DMEVENTD!$DMEVENTD$ac_delim
PKGCONFIG!$PKGCONFIG$ac_delim
+LIB_PTHREAD!$LIB_PTHREAD$ac_delim
LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 95; then
+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 96; then
break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
@@ -7334,7 +7430,7 @@
cat >>$CONFIG_STATUS <<_ACEOF
cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
_ACEOF
sed '
s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
@@ -7347,8 +7443,6 @@
' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF
-:end
-s/|#_!!_#|//g
CEOF$ac_eof
_ACEOF
@@ -7596,7 +7690,7 @@
s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
s&@INSTALL@&$ac_INSTALL&;t t
$ac_datarootdir_hack
-" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out
+" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed 's/|#_!!_#|//g' >$tmp/out
test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
{ ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/device-mapper.1.02.22/configure.in new/device-mapper.1.02.23/configure.in
--- old/device-mapper.1.02.22/configure.in 2007-08-14 21:11:31.000000000 +0200
+++ new/device-mapper.1.02.23/configure.in 2007-10-10 02:02:03.000000000 +0200
@@ -240,6 +240,18 @@
else
AC_MSG_WARN(Disabling selinux)
fi
+
+ # With --enable-static_link and selinux enabled, linking dmsetup
+ # fails on at least Debian unstable due to unsatisfied references
+ # to pthread_mutex_lock and _unlock. See if we need -lpthread.
+ if test "$STATIC_LINK-$HAVE_SELINUX" = yes-yes; then
+ dm_saved_libs=$LIBS
+ LIBS="$LIBS -static"
+ AC_SEARCH_LIBS([pthread_mutex_lock], [pthread],
+ [test "$ac_cv_search_pthread_mutex_lock" = "none required" ||
+ LIB_PTHREAD=-lpthread])
+ LIBS=$dm_saved_libs
+ fi
fi
################################################################################
@@ -340,15 +352,15 @@
fi
################################################################################
-dnl -- which kernel interface to use (ioctl or fs)
+dnl -- which kernel interface to use (ioctl only)
AC_MSG_CHECKING(for kernel interface choice)
AC_ARG_WITH(interface,
- [ --with-interface=IFACE Choose kernel interface (ioctl or fs) [[ioctl]] ],
+ [ --with-interface=IFACE Choose kernel interface (ioctl) [[ioctl]] ],
[ interface="$withval" ],
[ interface=ioctl ])
-if [[ "x$interface" != xfs -a "x$interface" != xioctl ]];
+if [[ "x$interface" != xioctl ]];
then
- AC_MSG_ERROR(--with-interface=ioctl or --with-interface=fs required)
+ AC_MSG_ERROR(--with-interface=ioctl required. fs no longer supported.)
fi
AC_MSG_RESULT($interface)
@@ -382,7 +394,7 @@
AC_ARG_WITH(dmeventd-path,
[ --with-dmeventd-path=PATH dmeventd path [[${exec_prefix}/sbin/dmeventd]] ],
[ AC_DEFINE_UNQUOTED(DMEVENTD_PATH,"$withval") ],
- [ AC_DEFINE_UNQUOTED(DMEVENTD_PATH,"$dmeventd_pref/sbin/dmeventd") ])
+ [ AC_DEFINE_UNQUOTED(DMEVENTD_PATH,"$dmeventd_prefix/sbin/dmeventd") ])
fi
################################################################################
AC_SUBST(usrlibdir)
@@ -414,6 +426,7 @@
AC_SUBST(DEVICE_MODE)
AC_SUBST(DMEVENTD)
AC_SUBST(PKGCONFIG)
+AC_SUBST([LIB_PTHREAD])
################################################################################
dnl -- First and last lines should not contain files to generate in order to
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/device-mapper.1.02.22/dmeventd/libdevmapper-event.c new/device-mapper.1.02.23/dmeventd/libdevmapper-event.c
--- old/device-mapper.1.02.22/dmeventd/libdevmapper-event.c 2007-08-21 18:26:06.000000000 +0200
+++ new/device-mapper.1.02.23/dmeventd/libdevmapper-event.c 2007-11-27 13:26:06.000000000 +0100
@@ -722,10 +722,15 @@
dm_event_handler_set_dso(dmevh, reply_dso);
dm_event_handler_set_event_mask(dmevh, reply_mask);
- if (reply_dso)
+ if (reply_dso) {
dm_free(reply_dso);
- if (reply_uuid)
+ reply_dso = NULL;
+ }
+
+ if (reply_uuid) {
dm_free(reply_uuid);
+ reply_uuid = NULL;
+ }
dmevh->dev_name = dm_strdup(dm_task_get_name(dmt));
if (!dmevh->dev_name) {
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/device-mapper.1.02.22/dmsetup/dmsetup.c new/device-mapper.1.02.23/dmsetup/dmsetup.c
--- old/device-mapper.1.02.22/dmsetup/dmsetup.c 2007-08-21 18:26:06.000000000 +0200
+++ new/device-mapper.1.02.23/dmsetup/dmsetup.c 2007-12-05 18:05:04.000000000 +0100
@@ -90,6 +90,8 @@
#define ARGS_MAX 256
#define LOOP_TABLE_SIZE (PATH_MAX + 255)
+#define DEFAULT_DM_DEV_DIR "/dev"
+
/* FIXME Should be imported */
#ifndef DM_MAX_TYPE_NAME
# define DM_MAX_TYPE_NAME 16
@@ -97,7 +99,6 @@
/* FIXME Should be elsewhere */
#define SECTOR_SHIFT 9L
-#define DEV_PATH "/dev/"
#define err(msg, x...) fprintf(stderr, msg "\n", ##x)
@@ -119,6 +120,7 @@
NOOPENCOUNT_ARG,
NOTABLE_ARG,
OPTIONS_ARG,
+ READAHEAD_ARG,
SEPARATOR_ARG,
SHOWKEYS_ARG,
SORT_ARG,
@@ -148,6 +150,7 @@
static char *_table;
static char *_target;
static char *_command;
+static uint32_t _read_ahead_flags;
static struct dm_tree *_dtree;
static struct dm_report *_report;
static report_type_t _report_type;
@@ -323,6 +326,7 @@
static void _display_info_long(struct dm_task *dmt, struct dm_info *info)
{
const char *uuid;
+ uint32_t read_ahead;
if (!info->exists) {
printf("Device does not exist.\n");
@@ -335,6 +339,10 @@
info->suspended ? "SUSPENDED" : "ACTIVE",
info->read_only ? " (READ-ONLY)" : "");
+ /* FIXME Old value is being printed when it's being changed. */
+ if (dm_task_get_read_ahead(dmt, &read_ahead))
+ printf("Read Ahead: %" PRIu32 "\n", read_ahead);
+
if (!info->live_table && !info->inactive_table)
printf("Tables present: None\n");
else
@@ -493,6 +501,11 @@
if (_switches[NOOPENCOUNT_ARG] && !dm_task_no_open_count(dmt))
goto out;
+ if (_switches[READAHEAD_ARG] &&
+ !dm_task_set_read_ahead(dmt, _int_args[READAHEAD_ARG],
+ _read_ahead_flags))
+ goto out;
+
if (!dm_task_run(dmt))
goto out;
@@ -672,6 +685,11 @@
if (_switches[NOLOCKFS_ARG] && !dm_task_skip_lockfs(dmt))
goto out;
+ if (_switches[READAHEAD_ARG] &&
+ !dm_task_set_read_ahead(dmt, _int_args[READAHEAD_ARG],
+ _read_ahead_flags))
+ goto out;
+
r = dm_task_run(dmt);
if (r && display && _switches[VERBOSE_ARG])
@@ -1593,6 +1611,19 @@
return dm_report_field_string(rh, field, &uuid);
}
+static int _dm_read_ahead_disp(struct dm_report *rh,
+ struct dm_pool *mem __attribute((unused)),
+ struct dm_report_field *field, const void *data,
+ void *private __attribute((unused)))
+{
+ uint32_t value;
+
+ if (!dm_task_get_read_ahead((const struct dm_task *) data, &value))
+ value = 0;
+
+ return dm_report_field_uint32(rh, field, &value);
+}
+
static int _dm_info_status_disp(struct dm_report *rh,
struct dm_pool *mem __attribute((unused)),
struct dm_report_field *field, const void *data,
@@ -1848,6 +1879,10 @@
/* *INDENT-OFF* */
FIELD_F(TASK, STR, "Name", 16, dm_name, "name", "Name of mapped device.")
FIELD_F(TASK, STR, "UUID", 32, dm_uuid, "uuid", "Unique (optional) identifier for mapped device.")
+
+/* FIXME Next one should be INFO */
+FIELD_F(TASK, NUM, "RAhead", 6, dm_read_ahead, "read_ahead", "Read ahead in sectors.")
+
FIELD_F(INFO, STR, "Stat", 4, dm_info_status, "attr", "(L)ive, (I)nactive, (s)uspended, (r)ead-only, read-(w)rite.")
FIELD_F(INFO, STR, "DevNo", 5, dm_info_devno, "devno", "Device major and minor numbers")
FIELD_O(INFO, dm_info, NUM, "Maj", major, 3, int32, "major", "Block device major number.")
@@ -2010,6 +2045,7 @@
fprintf(out, "Usage:\n\n");
fprintf(out, "dmsetup [--version] [-v|--verbose [-v|--verbose ...]]\n"
" [-r|--readonly] [--noopencount] [--nolockfs]\n"
+ " [--readahead [+]<sectors>|auto|none]\n"
" [-c|-C|--columns] [-o <fields>] [-O|--sort ]\n"
" [--noheadings] [--separator <separator>]\n\n");
for (i = 0; _commands[i].name; i++)
@@ -2129,7 +2165,7 @@
* Returns the full absolute path, or NULL if the path could
* not be resolved.
*/
-static char *_get_abspath(char *path)
+static char *_get_abspath(const char *path)
{
char *_path;
@@ -2141,7 +2177,7 @@
return _path;
}
-static char *parse_loop_device_name(char *dev)
+static char *parse_loop_device_name(const char *dev, const char *dev_dir)
{
char *buf;
char *device;
@@ -2153,7 +2189,13 @@
if (!(device = _get_abspath(dev)))
goto error;
- if (strncmp(device, DEV_PATH, strlen(DEV_PATH)))
+ if (strncmp(device, dev_dir, strlen(dev_dir)))
+ goto error;
+
+ /* If dev_dir does not end in a slash, ensure that the
+ following byte in the device string is "/". */
+ if (dev_dir[strlen(dev_dir) - 1] != '/' &&
+ device[strlen(dev_dir)] != '/')
goto error;
strncpy(buf, strrchr(device, '/') + 1, (size_t) PATH_MAX);
@@ -2234,7 +2276,8 @@
return 0;
}
-static int _process_losetup_switches(const char *base, int *argc, char ***argv)
+static int _process_losetup_switches(const char *base, int *argc, char ***argv,
+ const char *dev_dir)
{
static int ind;
int c;
@@ -2297,7 +2340,7 @@
return 0;
}
- if (!(device_name = parse_loop_device_name((*argv)[0]))) {
+ if (!(device_name = parse_loop_device_name((*argv)[0], dev_dir))) {
fprintf(stderr, "%s: Could not parse loop_device %s\n",
base, (*argv)[0]);
_losetup_usage(stderr);
@@ -2344,9 +2387,9 @@
return 1;
}
-static int _process_switches(int *argc, char ***argv)
+static int _process_switches(int *argc, char ***argv, const char *dev_dir)
{
- char *base, *namebase;
+ char *base, *namebase, *s;
static int ind;
int c, r;
@@ -2366,6 +2409,7 @@
{"noopencount", 0, &ind, NOOPENCOUNT_ARG},
{"notable", 0, &ind, NOTABLE_ARG},
{"options", 1, &ind, OPTIONS_ARG},
+ {"readahead", 1, &ind, READAHEAD_ARG},
{"separator", 1, &ind, SEPARATOR_ARG},
{"showkeys", 0, &ind, SHOWKEYS_ARG},
{"sort", 1, &ind, SORT_ARG},
@@ -2388,6 +2432,7 @@
*/
memset(&_switches, 0, sizeof(_switches));
memset(&_int_args, 0, sizeof(_int_args));
+ _read_ahead_flags = 0;
namebase = strdup((*argv)[0]);
base = basename(namebase);
@@ -2422,7 +2467,7 @@
}
if (!strcmp(base, "losetup") || !strcmp(base, "dmlosetup")){
- r = _process_losetup_switches(base, argc, argv);
+ r = _process_losetup_switches(base, argc, argv, dev_dir);
free(namebase);
return r;
}
@@ -2498,6 +2543,26 @@
_switches[NOLOCKFS_ARG]++;
if ((ind == NOOPENCOUNT_ARG))
_switches[NOOPENCOUNT_ARG]++;
+ if ((ind == READAHEAD_ARG)) {
+ _switches[READAHEAD_ARG]++;
+ if (!strcasecmp(optarg, "auto"))
+ _int_args[READAHEAD_ARG] = DM_READ_AHEAD_AUTO;
+ else if (!strcasecmp(optarg, "none"))
+ _int_args[READAHEAD_ARG] = DM_READ_AHEAD_NONE;
+ else {
+ for (s = optarg; isspace(*s); s++)
+ ;
+ if (*s == '+')
+ _read_ahead_flags = DM_READ_AHEAD_MINIMUM_FLAG;
+ _int_args[READAHEAD_ARG] = atoi(optarg);
+ if (_int_args[READAHEAD_ARG] < -1) {
+ log_error("Negative read ahead value "
+ "(%d) is not understood.",
+ _int_args[READAHEAD_ARG]);
+ return 0;
+ }
+ }
+ }
if ((ind == SHOWKEYS_ARG))
_switches[SHOWKEYS_ARG]++;
if ((ind == TABLE_ARG)) {
@@ -2539,10 +2604,20 @@
{
struct command *c;
int r = 1;
+ const char *dev_dir;
(void) setlocale(LC_ALL, "");
- if (!_process_switches(&argc, &argv)) {
+ dev_dir = getenv ("DM_DEV_DIR");
+ if (dev_dir && *dev_dir) {
+ if (!dm_set_dev_dir(dev_dir)) {
+ fprintf(stderr, "Invalid DM_DEV_DIR environment variable value.\n");
+ goto out;
+ }
+ } else
+ dev_dir = DEFAULT_DM_DEV_DIR;
+
+ if (!_process_switches(&argc, &argv, dev_dir)) {
fprintf(stderr, "Couldn't process command line.\n");
goto out;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/device-mapper.1.02.22/dmsetup/Makefile.in new/device-mapper.1.02.23/dmsetup/Makefile.in
--- old/device-mapper.1.02.22/dmsetup/Makefile.in 2007-08-21 18:26:06.000000000 +0200
+++ new/device-mapper.1.02.23/dmsetup/Makefile.in 2007-08-21 22:32:30.000000000 +0200
@@ -18,6 +18,7 @@
TARGETS = dmsetup
INSTALL_TYPE = install_dynamic
+LIB_PTHREAD = @LIB_PTHREAD@
ifeq ("@STATIC_LINK@", "yes")
TARGETS += dmsetup.static
@@ -35,7 +36,8 @@
dmsetup.static: $(OBJECTS) $(interfacedir)/libdevmapper.a
$(CC) -o $@ $(OBJECTS) $(CFLAGS) $(LDFLAGS) -static \
- -L$(interfacedir) -L$(DESTDIR)/lib -ldevmapper $(LIBS)
+ -L$(interfacedir) -L$(DESTDIR)/lib -ldevmapper $(LIBS) \
+ $(LIB_PTHREAD)
install: $(INSTALL_TYPE)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/device-mapper.1.02.22/INSTALL new/device-mapper.1.02.23/INSTALL
--- old/device-mapper.1.02.22/INSTALL 2004-03-31 22:09:56.000000000 +0200
+++ new/device-mapper.1.02.23/INSTALL 2007-08-21 20:41:58.000000000 +0200
@@ -1,4 +1,4 @@
-Device Mapper installation
+Device Mapper Installation
==========================
1) Generate custom makefiles.
@@ -8,8 +8,10 @@
Example:
./configure
- If your 2.4 kernel does NOT yet contain the device-mapper source
- AND you want to try patching it automatically (described
+ 2.6 kernels now already contain basic device-mapper patches.
+
+ If you are using a 2.4 kernel that does NOT contain the device-mapper
+ mapper source AND you want to try patching it automatically (described
in step 2) then you need to tell 'configure' where your kernel
source directory is using --with-kernel-dir. Otherwise, don't
supply this parameter or you may get compilation failures.
@@ -17,8 +19,6 @@
Example:
./configure --with-kernel-dir=/usr/src/linux-2.4.26-rc1
- 2.6 kernels now already contain basic device-mapper patches
- BUT they do not support snapshots and pvmove yet.
The same userspace library and tools work with both 2.4 and 2.6 kernels
because they share the same device-mapper interface (version 4).
@@ -31,7 +31,9 @@
Other parameters let you change the installation & working directories.
-2) If your kernel does not already contain device-mapper, patch,
+2) ONLY FOR 2.4 KERNELS:
+
+ If your kernel does not already contain device-mapper, patch,
configure and build a new kernel with it.
If there is a patch for your kernel included in this package and you
@@ -77,45 +79,24 @@
The DESTDIR environment variable is supported (e.g. for packaging).
-4) If you are not using devfs then install scripts/devmap_mknod.sh to run
- either:
-
- Each time the kernel boots
- e.g. add to /etc/rc*
-
- Or whenever the device-mapper is loaded (if you built it as a module)
- e.g. add the following line to /etc/modules.conf and run depmod -a
- and use modprobe dm-mod to load the module
- post-install dm-mod /etc/init.d/devmap_mknod.sh
-
- The script creates the /dev/mapper/control device for the ioctl
- interface using the major and minor numbers that have been allocated
- dynamically. It prints a message if it works or else it fails silently
- with a non-zero status code (which you probably want to test for).
-
- To clean up the /dev/mapper directory (e.g. to remove invalid entries
- left behind after a crash) run:
-
- dmsetup mknodes
-
-
-5) You can now boot your new kernel and use 'dmsetup' to test the API.
+4) You can now use 'dmsetup' to test the API.
Read the dmsetup man page for more information.
- Or proceed to install the new LVM2 tools.
+ Or proceed to install the LVM2 tools.
-Note if you are upgrading from an old release
-=============================================
+Note if you are upgrading from a very old release
+=================================================
/dev/mapper was called /dev/device-mapper prior to 0.96.04.
- Consequently scripts/devmap_mknod.sh has been updated.
+ Consequently scripts/devmap_mknod.sh has been updated,
+ but this script is now obsolete because its functionality has
+ been incorporated into the library.
+
-Notes about the alternative filesystem interface
-================================================
-The original 2.4 filesystem interface has not been updated for many
-months, requires an old kernel, and is missing lots of features.
-
-A new filesystem interface was developed which mapped device-mapper
-operations into filesystem operations, but work on this has stopped.
-Look for "dmfs" patches at:
- http://people.sistina.com/~thornber/patches/
+Notes about the alternative device-mapper filesystem interface
+==============================================================
+The original 2.4 "dmfs" filesystem interface which mapped
+device-mapper operations into filesystem operations has been
+abandoned. It requires a very old kernel and is missing lots of
+features. The userspace code (lib/fs in CVS) was finally
+removed from the tree in 1.02.23.
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/device-mapper.1.02.22/kernel/ioctl/dm-ioctl.h new/device-mapper.1.02.23/kernel/ioctl/dm-ioctl.h
--- old/device-mapper.1.02.22/kernel/ioctl/dm-ioctl.h 2006-10-12 17:42:24.000000000 +0200
+++ new/device-mapper.1.02.23/kernel/ioctl/dm-ioctl.h 2007-12-05 15:11:26.000000000 +0100
@@ -8,9 +8,7 @@
#ifndef _LINUX_DM_IOCTL_V4_H
#define _LINUX_DM_IOCTL_V4_H
-#ifdef linux
-# include
-#endif
+#include
#define DM_DIR "mapper" /* Slashes not supported */
#define DM_MAX_TYPE_NAME 16
@@ -133,6 +131,7 @@
char name[DM_NAME_LEN]; /* device name */
char uuid[DM_UUID_LEN]; /* unique identifier for
* the block device */
+ char data[7]; /* padding or data */
};
/*
@@ -233,36 +232,6 @@
DM_DEV_SET_GEOMETRY_CMD
};
-/*
- * The dm_ioctl struct passed into the ioctl is just the header
- * on a larger chunk of memory. On x86-64 and other
- * architectures the dm-ioctl struct will be padded to an 8 byte
- * boundary so the size will be different, which would change the
- * ioctl code - yes I really messed up. This hack forces these
- * architectures to have the correct ioctl code.
- */
-#ifdef CONFIG_COMPAT
-typedef char ioctl_struct[308];
-#define DM_VERSION_32 _IOWR(DM_IOCTL, DM_VERSION_CMD, ioctl_struct)
-#define DM_REMOVE_ALL_32 _IOWR(DM_IOCTL, DM_REMOVE_ALL_CMD, ioctl_struct)
-#define DM_LIST_DEVICES_32 _IOWR(DM_IOCTL, DM_LIST_DEVICES_CMD, ioctl_struct)
-
-#define DM_DEV_CREATE_32 _IOWR(DM_IOCTL, DM_DEV_CREATE_CMD, ioctl_struct)
-#define DM_DEV_REMOVE_32 _IOWR(DM_IOCTL, DM_DEV_REMOVE_CMD, ioctl_struct)
-#define DM_DEV_RENAME_32 _IOWR(DM_IOCTL, DM_DEV_RENAME_CMD, ioctl_struct)
-#define DM_DEV_SUSPEND_32 _IOWR(DM_IOCTL, DM_DEV_SUSPEND_CMD, ioctl_struct)
-#define DM_DEV_STATUS_32 _IOWR(DM_IOCTL, DM_DEV_STATUS_CMD, ioctl_struct)
-#define DM_DEV_WAIT_32 _IOWR(DM_IOCTL, DM_DEV_WAIT_CMD, ioctl_struct)
-
-#define DM_TABLE_LOAD_32 _IOWR(DM_IOCTL, DM_TABLE_LOAD_CMD, ioctl_struct)
-#define DM_TABLE_CLEAR_32 _IOWR(DM_IOCTL, DM_TABLE_CLEAR_CMD, ioctl_struct)
-#define DM_TABLE_DEPS_32 _IOWR(DM_IOCTL, DM_TABLE_DEPS_CMD, ioctl_struct)
-#define DM_TABLE_STATUS_32 _IOWR(DM_IOCTL, DM_TABLE_STATUS_CMD, ioctl_struct)
-#define DM_LIST_VERSIONS_32 _IOWR(DM_IOCTL, DM_LIST_VERSIONS_CMD, ioctl_struct)
-#define DM_TARGET_MSG_32 _IOWR(DM_IOCTL, DM_TARGET_MSG_CMD, ioctl_struct)
-#define DM_DEV_SET_GEOMETRY_32 _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, ioctl_struct)
-#endif
-
#define DM_IOCTL 0xfd
#define DM_VERSION _IOWR(DM_IOCTL, DM_VERSION_CMD, struct dm_ioctl)
@@ -287,9 +256,9 @@
#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl)
#define DM_VERSION_MAJOR 4
-#define DM_VERSION_MINOR 11
+#define DM_VERSION_MINOR 13
#define DM_VERSION_PATCHLEVEL 0
-#define DM_VERSION_EXTRA "-ioctl (2006-10-12)"
+#define DM_VERSION_EXTRA "-ioctl (2007-10-18)"
/* Status bits */
#define DM_READONLY_FLAG (1 << 0) /* In/Out */
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/device-mapper.1.02.22/lib/.exported_symbols new/device-mapper.1.02.23/lib/.exported_symbols
--- old/device-mapper.1.02.22/lib/.exported_symbols 2007-07-28 12:48:36.000000000 +0200
+++ new/device-mapper.1.02.23/lib/.exported_symbols 2007-11-27 21:57:05.000000000 +0100
@@ -18,6 +18,7 @@
dm_task_get_names
dm_task_get_versions
dm_task_get_uuid
+dm_task_get_read_ahead
dm_task_set_ro
dm_task_set_newname
dm_task_set_event_nr
@@ -28,6 +29,7 @@
dm_task_set_uid
dm_task_set_gid
dm_task_set_mode
+dm_task_set_read_ahead
dm_task_suppress_identical_reload
dm_task_add_target
dm_task_no_flush
@@ -67,6 +69,7 @@
dm_tree_node_add_mirror_target
dm_tree_node_add_mirror_target_log
dm_tree_node_add_target_area
+dm_tree_node_set_read_ahead
dm_tree_skip_lockfs
dm_tree_use_no_flush_suspend
dm_is_dm_major
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/device-mapper.1.02.22/lib/ioctl/libdm-iface.c new/device-mapper.1.02.23/lib/ioctl/libdm-iface.c
--- old/device-mapper.1.02.22/lib/ioctl/libdm-iface.c 2007-08-21 18:26:07.000000000 +0200
+++ new/device-mapper.1.02.23/lib/ioctl/libdm-iface.c 2007-12-05 17:24:41.000000000 +0100
@@ -920,6 +920,33 @@
return 1;
}
+uint32_t dm_task_get_read_ahead(const struct dm_task *dmt, uint32_t *read_ahead)
+{
+ const char *dev_name;
+
+ *read_ahead = 0;
+
+#ifdef DM_COMPAT
+ /* Not supporting this */
+ if (_dm_version == 1)
+ return 1;
+#endif
+
+ if (!dmt->dmi.v4 || !(dmt->dmi.v4->flags & DM_EXISTS_FLAG))
+ return 0;
+
+ if (*dmt->dmi.v4->name)
+ dev_name = dmt->dmi.v4->name;
+ else if (dmt->dev_name)
+ dev_name = dmt->dev_name;
+ else {
+ log_error("Get read ahead request failed: device name unrecorded.");
+ return 0;
+ }
+
+ return get_dev_node_read_ahead(dev_name, read_ahead);
+}
+
const char *dm_task_get_name(const struct dm_task *dmt)
{
#ifdef DM_COMPAT
@@ -974,6 +1001,15 @@
return 1;
}
+int dm_task_set_read_ahead(struct dm_task *dmt, uint32_t read_ahead,
+ uint32_t read_ahead_flags)
+{
+ dmt->read_ahead = read_ahead;
+ dmt->read_ahead_flags = read_ahead_flags;
+
+ return 1;
+}
+
int dm_task_suppress_identical_reload(struct dm_task *dmt)
{
dmt->suppress_identical_reload = 1;
@@ -1267,7 +1303,9 @@
dmt->major, dmt->minor, dmi->name);
}
- if (dmt->dev_name)
+ /* FIXME Until resume ioctl supplies name, use dev_name for readahead */
+ if (dmt->dev_name && (dmt->type != DM_DEVICE_RESUME || dmt->minor < 0 ||
+ dmt->major < 0))
strncpy(dmi->name, dmt->dev_name, sizeof(dmi->name));
if (dmt->uuid)
@@ -1668,6 +1706,12 @@
rename_dev_node(dmt->dev_name, dmt->newname);
break;
+ case DM_DEVICE_RESUME:
+ /* FIXME Kernel needs to fill in dmi->name */
+ set_dev_node_read_ahead(dmt->dev_name, dmt->read_ahead,
+ dmt->read_ahead_flags);
+ break;
+
case DM_DEVICE_MKNODES:
if (dmi->flags & DM_EXISTS_FLAG)
add_dev_node(dmi->name, MAJOR(dmi->dev),
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/device-mapper.1.02.22/lib/ioctl/libdm-targets.h new/device-mapper.1.02.23/lib/ioctl/libdm-targets.h
--- old/device-mapper.1.02.22/lib/ioctl/libdm-targets.h 2007-08-21 18:26:07.000000000 +0200
+++ new/device-mapper.1.02.23/lib/ioctl/libdm-targets.h 2007-11-27 21:57:05.000000000 +0100
@@ -44,6 +44,8 @@
uid_t uid;
gid_t gid;
mode_t mode;
+ uint32_t read_ahead;
+ uint32_t read_ahead_flags;
union {
struct dm_ioctl *v4;
struct dm_ioctl_v1 *v1;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/device-mapper.1.02.22/lib/libdevmapper.h new/device-mapper.1.02.23/lib/libdevmapper.h
--- old/device-mapper.1.02.22/lib/libdevmapper.h 2007-08-21 18:26:06.000000000 +0200
+++ new/device-mapper.1.02.23/lib/libdevmapper.h 2007-12-05 17:28:19.000000000 +0100
@@ -158,6 +158,22 @@
int dm_task_suppress_identical_reload(struct dm_task *dmt);
/*
+ * Control read_ahead.
+ */
+#define DM_READ_AHEAD_AUTO UINT32_MAX /* Use kernel default readahead */
+#define DM_READ_AHEAD_NONE 0 /* Disable readahead */
+
+#define DM_READ_AHEAD_MINIMUM_FLAG 0x1 /* Value supplied is minimum */
+
+/*
+ * Read ahead is set with DM_DEVICE_CREATE with a table or DM_DEVICE_RESUME.
+ */
+int dm_task_set_read_ahead(struct dm_task *dmt, uint32_t read_ahead,
+ uint32_t read_ahead_flags);
+uint32_t dm_task_get_read_ahead(const struct dm_task *dmt,
+ uint32_t *read_ahead);
+
+/*
* Use these to prepare for a create or reload.
*/
int dm_task_add_target(struct dm_task *dmt,
@@ -376,6 +392,13 @@
const char *dlid,
uint64_t offset);
+/*
+ * Set readahead (in sectors) after loading the node.
+ */
+void dm_tree_node_set_read_ahead(struct dm_tree_node *dnode,
+ uint32_t read_ahead,
+ uint32_t read_ahead_flags);
+
/*****************************************************************************
* Library functions
*****************************************************************************/
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/device-mapper.1.02.22/lib/libdm-common.c new/device-mapper.1.02.23/lib/libdm-common.c
--- old/device-mapper.1.02.22/lib/libdm-common.c 2007-08-21 18:26:06.000000000 +0200
+++ new/device-mapper.1.02.23/lib/libdm-common.c 2007-12-05 15:11:26.000000000 +0100
@@ -21,9 +21,15 @@
#include
#include
+#include
+#include
#include
+#ifdef linux
+# include
+#endif
+
#ifdef HAVE_SELINUX
# include
#endif
@@ -118,6 +124,8 @@
dmt->gid = DEVICE_GID;
dmt->mode = DEVICE_MODE;
dmt->no_open_count = 0;
+ dmt->read_ahead = DM_READ_AHEAD_AUTO;
+ dmt->read_ahead_flags = 0;
return dmt;
}
@@ -354,15 +362,119 @@
return 1;
}
+#ifdef linux
+static int _open_dev_node(const char *dev_name)
+{
+ int fd = -1;
+ char path[PATH_MAX];
+
+ _build_dev_path(path, sizeof(path), dev_name);
+
+ if ((fd = open(path, O_RDONLY, 0)) < 0)
+ log_sys_error("open", path);
+
+ return fd;
+}
+
+int get_dev_node_read_ahead(const char *dev_name, uint32_t *read_ahead)
+{
+ int r = 1;
+ int fd;
+ long read_ahead_long;
+
+ if ((fd = _open_dev_node(dev_name)) < 0)
+ return_0;
+
+ if (ioctl(fd, BLKRAGET, &read_ahead_long)) {
+ log_sys_error("BLKRAGET", dev_name);
+ *read_ahead = 0;
+ r = 0;
+ } else {
+ *read_ahead = (uint32_t) read_ahead_long;
+ log_debug("%s: read ahead is %" PRIu32, dev_name, *read_ahead);
+ }
+
+ if (close(fd))
+ stack;
+
+ return r;
+}
+
+static int _set_read_ahead(const char *dev_name, uint32_t read_ahead)
+{
+ int r = 1;
+ int fd;
+ long read_ahead_long = (long) read_ahead;
+
+ if ((fd = _open_dev_node(dev_name)) < 0)
+ return_0;
+
+ log_debug("%s: Setting read ahead to %" PRIu32, dev_name, read_ahead);
+
+ if (ioctl(fd, BLKRASET, read_ahead_long)) {
+ log_sys_error("BLKRASET", dev_name);
+ r = 0;
+ }
+
+ if (close(fd))
+ stack;
+
+ return r;
+}
+
+static int _set_dev_node_read_ahead(const char *dev_name, uint32_t read_ahead,
+ uint32_t read_ahead_flags)
+{
+ uint32_t current_read_ahead;
+
+ if (read_ahead == DM_READ_AHEAD_AUTO)
+ return 1;
+
+ if (read_ahead == DM_READ_AHEAD_NONE)
+ read_ahead = 0;
+
+ if (read_ahead_flags & DM_READ_AHEAD_MINIMUM_FLAG) {
+ if (!get_dev_node_read_ahead(dev_name, ¤t_read_ahead))
+ return_0;
+
+ if (current_read_ahead > read_ahead) {
+ log_debug("%s: read ahead %" PRIu32
+ " below minimum of %" PRIu32,
+ dev_name, current_read_ahead, read_ahead);
+ return 1;
+ }
+ }
+
+ return _set_read_ahead(dev_name, read_ahead);
+}
+
+#else
+
+int get_dev_node_read_ahead(const char *dev_name, uint32_t *read_ahead)
+{
+ *read_ahead = 0;
+
+ return 1;
+}
+
+static int _set_dev_node_read_ahead(const char *dev_name, uint32_t read_ahead,
+ uint32_t read_ahead_flags)
+{
+ return 1;
+}
+#endif
+
typedef enum {
NODE_ADD,
NODE_DEL,
- NODE_RENAME
+ NODE_RENAME,
+ NODE_READ_AHEAD
} node_op_t;
static int _do_node_op(node_op_t type, const char *dev_name, uint32_t major,
uint32_t minor, uid_t uid, gid_t gid, mode_t mode,
- const char *old_name)
+ const char *old_name, uint32_t read_ahead,
+ uint32_t read_ahead_flags)
{
switch (type) {
case NODE_ADD:
@@ -371,6 +483,9 @@
return _rm_dev_node(dev_name);
case NODE_RENAME:
return _rename_dev_node(old_name, dev_name);
+ case NODE_READ_AHEAD:
+ return _set_dev_node_read_ahead(dev_name, read_ahead,
+ read_ahead_flags);
}
return 1;
@@ -387,6 +502,8 @@
uid_t uid;
gid_t gid;
mode_t mode;
+ uint32_t read_ahead;
+ uint32_t read_ahead_flags;
char *old_name;
char names[0];
};
@@ -400,7 +517,8 @@
static int _stack_node_op(node_op_t type, const char *dev_name, uint32_t major,
uint32_t minor, uid_t uid, gid_t gid, mode_t mode,
- const char *old_name)
+ const char *old_name, uint32_t read_ahead,
+ uint32_t read_ahead_flags)
{
struct node_op_parms *nop;
size_t len = strlen(dev_name) + strlen(old_name) + 2;
@@ -418,6 +536,8 @@
nop->uid = uid;
nop->gid = gid;
nop->mode = mode;
+ nop->read_ahead = read_ahead;
+ nop->read_ahead_flags = read_ahead_flags;
_store_str(&pos, &nop->dev_name, dev_name);
_store_str(&pos, &nop->old_name, old_name);
@@ -435,7 +555,8 @@
list_iterate_safe(noph, nopht, &_node_ops) {
nop = list_item(noph, struct node_op_parms);
_do_node_op(nop->type, nop->dev_name, nop->major, nop->minor,
- nop->uid, nop->gid, nop->mode, nop->old_name);
+ nop->uid, nop->gid, nop->mode, nop->old_name,
+ nop->read_ahead, nop->read_ahead_flags);
list_del(&nop->list);
dm_free(nop);
}
@@ -445,17 +566,28 @@
uid_t uid, gid_t gid, mode_t mode)
{
return _stack_node_op(NODE_ADD, dev_name, major, minor, uid, gid, mode,
- "");
+ "", 0, 0);
}
int rename_dev_node(const char *old_name, const char *new_name)
{
- return _stack_node_op(NODE_RENAME, new_name, 0, 0, 0, 0, 0, old_name);
+ return _stack_node_op(NODE_RENAME, new_name, 0, 0, 0, 0, 0, old_name,
+ 0, 0);
}
int rm_dev_node(const char *dev_name)
{
- return _stack_node_op(NODE_DEL, dev_name, 0, 0, 0, 0, 0, "");
+ return _stack_node_op(NODE_DEL, dev_name, 0, 0, 0, 0, 0, "", 0, 0);
+}
+
+int set_dev_node_read_ahead(const char *dev_name, uint32_t read_ahead,
+ uint32_t read_ahead_flags)
+{
+ if (read_ahead == DM_READ_AHEAD_AUTO)
+ return 1;
+
+ return _stack_node_op(NODE_READ_AHEAD, dev_name, 0, 0, 0, 0, 0, "",
+ read_ahead, read_ahead_flags);
}
void update_devs(void)
@@ -463,9 +595,25 @@
_pop_node_ops();
}
-int dm_set_dev_dir(const char *dir)
+int dm_set_dev_dir(const char *dev_dir)
{
- snprintf(_dm_dir, sizeof(_dm_dir), "%s%s", dir, DM_DIR);
+ size_t len;
+ const char *slash;
+ if (*dev_dir != '/') {
+ log_debug("Invalid dev_dir value, %s: "
+ "not an absolute name.", dev_dir);
+ return 0;
+ }
+
+ len = strlen(dev_dir);
+ slash = dev_dir[len-1] == '/' ? "" : "/";
+
+ if (snprintf(_dm_dir, sizeof _dm_dir, "%s%s%s", dev_dir, slash, DM_DIR)
+ >= sizeof _dm_dir) {
+ log_debug("Invalid dev_dir value, %s: name too long.", dev_dir);
+ return 0;
+ }
+
return 1;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/device-mapper.1.02.22/lib/libdm-common.h new/device-mapper.1.02.23/lib/libdm-common.h
--- old/device-mapper.1.02.22/lib/libdm-common.h 2007-08-21 18:26:06.000000000 +0200
+++ new/device-mapper.1.02.23/lib/libdm-common.h 2007-11-30 15:59:57.000000000 +0100
@@ -26,6 +26,9 @@
uid_t uid, gid_t gid, mode_t mode);
int rm_dev_node(const char *dev_name);
int rename_dev_node(const char *old_name, const char *new_name);
+int get_dev_node_read_ahead(const char *dev_name, uint32_t *read_ahead);
+int set_dev_node_read_ahead(const char *dev_name, uint32_t read_ahead,
+ uint32_t read_ahead_flags);
void update_devs(void);
#endif
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/device-mapper.1.02.22/lib/libdm-deptree.c new/device-mapper.1.02.23/lib/libdm-deptree.c
--- old/device-mapper.1.02.22/lib/libdm-deptree.c 2007-08-21 18:26:06.000000000 +0200
+++ new/device-mapper.1.02.23/lib/libdm-deptree.c 2007-12-03 23:48:35.000000000 +0100
@@ -95,6 +95,9 @@
uint32_t major;
uint32_t minor;
+ uint32_t read_ahead;
+ uint32_t read_ahead_flags;
+
unsigned segment_count;
struct list segs;
@@ -609,6 +612,8 @@
}
dnode->props.read_only = read_only ? 1 : 0;
+ dnode->props.read_ahead = DM_READ_AHEAD_AUTO;
+ dnode->props.read_ahead_flags = 0;
if (clear_inactive && !_node_clear_table(dnode))
return_NULL;
@@ -618,6 +623,14 @@
return dnode;
}
+void dm_tree_node_set_read_ahead(struct dm_tree_node *dnode,
+ uint32_t read_ahead,
+ uint32_t read_ahead_flags)
+{
+ dnode->props.read_ahead = read_ahead;
+ dnode->props.read_ahead_flags = read_ahead_flags;
+}
+
int dm_tree_add_dev(struct dm_tree *dtree, uint32_t major, uint32_t minor)
{
return _add_dev(dtree, &dtree->root, major, minor) ? 1 : 0;
@@ -875,6 +888,7 @@
/* FIXME Merge with _suspend_node? */
static int _resume_node(const char *name, uint32_t major, uint32_t minor,
+ uint32_t read_ahead, uint32_t read_ahead_flags,
struct dm_info *newinfo)
{
struct dm_task *dmt;
@@ -887,6 +901,13 @@
return 0;
}
+ /* FIXME Kernel should fill in name on return instead */
+ if (!dm_task_set_name(dmt, name)) {
+ log_error("Failed to set readahead device name for %s", name);
+ dm_task_destroy(dmt);
+ return 0;
+ }
+
if (!dm_task_set_major(dmt, major) || !dm_task_set_minor(dmt, minor)) {
log_error("Failed to set device number for %s resumption.", name);
dm_task_destroy(dmt);
@@ -896,6 +917,9 @@
if (!dm_task_no_open_count(dmt))
log_error("Failed to disable open_count");
+ if (!dm_task_set_read_ahead(dmt, read_ahead, read_ahead_flags))
+ log_error("Failed to set read ahead");
+
if ((r = dm_task_run(dmt)))
r = dm_task_get_info(dmt, newinfo);
@@ -1136,7 +1160,9 @@
if (!child->info.inactive_table && !child->info.suspended)
continue;
- if (!_resume_node(name, child->info.major, child->info.minor, &newinfo)) {
+ if (!_resume_node(name, child->info.major, child->info.minor,
+ child->props.read_ahead,
+ child->props.read_ahead_flags, &newinfo)) {
log_error("Unable to resume %s (%" PRIu32
":%" PRIu32 ")", name, child->info.major,
child->info.minor);
@@ -1527,7 +1553,9 @@
if (!child->info.inactive_table && !child->info.suspended)
continue;
- if (!_resume_node(name, child->info.major, child->info.minor, &newinfo)) {
+ if (!_resume_node(name, child->info.major, child->info.minor,
+ child->props.read_ahead,
+ child->props.read_ahead_flags, &newinfo)) {
log_error("Unable to resume %s (%" PRIu32
":%" PRIu32 ")", name, child->info.major,
child->info.minor);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/device-mapper.1.02.22/lib/Makefile.in new/device-mapper.1.02.23/lib/Makefile.in
--- old/device-mapper.1.02.22/lib/Makefile.in 2007-08-21 18:26:06.000000000 +0200
+++ new/device-mapper.1.02.23/lib/Makefile.in 2007-10-03 12:48:27.000000000 +0200
@@ -41,6 +41,7 @@
else
LIB_SHARED = $(interface)/libdevmapper.so
endif
+VERSIONED_SHLIB = libdevmapper.$(LIB_SUFFIX).$(LIB_VERSION)
DEFS += -DDEVICE_UID=@DEVICE_UID@ -DDEVICE_GID=@DEVICE_GID@ \
-DDEVICE_MODE=@DEVICE_MODE@
@@ -48,7 +49,7 @@
include ../make.tmpl
.PHONY: install_dynamic install_static install_include \
- install_fs install_ioctl install_ioctl_static \
+ install_ioctl install_ioctl_static \
install_pkgconfig
INSTALL_TYPE = install_dynamic
@@ -74,10 +75,6 @@
install_static: install_@interface@_static
$(LN_S) -f libdevmapper.a.$(LIB_VERSION) $(libdir)/libdevmapper.a
-install_fs: fs/libdevmapper.$(LIB_SUFFIX)
- $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< \
- $(libdir)/libdevmapper.$(LIB_SUFFIX).$(LIB_VERSION)
-
install_ioctl: ioctl/libdevmapper.$(LIB_SUFFIX)
$(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< \
$(libdir)/libdevmapper.$(LIB_SUFFIX).$(LIB_VERSION)
@@ -90,10 +87,13 @@
$(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< \
$(libdir)/libdevmapper.a.$(LIB_VERSION)
+$(VERSIONED_SHLIB): %.$(LIB_SUFFIX).$(LIB_VERSION): $(interface)/%.$(LIB_SUFFIX)
+ rm -f $@
+ $(LN_S) $< $@
+
.PHONY: distclean_lib distclean
-distclean_lib:
+distclean_lib:
$(RM) libdevmapper.pc
distclean: distclean_lib
-
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/device-mapper.1.02.22/make.tmpl.in new/device-mapper.1.02.23/make.tmpl.in
--- old/device-mapper.1.02.22/make.tmpl.in 2007-01-11 17:23:21.000000000 +0100
+++ new/device-mapper.1.02.23/make.tmpl.in 2007-10-03 12:48:27.000000000 +0200
@@ -1,7 +1,7 @@
# @configure_input@
#
# Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
-# Copyright (C) 2004 Red Hat, Inc. All rights reserved.
+# Copyright (C) 2004, 2007 Red Hat, Inc. All rights reserved.
#
# This file is part of the device-mapper userspace tools.
#
@@ -123,7 +123,7 @@
.PHONY: $(SUBDIRS) $(SUBDIRS.install) $(SUBDIRS.clean) $(SUBDIRS.distclean)
.PHONY: $(SUBDIRS.pofile)
-TARGETS += $(LIB_SHARED) $(LIB_STATIC)
+TARGETS += $(LIB_SHARED) $(LIB_STATIC) $(VERSIONED_SHLIB)
all: $(SUBDIRS) $(TARGETS)
@@ -210,4 +210,3 @@
endif
endif
endif
-
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/device-mapper.1.02.22/man/dmsetup.8 new/device-mapper.1.02.23/man/dmsetup.8
--- old/device-mapper.1.02.22/man/dmsetup.8 2007-01-29 20:35:24.000000000 +0100
+++ new/device-mapper.1.02.23/man/dmsetup.8 2007-12-05 18:05:04.000000000 +0100
@@ -114,6 +114,14 @@
.IP \fB-r|--readonly
.br
Set the table being loaded read-only.
+.IP \fB--readahead\ [+]<sectors>|auto|none
+.br
+Specify read ahead size in units of sectors.
+The default value is "auto" which allows the kernel to choose
+a suitable value automatically. The + prefix lets you
+specify a minimum value which will not be used if it is
+smaller than the value chosen by the kernel.
+"None" is equivalent to specifying zero.
.IP \fB--table\ <table>
.br
Specify a one-line table directly on the command line.
@@ -341,6 +349,12 @@
.br
2056320 2875602 linear /dev/hdb 1028160
+.SH ENVIRONMENT VARIABLES
+.TP
+\fBDM_DEV_DIR\fP
+The device directory name.
+Defaults to "/dev" and must be an absolute path.
+
.SH AUTHORS
Original version: Joe Thornber (thornber@sistina.com)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/device-mapper.1.02.22/VERSION new/device-mapper.1.02.23/VERSION
--- old/device-mapper.1.02.22/VERSION 2007-08-21 18:39:32.000000000 +0200
+++ new/device-mapper.1.02.23/VERSION 2007-12-05 18:09:18.000000000 +0100
@@ -1 +1 @@
-1.02.22 (2007-08-21)
+1.02.23 (2007-12-05)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/device-mapper.1.02.22/WHATS_NEW new/device-mapper.1.02.23/WHATS_NEW
--- old/device-mapper.1.02.22/WHATS_NEW 2007-08-21 18:33:18.000000000 +0200
+++ new/device-mapper.1.02.23/WHATS_NEW 2007-12-05 18:05:04.000000000 +0100
@@ -1,3 +1,14 @@
+Version 1.02.23 - 5th December 2007
+===================================
+ Update dm-ioctl.h after removal of compat code.
+ Add readahead support to libdevmapper and dmsetup.
+ Fix double free in a libdevmapper-event error path.
+ Fix configure --with-dmeventd-path substitution.
+ Allow a DM_DEV_DIR environment variable to override /dev.
+ Create a libdevmapper.so.$LIB_VERSION symlink within the build tree.
+ Avoid static link failure with some SELinux libraries that require libpthread.
+ Remove obsolete dmfs code from tree and update INSTALL.
+
Version 1.02.22 - 21st August 2007
==================================
Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1.
++++++ device-mapper-nochown.patch ++++++
--- /var/tmp/diff_new_pack.L18617/_old 2007-12-10 23:46:43.000000000 +0100
+++ /var/tmp/diff_new_pack.L18617/_new 2007-12-10 23:46:43.000000000 +0100
@@ -54,14 +54,9 @@
$(includedir)/libdevmapper.h
install_dynamic: install_@interface@
-@@ -74,19 +74,19 @@
+@@ -75,15 +75,15 @@
install_static: install_@interface@_static
- install_fs: fs/libdevmapper.$(LIB_SUFFIX)
-- $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< \
-+ $(INSTALL) -D -m 555 $(STRIP) $< \
- $(libdir)/libdevmapper.$(LIB_SUFFIX).$(LIB_VERSION)
-
install_ioctl: ioctl/libdevmapper.$(LIB_SUFFIX)
- $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< \
+ $(INSTALL) -D -m 555 $(STRIP) $< \
@@ -77,7 +72,7 @@
+ $(INSTALL) -D -m 555 $(STRIP) $< \
$(libdir)/libdevmapper.a
- .PHONY: distclean_lib distclean
+ $(VERSIONED_SHLIB): %.$(LIB_SUFFIX).$(LIB_VERSION): $(interface)/%.$(LIB_SUFFIX)
--- man/Makefile.in
+++ man/Makefile.in
@@ -26,6 +26,6 @@
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org