Commit Graph

70 Commits

Author SHA1 Message Date
jdolecek 96a3d5b1cd install only headers which are actually used when compiling userland 1999-11-01 20:40:48 +00:00
jdolecek 94b1798c8c struct ntnode: g/c i_uid, i_gid, i_mode - use directly appropriate
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
1999-10-31 19:45:26 +00:00
jdolecek e0909d1564 adjust the Unicode support comment
NTFS ACL support would be nice, though it's real world usefullnes would
be probably very limited
1999-10-31 18:31:39 +00:00
jdolecek 45ddf3387a *sigh* - don't try to be more clever than other filesystems and
don't use LK_RETRY in ntfs_lookup() when re-locking the directory
vnode
1999-10-27 20:56:41 +00:00
jdolecek 5ab36cc0e0 ntfs_lookup(): use cnp->cn_proc as the third parameter to VN_LOCK(), so that
the code will DTRT on FreeBSD
1999-10-25 21:18:37 +00:00
jdolecek 9134b1791c partly backup previous: don't use LK_RETRY when calling ntfs_vgetex() 1999-10-25 21:17:21 +00:00
jdolecek 2e860c12d3 pass the lock flags in the NetBSD version of VN_LOCK(), VGET(),
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
1999-10-25 19:08:26 +00:00
enami fee96e1746 Check if the type of device node isn't VBAD before touching v_specinfo. If
the device vnode is revoked, the field is NULL and touching it causes null
pointer derefercence.
1999-10-20 14:32:09 +00:00
enami cbf7cef809 No need to clear SI_MOUNTEDON on mount failure. We make sure that it
is not set on start of mounting and never set unless success to mount.
1999-10-20 14:25:42 +00:00
jdolecek b30fcf9a56 lock the device vnode before calling VOP_CLOSE() only under NetBSD
some minor cleanup in ntfs_unmount()
1999-10-17 10:18:15 +00:00
wrstuden e682a080e9 In spec_close(), if we're not doing a non-blocking close and VXLOCK is
not set, unlock the vnode before calling the device's close routine and
relock it after it returns. tty close routines will sleep waiting for
buffers to drain, which won't happen often times as the other side needs
to grab the vnode lock first.

Make all unmount routines lock the device vnode before calling VOP_CLOSE().
1999-10-16 23:53:26 +00:00
jdolecek 9516650226 update debug printfs to use "ntfs_loadntnode" instead of "ntfs_loadnode"
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
1999-10-10 14:48:37 +00:00
jdolecek 8f6f5c74df s/ntfs_loadnode/ntfs_loadntnode()/ 1999-10-10 14:20:33 +00:00
jdolecek af47d3d9a9 ntfs_lookup()
* print just the relevant part of cnp->cn_nameptr in debug printf
	* if ntfs_ntlookupfile() returned with error, print the returned
	  error if debugging
1999-10-10 14:19:54 +00:00
jdolecek 105c2e3075 ntfs_nt{get|put|rele}() really are necessary, since ntnode may be
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.
1999-10-09 14:29:36 +00:00
jdolecek cfb7bf7fca * convert ntfs_nt{get|put|rele}() to lockmgr()-style locking and
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)
1999-10-09 14:27:42 +00:00
jdolecek 3631d421fe make compilable with NTFS_DEBUG defined
Noted by Patrick Welche
1999-10-01 20:01:20 +00:00
jdolecek c8cbfeffb4 mention ntfs_nt{get|put|rele}() staff 1999-09-30 16:59:14 +00:00
jdolecek 3bc0f4abd1 convert ntfs_ntlookup() to use lockmgr()-style locking, instead of it's
home brewed variant
1999-09-30 16:56:40 +00:00
jdolecek 28d14a2c3b struct fnode cleanup:
* 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
1999-09-29 15:58:28 +00:00
jdolecek 66f0e7b121 move definition of ntfs_fget() and ntfs_frele() to ntfs_subr.h and g/c
now obsolete ntfs_extern.h
1999-09-29 15:36:07 +00:00
jdolecek bb9c5c97e2 one less - there is not point in optimizing ntfs_ntvattrget(), as the right
entry is found in 3rd pass at maximum; the duplicated code has been put
into new function ntfs_findvattr()
1999-09-29 15:31:11 +00:00
jdolecek 3ff26c418a ntfs_ntvattrget(): move duplicated code to separate function
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
1999-09-28 06:10:31 +00:00
jdolecek 3b49d9759d actually call ntfs_toupper_init() from ntfs_init() 1999-09-28 05:44:21 +00:00
jdolecek 1bc1c2815d cleanup 1999-09-24 15:22:32 +00:00
jdolecek 5fc5120c8e drop support for pre-104050000 NetBSD 1999-09-22 14:39:53 +00:00
jdolecek df6f3652dd ntfs_mountfs(): only print warnings iff NTFS_DEBUG 1999-09-13 20:21:45 +00:00
jdolecek 8afb0d9308 pull-in <sys/mount.h> for definition of struct netexport 1999-09-12 16:41:05 +00:00
jdolecek 1ec1b491a9 Argh, actually commit the update of ntfsmount structure for NFS
export support, so that it actually compiles.

