public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
* LVM2 ./WHATS_NEW lib/device/dev-io.c
@ 2010-09-22 22:31 agk
  0 siblings, 0 replies; 7+ messages in thread
From: agk @ 2010-09-22 22:31 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2010-09-22 22:31:46

Modified files:
	.              : WHATS_NEW 
	lib/device     : dev-io.c 

Log message:
	Replace alloca with dm_malloc in _aligned_io.
	
	(This section of code dates from 2.4 and could be written more efficiently nowadays.)

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1733&r2=1.1734
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/device/dev-io.c.diff?cvsroot=lvm2&r1=1.69&r2=1.70

--- LVM2/WHATS_NEW	2010/09/22 13:45:21	1.1733
+++ LVM2/WHATS_NEW	2010/09/22 22:31:45	1.1734
@@ -1,5 +1,6 @@
 Version 2.02.74 - 
 =====================================
+  Replace alloca with dm_malloc in _aligned_io.
   Fix partial mode operations for lvm1 metadata format.
   Track recursive filter iteration to avoid refreshing while in use. (2.02.56)
   Revert to old glibc vsnprintf behaviour in emit_to_buffer() to catch overflow.
--- LVM2/lib/device/dev-io.c	2010/07/09 15:34:42	1.69
+++ LVM2/lib/device/dev-io.c	2010/09/22 22:31:46	1.70
@@ -164,10 +164,11 @@
 static int _aligned_io(struct device_area *where, void *buffer,
 		       int should_write)
 {
-	void *bounce;
+	void *bounce, *bounce_buf;
 	unsigned int block_size = 0;
 	uintptr_t mask;
 	struct device_area widened;
+	int r = 0;
 
 	if (!(where->dev->flags & DEV_REGULAR) &&
 	    !_get_block_size(where->dev, &block_size))
@@ -185,8 +186,8 @@
 		return _io(where, buffer, should_write);
 
 	/* Allocate a bounce buffer with an extra block */
-	if (!(bounce = alloca((size_t) widened.size + block_size))) {
-		log_error("Bounce buffer alloca failed");
+	if (!(bounce_buf = bounce = dm_malloc((size_t) widened.size + block_size))) {
+		log_error("Bounce buffer malloc failed");
 		return 0;
 	}
 
@@ -199,7 +200,7 @@
 	/* channel the io through the bounce buffer */
 	if (!_io(&widened, bounce, 0)) {
 		if (!should_write)
-			return_0;
+			goto_out;
 		/* FIXME pre-extend the file */
 		memset(bounce, '\n', widened.size);
 	}
@@ -209,13 +210,18 @@
 		       (size_t) where->size);
 
 		/* ... then we write */
-		return _io(&widened, bounce, 1);
+		r = _io(&widened, bounce, 1);
+		goto_out;
 	}
 
 	memcpy(buffer, bounce + (where->start - widened.start),
 	       (size_t) where->size);
 
-	return 1;
+	r = 1;
+
+out:
+	dm_free(bounce_buf);
+	return r;
 }
 
 static int _dev_get_size_file(const struct device *dev, uint64_t *size)


^ permalink raw reply	[flat|nested] 7+ messages in thread

* LVM2 ./WHATS_NEW lib/device/dev-io.c
@ 2011-12-21 13:24 zkabelac
  0 siblings, 0 replies; 7+ messages in thread
From: zkabelac @ 2011-12-21 13:24 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-12-21 13:24:25

Modified files:
	.              : WHATS_NEW 
	lib/device     : dev-io.c 

Log message:
	Drop extra stat before open of device
	
	Since the !(dev->flags & DEV_REGULAR) code path just called
	dev_name_confirmed() which has just called 'stat()' inside,
	remove duplicate second stat() call here.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2212&r2=1.2213
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/device/dev-io.c.diff?cvsroot=lvm2&r1=1.78&r2=1.79

--- LVM2/WHATS_NEW	2011/12/21 13:21:09	1.2212
+++ LVM2/WHATS_NEW	2011/12/21 13:24:24	1.2213
@@ -1,5 +1,6 @@
 Version 2.02.89 - 
 ==================================
+  Drop extra stat call before opening device.
   Reduce number of lstat calls when selecting device alias.
   Add function to inialize common structure device members.
   Always zalloc device structure during initialization.
--- LVM2/lib/device/dev-io.c	2011/05/28 09:48:14	1.78
+++ LVM2/lib/device/dev-io.c	2011/12/21 13:24:25	1.79
@@ -449,17 +449,6 @@
 	else if (!(name = dev_name_confirmed(dev, quiet)))
 		return_0;
 
