From owner-cvs-all@FreeBSD.ORG Fri May 6 00:06:07 2005 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3273016A4CE; Fri, 6 May 2005 00:06:07 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 209E443DB6; Fri, 6 May 2005 00:06:07 +0000 (GMT) (envelope-from robert@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j46066Mq095623; Fri, 6 May 2005 00:06:07 GMT (envelope-from robert@repoman.freebsd.org) Received: (from robert@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j46066sA095622; Fri, 6 May 2005 00:06:06 GMT (envelope-from robert) Message-Id: <200505060006.j46066sA095622@repoman.freebsd.org> From: Robert Drehmel Date: Fri, 6 May 2005 00:06:06 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/fs/ntfs ntfs_subr.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2005 00:06:07 -0000 robert 2005-05-06 00:06:06 UTC FreeBSD src repository Modified files: sys/fs/ntfs ntfs_subr.c Log: Fix our NTFS readdir function. To check a directory's in-use bitmap bit by bit, we use a pointer to an 8 bit wide unsigned value. The index used to dereference this pointer is calculated by shifting the bit index right 3 bits. Then we do a logical AND with the bit# represented by the lower 3 bits of the bit index. This is an idiomatic way of iterating through a bit map with simple bitwise operations. This commit fixes the bug that we only checked bits 3:0 of each 8 bit chunk, because we only used bits 1:0 of the bit index for the bit# in the current 8 bit value. This resulted in files not being returned by getdirentries(2). Change the type of the bit map pointer from `char *' to `u_int8_t *'. Revision Changes Path 1.37 +3 -3 src/sys/fs/ntfs/ntfs_subr.c