Previous revision mistakely removed fix for DIAGNOSTIC "getblk: block size
invariant failed" panic, incorporated in rev. 1.5. The problem there
has been that depending on 'off', the code did bread() of 512 and after that
1024 bytes for same 'blkno'. Fix this differently than in rev. 1.5 -
if 'off' would bump the read over to next device block, trim the read to
end on block boundary and read rest in next loop iteration. This seems
to fix the problem, and avoids the performance hit rev. 1.5 incurred.
Fix bug in code handling holes for reads via read(2) - a variable
was incremented instead of decremented.
to recode Unicode names to other representation, like encoding form
or national character/code sets. This replaces the ugly NTFS_U28() hack.
Use these hooks to encode the filenames to UTF-8.
scan of all directory entries; the mangled file name we return to
userland on getdents(2) may end up being unsearchable otherwise
This change is useful even through we will soon change to encode the
NTFS file names to utf-8 - we want to support recoding of filenames to
national 8bit charsets eventually.
while here, remove some unnecessary casts, change NTFS_U28() macro so that
the mangled filename doesn't contain control characters and use malloc()/free()
instead MALLOC()/FREE() for rdbuf buffer
lock counts consistent. DIAGNOSTIC checks will barf otherwise.
XXX ntfs_ntput should not free the node, the reclaim vop should do it
XXX why does the ntfs code do its own internal locking?
ntnode->ntmp->ntm_* values
ntfs_inactivate(): as NTFS doesn't support any filesystem changes,
it's not needed to check whether the file handle is stale;
the check was bogus anyway - besides the value of vp->v_usecount
was checked with unlocked vnode, the vnode was unnecessarily
_always_ recycled when the filesystem containing it has been
mounted with mask (-i parameter to mount_ntfs(1))
not specified or 0 -- unbelievable, but true
ntfs_reclaim(): don't call VOP_UNLOCK() even on FreeBSD - it's not
done for any other their filesystem, so it should not be done even
for NTFS
ntfs_access(): remove the commented-out check for immutable flag, it doesn't
make sense for NTFS
other miscelaneous cosmetic cleanups
VOP__UNLOCK() macros, g/c VOP__LOCK()
add some comments
use LK_RETRY flag as appropriate
g/c the FreeBSD vnode_pager_uncache() staff, as was done in FreeBSD tree a while
ago (actually, when they merged the first round of NetBSD patches)
use VN_LOCK() & VOP__UNLOCK() consistently throughout the code instead
of vn_lock() and VOP_UNLOCK()
minor whitespace changes
make ntfs_ntref() real function and properly lock ip->i_interlock when
updating ip->i_usecount
g/c ntfs_uustricmp()
make ntfs_uastr[i]cmp() static, rename arguments to be a bit more mnemonic
add couple of casts to NTFS_TOUPPER() and ntfs_uastr[i]cmp() - this
corrects couple of cases when open()/stat() failed for
files which apparently existed and even showed in ls output
ntfs_ntlookup(): initialize ip properly if ntnode is found in hash table,
so that debug prints doesn't print garbage in that case
some whitespace policy
guard the setting and checking of i_usecount by simplelock; as
situation where there would be several users of same ntnode is
extremery rare, it's not worth the efford to change the code to
hold the (exclusive) lock only when it's needed
* in struct fnode, g/c f_dev & f_type (former is already in ntnode,
latter is in parent vnode), move f_devvp from struct fnode into
struct ntnode (no reason this should be copied in each fnode)
* f_lock is only needed for FreeBSD (for their totally disgusting
and insane way of doing generic vnode locking)
* g/c f_mp, it was write-only
* some comments added
ntfs_findvattr(), AALPCMP --> NTFS_AALPCMP, avoid excessive
intendation, fix debug printf when the attribute is not found
to print only first namelen characters of name
some minor KNF and const poisoning
ntfs_ntlookupattr(): make it static, collapse duplicated code
ntfs_ntlookupfile(): avoid memory leak, explicitly set error to 0 when
returning success
kill some bogus comments
uio parameter; if it's not null, the data are copied directly
into/from the user buffer via uiomove()
new macro NTFS_U28() and function ntfs_u28() to convert between Unicode
and 8bit encoding; all it does currently is getting lower 8bit
of the Unicode char and subtituting '_' for it if the result would be 0;
use the macro within NTFS_TOUPPER() macro and in ntfs_uastrcmp()
g/c the (ntfsmount *) parametr to ntfs_u*astr[i]cmp() functions, it's no
longer needed
avoid excessive intendation
is mounted and all ntfs volumes share it; the space occupied by the
table is freed upon last ntfs volumen umount. Saves 128KB for every
ntfs volume mounted.
XXX for now, read just first 256 entries - no more would be currently used
anyway
worth of data under NetBSD -- FreeBSD bread() seems to be able to
return more data and code counted with it
it's possible to actually mount NTFS volume now