Thanks Lennart!
1999-09-11 15:55:12 +00:00
jdolecek 993576f366 mountroot support written, need to really implement sync support and
add support for NTFS to libsa
1999-09-10 17:32:17 +00:00
jdolecek dee4a028e7 actually implement ntfs_mountroot() 1999-09-10 17:30:08 +00:00
jdolecek d779b91513 make NTFS NFS exportable - that also means getfh(2) and other syscalls
using filehandles should work now for NTFS filesystem
some other misc cleanup
1999-09-10 16:14:02 +00:00
jdolecek 23957b8977 next one 1999-09-09 19:17:17 +00:00
jdolecek 1c3be48c62 add pathconf(2) support 1999-09-09 18:10:23 +00:00
jdolecek b177baf591 make separate NetBSD version of the ntfs_vnodeop_entries[] array
and reformat it as it's usual in other fs's, use genfs
routines appropriately and use genfs's fsync() instead noop
ntfs_fsync()
1999-09-09 17:59:25 +00:00
jdolecek 1de19dc293 ntfs_lookup(): fix nasty interaction of the code with recent cache_lookup()
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
1999-09-09 16:29:46 +00:00
jdolecek cc0fdcd9f1 some more 1999-09-09 07:35:15 +00:00
jdolecek 1e99130f2e Use unixish term "hole" instead od "sparce" (which looks like it
should be "sparse" anyway).

Noted by Soren Jorvang <soren@NetBSD.org>.
1999-09-07 08:16:13 +00:00
jdolecek 7dfaa17700 Adapt to cache_lookup() changes.
Tested by: jdolecek
Rewieved by: wrstuden
1999-09-05 14:26:32 +00:00
jdolecek 1a0dc06af2 argh, forgot to add the implementation of ntfs_u28() 1999-09-05 12:30:56 +00:00
jdolecek dd0b9ad4e0 s/ntfs exportable/ntfs nfs exportable 1999-09-05 12:17:22 +00:00
jdolecek 0ba29f45c8 one less: ntfs_read(), ntfs_write() don't use any temporary buffer anymore,
the uio struct is passed to appropriate *attr*() functions
1999-09-05 11:19:01 +00:00
jdolecek 6f7dc58140 ntfs_read(), ntfs_write(): pass the uio struct to appropriate read/write
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
1999-09-05 11:09:03 +00:00
jdolecek d0409b449d adapt to ntfs_readattr() change: pass NULL as the struct uio * parameter 1999-09-05 10:45:03 +00:00
augustss 39e85679c4 Make it compile again. 1999-09-04 22:12:15 +00:00
jdolecek 2f7c750c12 change ntfs_read*attr*() and ntfs_write*attr*() to accept struct
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
1999-09-04 18:56:01 +00:00
jdolecek f20aa96271 add more items, correct a few sentences 1999-08-30 11:33:41 +00:00
augustss abebf3e12d Make it compile with DIAGNOSTIC. 1999-08-18 16:25:52 +00:00
jdolecek 1647f47ddf list of things which need to be done 1999-08-18 15:05:10 +00:00
jdolecek b8947f73c1 s/ntfs_toupper_used/ntfs_toupper_usecount/, make it static
ntfs_toupper_unuse(): check if ntfs_toupper_usecount is negative only when
	DIAGNOSTIC
1999-08-18 13:35:44 +00:00