Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 May 2005 00:06:06 +0000 (UTC)
From:      Robert Drehmel <robert@FreeBSD.org>
To:        src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   cvs commit: src/sys/fs/ntfs ntfs_subr.c
Message-ID:  <200505060006.j46066sA095622@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



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