From nobody@FreeBSD.org  Thu Jan  7 03:15:47 2010
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8730D106568F
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  7 Jan 2010 03:15:47 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 5CB528FC08
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  7 Jan 2010 03:15:47 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o073Fk7F032717
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 7 Jan 2010 03:15:46 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id o073FkTN032716;
	Thu, 7 Jan 2010 03:15:46 GMT
	(envelope-from nobody)
Message-Id: <201001070315.o073FkTN032716@www.freebsd.org>
Date: Thu, 7 Jan 2010 03:15:46 GMT
From: "Pedro F. Giffuni" <giffunip@tutopia.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Minor updates to NTFS from NetBSD
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         142401
>Category:       kern
>Synopsis:       [ntfs] [patch] Minor updates to NTFS from NetBSD
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-fs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan 07 03:20:07 UTC 2010
>Closed-Date:    Sun Apr 03 08:39:25 UTC 2011
>Last-Modified:  Tue Jan  3 19:10:10 UTC 2012
>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:
Responsible-Changed-From-To: freebsd-bugs->freebsd-fs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Thu Jan 7 04:09:12 UTC 2010 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=142401 

From: "Pedro F. Giffuni" <giffunip@tutopia.com>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/142401: [ntfs] [patch] Minor updates to NTFS from NetBSD
Date: Sat, 26 Mar 2011 10:06:26 -0700 (PDT)

 Let's just close this, it's rather cosmetic and
 uninteresting to FreeBSD.
 
 
       
State-Changed-From-To: open->closed 
State-Changed-By: jh 
State-Changed-When: Sun Apr 3 08:39:24 UTC 2011 
State-Changed-Why:  
Closed at submitter's request. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=142401 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/142401: commit references a PR
Date: Tue,  3 Jan 2012 19:09:11 +0000 (UTC)

 Author: pfg
 Date: Tue Jan  3 19:09:01 2012
 New Revision: 229407
 URL: http://svn.freebsd.org/changeset/base/229407
 
 Log:
   Minor cleanups to ntfs code
   
   bzero -> memset
   rename variables to avoid shadowing.
   
   PR:		142401
   Obtained from:	NetBSD
   Approved by	jhb (mentor)
 
 Modified:
   head/sys/fs/ntfs/ntfs_compr.c
   head/sys/fs/ntfs/ntfs_subr.c
 
 Modified: head/sys/fs/ntfs/ntfs_compr.c
 ==============================================================================
 --- head/sys/fs/ntfs/ntfs_compr.c	Tue Jan  3 19:01:54 2012	(r229406)
 +++ head/sys/fs/ntfs/ntfs_compr.c	Tue Jan  3 19:09:01 2012	(r229407)
 @@ -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 @@ ntfs_uncompblock(
  			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 @@ ntfs_uncompblock(
  				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;
  		}
 
 Modified: head/sys/fs/ntfs/ntfs_subr.c
 ==============================================================================
 --- head/sys/fs/ntfs/ntfs_subr.c	Tue Jan  3 19:01:54 2012	(r229406)
 +++ head/sys/fs/ntfs/ntfs_subr.c	Tue Jan  3 19:09:01 2012	(r229407)
 @@ -1636,7 +1636,7 @@ ntfs_readntvattr_plain(
  					for(; remains; remains--)
  						uiomove("", 1, uio);
  				} else 
 -					bzero(data, tocopy);
 +					memset(data, 0, tocopy);
  				data = data + tocopy;
  			}
  			cnt++;
 @@ -1783,7 +1783,7 @@ ntfs_readattr(
  						uiomove("", 1, uio);
  				}
  				else
 -					bzero(data, tocopy);
 +					memset(data, 0, tocopy);
  			} else {
  				error = ntfs_uncompunit(ntmp, uup, cup);
  				if (error)
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
