Bug 142401 - [ntfs] [patch] Minor updates to NTFS from NetBSD
Summary: [ntfs] [patch] Minor updates to NTFS from NetBSD
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 8.0-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-fs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-07 03:20 UTC by Pedro F. Giffuni
Modified: 2012-01-03 19:10 UTC (History)
0 users

See Also:


Attachments
file.diff (1.55 KB, patch)
2010-01-07 03:20 UTC, Pedro F. Giffuni
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pedro F. Giffuni 2010-01-07 03:20:07 UTC
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.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2010-01-07 04:09:12 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-fs

Over to maintainer(s).
Comment 2 Pedro F. Giffuni 2011-03-26 17:06:26 UTC
Let's just close this, it's rather cosmetic and
uninteresting to FreeBSD.
Comment 3 Jaakko Heinonen freebsd_committer freebsd_triage 2011-04-03 09:39:24 UTC
State Changed
From-To: open->closed

Closed at submitter's request.
Comment 4 dfilter service freebsd_committer freebsd_triage 2012-01-03 19:09:11 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"