shared by several fnodes when the file is simultaneonsly opened by
several callers and different "attributes" (a.k.a. resource forks)
are requested. They have been converted to use lockmgr()-style locking.
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
changes: cache_lookup() now returns -1 if not successful; for
the '.' case, 'error' haven't been cleared to 0,
so that ntfs_lookup() itself returned -1 , resulting to
nasty "leaf should be empty" panic early after
routines - avoids potential DoS attack and closes an easy way to force
the kernel to panic
* for read(), DTRT WRT offset bigger than file size
ntfs_strategy(): adapt to ntfs_readattr() change
ntfs_readdir(): use ntfs_u28() to translate the file name characters
to 8bit encoding, avoid excessive intendation, reformat the
debug messages slightly
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
* return EROFS for volume mounted RO when the nameiop is DELETE or RENAME
(the same way ufs_lookup() does)
* add explicit call to cache_lookup() on NetBSD (handled by generic VFS
layer in FreeBSD)
* avoid using strncmp() when checking whether the name is . or ..
* fix locking of parent directory for ISDOTDOT case
* call cache_enter() always (even for . and ..)
* vnodeops array: add entry for vop_fcntl_desc, remove unnecessary casts
Reviewed by: wrstuden
Tested by: jdolecek
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