Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Jan 2010 03:15:46 GMT
From:      "Pedro F. Giffuni" <giffunip@tutopia.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/142401: Minor updates to NTFS from NetBSD
Message-ID:  <201001070315.o073FkTN032716@www.freebsd.org>
Resent-Message-ID: <201001070320.o073K7DF016254@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         142401
>Category:       kern
>Synopsis:       Minor updates to NTFS from NetBSD
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan 07 03:20:07 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Pedro F. Giffuni
>Release:        8.0-RELEASE
>Organization:
>Environment:
FreeBSD mogwai.giffuni.net 8.0-RELEASE FreeBSD 8.0-RELEASE #12: Tue Dec  1 23:31:27 UTC 2009     pedro@mogwai.giffuni.net:/usr/src/sys/i386/compile/GENERIC  i386

>Description:
I caught some insignificant changes from NetBSD but it's good to keep both
codebases as near as possible:

- bzero -> memset
- rename variables to avoid shadowing.

>How-To-Repeat:

>Fix:
diff -ru ntfs.orig/ntfs_compr.c ntfs/ntfs_compr.c
--- ntfs.orig/ntfs_compr.c	2010-01-06 14:23:19.000000000 +0000
+++ ntfs/ntfs_compr.c	2010-01-06 14:28:18.000000000 +0000
@@ -42,7 +42,7 @@
 
 int
 ntfs_uncompblock(
-	u_int8_t * buf,
+	u_int8_t * dbuf,
 	u_int8_t * cbuf)
 {
 	u_int32_t       ctag;
@@ -60,8 +60,8 @@
 			dprintf(("ntfs_uncompblock: len: %x instead of %d\n",
 			    len, 0xfff));
 		}
-		memcpy(buf, cbuf + 2, len + 1);
-		bzero(buf + len + 1, NTFS_COMPBLOCK_SIZE - 1 - len);
+		memcpy(dbuf, cbuf + 2, len + 1);
+		memset(dbuf + len + 1, 0, NTFS_COMPBLOCK_SIZE - 1 - len);
 		return len + 3;
 	}
 	cpos = 2;
@@ -78,12 +78,12 @@
 				boff = -1 - (GET_UINT16(cbuf + cpos) >> dshift);
 				blen = 3 + (GET_UINT16(cbuf + cpos) & lmask);
 				for (j = 0; (j < blen) && (pos < NTFS_COMPBLOCK_SIZE); j++) {
-					buf[pos] = buf[pos + boff];
+					dbuf[pos] = dbuf[pos + boff];
 					pos++;
 				}
 				cpos += 2;
 			} else {
-				buf[pos++] = cbuf[cpos++];
+				dbuf[pos++] = cbuf[cpos++];
 			}
 			ctag >>= 1;
 		}
diff -ru ntfs.orig/ntfs_subr.c ntfs/ntfs_subr.c
--- ntfs.orig/ntfs_subr.c	2010-01-06 14:23:19.000000000 +0000
+++ ntfs/ntfs_subr.c	2010-01-06 14:33:39.000000000 +0000
@@ -1639,7 +1639,7 @@
 					for(; remains; remains--)
 						uiomove("", 1, uio);
 				} else 
-					bzero(data, tocopy);
+					memset(data, 0, tocopy);
 				data = data + tocopy;
 			}
 			cnt++;
@@ -1786,7 +1786,7 @@
 						uiomove("", 1, uio);
 				}
 				else
-					bzero(data, tocopy);
+					memset(data, 0, tocopy);
 			} else {
 				error = ntfs_uncompunit(ntmp, uup, cup);
 				if (error)


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001070315.o073FkTN032716>