-	if (!(dev->flags & DEV_REGULAR)) {
-		if (stat(name, &buf) < 0) {
-			log_sys_error("%s: stat failed", name);
-			return 0;
-		}
-		if (buf.st_rdev != dev->dev) {
-			log_error("%s: device changed", name);
-			return 0;
-		}
-	}
-
 #ifdef O_DIRECT_SUPPORT
 	if (direct) {
 		if (!(dev->flags & DEV_O_DIRECT_TESTED))


^ permalink raw reply	[flat|nested] 7+ messages in thread

* LVM2 ./WHATS_NEW lib/device/dev-io.c
@ 2007-09-07 11:24 meyering
  0 siblings, 0 replies; 7+ messages in thread
From: meyering @ 2007-09-07 11:24 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	meyering@sourceware.org	2007-09-07 11:24:19

Modified files:
	.              : WHATS_NEW 
	lib/device     : dev-io.c 

Log message:
	Include strerror string in dev_open_flags' stat failure message.
	* lib/device/dev-io.c (dev_open_flags):
	Use log_sys_error after failed stat to report strerror(errno).
	Use a slightly different diagnostic to report mismatched device number.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.701&r2=1.702
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/device/dev-io.c.diff?cvsroot=lvm2&r1=1.58&r2=1.59

--- LVM2/WHATS_NEW	2007/08/30 20:30:41	1.701
+++ LVM2/WHATS_NEW	2007/09/07 11:24:19	1.702
@@ -1,12 +1,13 @@
 Version 2.02.29 -
 ==================================
+  Include strerror string in dev_open_flags' stat failure message.
   Move guts of pvresize into library.
   Avoid error when --corelog is provided without --mirrorlog. (2.02.28)
   Correct --mirrorlog argument name in man pages (not --log).
   Clear MIRROR_NOTSYNCED LV flag when converting from mirror to linear.
   Modify lvremove to prompt for removal if LV active on other cluster nodes.
   Add '-f' to vgremove to force removal of VG even if LVs exist.
-  
+
 Version 2.02.28 - 24th August 2007
 ==================================
   Fix clvmd logging so you can get lvm-level debugging out of it.
--- LVM2/lib/device/dev-io.c	2007/08/20 20:55:25	1.58
+++ LVM2/lib/device/dev-io.c	2007/09/07 11:24:19	1.59
@@ -359,10 +359,15 @@
 		return 0;
 	}
 
-	if (!(dev->flags & DEV_REGULAR) &&
-	    ((stat(name, &buf) < 0) || (buf.st_rdev != dev->dev))) {
-		log_error("%s: stat failed: Has device name changed?", name);
-		return 0;
+	if (!(dev->flags & DEV_REGULAR)) {
+		if (stat(name, &buf) < 0) {
+			log_sys_error("%s: stat failed", name);
+			return 0;
+		}
+		if (buf.st_rdev != dev->dev) {
+			log_error("%s: device changed", name);
+			return 0;
+		}
 	}
 
 #ifdef O_DIRECT_SUPPORT


^ permalink raw reply	[flat|nested] 7+ messages in thread

* LVM2 ./WHATS_NEW lib/device/dev-io.c
@ 2005-11-23 16:07 agk
  0 siblings, 0 replies; 7+ messages in thread
From: agk @ 2005-11-23 16:07 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2005-11-23 16:07:40

Modified files:
	.              : WHATS_NEW 
	lib/device     : dev-io.c 

Log message:
	Fix open RO->RW promotions.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.325&r2=1.326
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/device/dev-io.c.diff?cvsroot=lvm2&r1=1.51&r2=1.52


^ permalink raw reply	[flat|nested] 7+ messages in thread

* LVM2 ./WHATS_NEW lib/device/dev-io.c
@ 2004-12-21 20:23 agk
  0 siblings, 0 replies; 7+ messages in thread
From: agk @ 2004-12-21 20:23 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2004-12-21 20:23:17

Modified files:
	.              : WHATS_NEW 
	lib/device     : dev-io.c 

Log message:
	Fix device reference counting on re-opens.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.137&r2=1.138
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/device/dev-io.c.diff?cvsroot=lvm2&r1=1.43&r2=1.44


^ permalink raw reply	[flat|nested] 7+ messages in thread

* LVM2 ./WHATS_NEW lib/device/dev-io.c
@ 2004-12-09 16:56 agk
  0 siblings, 0 replies; 7+ messages in thread
From: agk @ 2004-12-09 16:56 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2004-12-09 16:56:51

Modified files:
	.              : WHATS_NEW 
	lib/device     : dev-io.c 

Log message:
	Extend dev_open logging.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.122&r2=1.123
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/device/dev-io.c.diff?cvsroot=lvm2&r1=1.39&r2=1.40


^ permalink raw reply	[flat|nested] 7+ messages in thread

* LVM2 ./WHATS_NEW lib/device/dev-io.c
@ 2004-09-14 22:23 agk
  0 siblings, 0 replies; 7+ messages in thread
From: agk @ 2004-09-14 22:23 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2004-09-14 22:23:24

Modified files:
	.              : WHATS_NEW 
	lib/device     : dev-io.c 

Log message:
	Use O_NOATIME on devices if available.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.84&r2=1.85
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/device/dev-io.c.diff?cvsroot=lvm2&r1=1.38&r2=1.39


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-12-21 13:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-22 22:31 LVM2 ./WHATS_NEW lib/device/dev-io.c agk
  -- strict thread matches above, loose matches on Subject: below --
2011-12-21 13:24 zkabelac
2007-09-07 11:24 meyering
2005-11-23 16:07 agk
2004-12-21 20:23 agk
2004-12-09 16:56 agk
2004-09-14 22:23 agk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).