Commit Graph

1081 Commits

Author SHA1 Message Date
reinoud c093c2520a Replace the old hashtable and sorted list implemenation by a RB-tree.
Benefits are significant speed improvements on node creation/insertion while
keeping the lookup times low and still allowing sequential iteration over the
nodes.
2009-07-07 10:23:36 +00:00
reinoud 4eb9ccfea3 Re-implement read-modify-write backend strategy. This version is a lot more
clean locking-wise and will consume less CPU power on needless moving-around.
2009-07-06 17:13:38 +00:00
reinoud 0a3cb580be Reduce the number of active ecclines; low memory systems could get into
trouble otherwise.

XXX this value should be computed eventually.
2009-07-06 17:08:04 +00:00
reinoud 2f9a24b61c Make source prettier 2009-07-06 17:06:57 +00:00
cegger d6fd22aa8b make this build w/o SMB_VNODE_DEBUG 2009-07-04 07:36:46 +00:00
elad 1d5d8311da Fix cut/paste error and put back a missing variable. 2009-07-04 00:03:22 +00:00
pgoyette c13b143ea3 Pass the vp arg to udf_check_possible() so we can access its v_mount
member.

XXX No idea if this is the right solution to this problem, but it does
XXX at least allow thebuild to continue.  The original committed should
XXX verify that this does what was intended!

(Hello again, Elad)
2009-07-03 23:14:11 +00:00
pgoyette c2a56cbb37 Define error before using it.
(Hello again, elad!)
2009-07-03 22:38:08 +00:00
pooka 512aa8b607 Fix utterly botched previous commit. efs compiles now and apprears
to work, but the person doing the original change should verify
that it actually works like before the change.

(hi, elad!)
2009-07-03 22:25:51 +00:00
elad 009f5d2f88 Where possible, extract the file-system's access() routine to two internal
functions: the first checking if the operation is possible (regardless of
permissions), the second checking file-system permissions, ACLs, etc.

Mailing list reference:

	http://mail-index.netbsd.org/tech-kern/2009/06/21/msg005311.html
2009-07-03 21:17:40 +00:00
njoly fbe16f2ec1 Directory open with NT_SMBS capability require the NOPEN bit to be set
too.
2009-07-03 18:35:33 +00:00
reinoud 2a23ff6c30 Enhance dumping on buffer screwup. Also prevent races or invalid combinations
to exist for ecclines.
2009-07-02 16:56:35 +00:00
njoly 84a85be4f9 Fix some panics while trying to umount a smbfs share.
Be sure that no other active vnodes remains, before trying to release
the root one. Likewise, do not destroy the smbmount specific structure
if the umount will fail (busy conditions).

No objection from pooka@.
2009-07-02 16:17:52 +00:00
dholland effcf1af5c Convert 67 namei call sites to use namei_simple, in these functions:
check_console, veriexecclose, veriexec_delete, veriexec_file_add,
emul_find_root, coff_load_shlib (sh3 version), coff_load_shlib,
compat_20_sys_statfs, compat_20_netbsd32_statfs,
ELFNAME2(netbsd32,probe_noteless), darwin_sys_statfs,
ibcs2_sys_statfs, ibcs2_sys_statvfs, linux_sys_uselib,
osf1_sys_statfs, sunos_sys_statfs, sunos32_sys_statfs,
ultrix_sys_statfs, do_sys_mount, fss_create_files (3 of 4),
adosfs_mount, cd9660_mount, coda_ioctl, coda_mount, ext2fs_mount,
ffs_mount, filecore_mount, hfs_mount, lfs_mount, msdosfs_mount,
ntfs_mount, sysvbfs_mount, udf_mount, union_mount, sys_chflags,
sys_lchflags, sys_chmod, sys_lchmod, sys_chown, sys_lchown,
sys___posix_chown, sys___posix_lchown, sys_link, do_sys_pstatvfs,
sys_quotactl, sys_revoke, sys_truncate, do_sys_utimes, sys_extattrctl,
sys_extattr_set_file, sys_extattr_set_link, sys_extattr_get_file,
sys_extattr_get_link, sys_extattr_delete_file,
sys_extattr_delete_link, sys_extattr_list_file, sys_extattr_list_link,
sys_setxattr, sys_lsetxattr, sys_getxattr, sys_lgetxattr,
sys_listxattr, sys_llistxattr, sys_removexattr, sys_lremovexattr

All have been scrutinized (several times, in fact) and compile-tested,
but not all have been explicitly tested in action.

XXX: While I haven't (intentionally) changed the use or nonuse of
XXX: TRYEMULROOT in any of these places, I'm not convinced all the
XXX: uses are correct; an audit might be desirable.
2009-06-29 05:08:15 +00:00
reinoud 7e99247bdd Fix corner-case in truncing files. It could forget to free the last block.
This would result in a free-space map with one block orphaned.
2009-06-27 13:42:06 +00:00
reinoud 5e29d1224f Rewrite of udf_on_rootpath(), and vop_rename() code that calls it, after the
UFS way. The tree walking is now done the same and the code hasn't locked up
on examples that made it lockup before.
2009-06-25 17:16:33 +00:00
reinoud 706de0e547 Commit first stage of free-space accounting. It is estimating the underlimit
of free blocks on the device and when free blocks are getting tight it tries
to readjust/recalculate that value by syncing the FS.

Second stage will be resizing the data/metadata partitions.
2009-06-24 17:09:13 +00:00
reinoud c2fd371267 Bump the NetBSD kernel UDF id to version 0.5 2009-06-23 20:13:37 +00:00
reinoud 75bab0f5ee Renaming in UDF was already possible but directories could only be renamed in
the same directory.

This patch finally allows a directory to be moved between parent directories.
2009-06-23 20:09:07 +00:00
elad 870920260d Move the implementation of vaccess() to genfs_can_access(), in line with
the other routines of the same spirit.

Adjust file-system code to use it.

Keep vaccess() for KPI compatibility and to keep element of least
surprise. A "diagnostic" message warning that vaccess() is deprecated will
be printed when it's used (obviously, only in DIAGNOSTIC kernels).

No objections on tech-kern@:

	http://mail-index.netbsd.org/tech-kern/2009/06/21/msg005310.html
2009-06-23 19:36:38 +00:00
njoly 0cef178686 Fix compilation with SMB_*_DEBUG options. 2009-06-22 21:13:50 +00:00
reinoud c76ee53287 Add overlooked `cred' declaration in udf_write() when i committed the catchup
patches.
2009-06-18 15:51:44 +00:00
reinoud 8f6cc2bd0e Pass-on credentials to size reversal on aborted write due to error. It could
be that in the future this credentials need to be changed to allways-allow
since its an reverting-on-error behaviour.
2009-06-18 15:15:10 +00:00
reinoud 9cf321ebdd Fix nitpicky spacing and debug printout 2009-06-18 15:09:18 +00:00
reinoud 66e7de7ac6 Remove unneeded (and unused) inclusion of "opt_quota.h" 2009-06-18 15:06:38 +00:00
reinoud b32db61b9b Enhance comment on node locking when writing out a node's descriptors. 2009-06-18 15:03:34 +00:00
reinoud 45929a2856 Remove unneeded wait for SYNC being finished on node disposal of deleted node;
this could interfere and lockup.
2009-06-18 15:01:34 +00:00
reinoud ba587e2e62 Add RESERVE bitmask flag to DEBUG print constants adding another 0 prefix to
the constants already defined.
2009-06-18 14:57:50 +00:00
reinoud 96a16f2f23 Remove now unused UDF_DIRHASH constants 2009-06-18 14:56:09 +00:00
reinoud b33f7bb0ef Retire IN_CALLBACK_ULK flagging since its not used anymore and the old
assertions on it would trigger without cause.
2009-05-20 15:30:26 +00:00
reinoud 2d212d801f Descriptor version is 16 bit and not 8 so use udf_rw16() to access them.
UniqueID was written in the logical volume integrity without byteswapping for
bigendian machines.
2009-05-20 13:25:50 +00:00
reinoud 2b1b74bba4 Account for the logical blocks recorded by the extent in the right endian! 2009-05-19 16:24:05 +00:00
reinoud e186770777 On creation of a new node, don't forget to set the length of the allocated
space in the right endian!
2009-05-19 16:06:56 +00:00
reinoud c3511553ae Forgot to use the udf_rw16() on the descriptor crc lengths of FID's!
Also fix a few dubiously formatted checks.
2009-05-19 15:08:42 +00:00
reinoud fbd470bae3 A descriptor's CRC lenth is 16 bit so use udf_rw16() on tag.desc_crc_len. 2009-05-19 15:07:20 +00:00
reinoud c469916e3d ANSI-fy. No idea why they weren't so in the first place. 2009-05-18 21:09:54 +00:00
reinoud 937ed04261 Fix *serious* bug in bswapping definitions for big endian machines. 2009-05-18 20:52:24 +00:00
reinoud 7b913c191b Make ecma167 header file compilable by pcc 2009-05-18 20:51:03 +00:00
pooka c94cfd7632 add some todo-items, based on a file which was lingering in my
local tree for apparently almost two years now
2009-05-18 15:47:28 +00:00
elad 863a01b5c1 Extract the open-coded authorization logic for chtimes() from various
file-systems and put it in a single function, genfs_can_chtimes().

This also makes UDF follow the same policy as all other file-systems.

Mailing list reference:

	http://mail-index.netbsd.org/tech-kern/2009/04/27/msg004951.html
2009-05-07 19:30:29 +00:00
elad 69db27dc69 Replace open-coded vaccess() in ntfs_access() with a call to vaccess().
Similarly to msdosfs, always add the exec bit to keep the current
behavior.

Mailing list reference:

    http://mail-index.netbsd.org/tech-kern/2009/04/21/msg004881.html
2009-04-29 22:33:33 +00:00
pooka 986e36ad6d replace outdated comment. no functional change 2009-04-29 11:01:50 +00:00
uch c519d37fde added error check. 2009-04-26 12:41:59 +00:00
elad f9642d24c5 Wrap some long lines in a comment, pointed out by ad@ - thanks!
While here, wrap two more long lines.
2009-04-25 21:26:20 +00:00
elad 54bf8cc67a Add genfs_can_mount() and use it to prevent some more code duplication of
the security checks when mounting a device (VOP_ACCESS() + kauth(9) call)).

Proposed with no objections on tech-kern@:

	http://mail-index.netbsd.org/tech-kern/2009/04/20/msg004859.html

The vnode is always expected to be locked, so no locking is done outside
the file-system code.
2009-04-25 18:53:44 +00:00
elad 9670d2e41d Add genfs_can_mount() and use it to prevent some more code duplication of
the security checks when mounting a device (VOP_ACCESS() + kauth(9) call)).

Proposed with no objections on tech-kern@:

	http://mail-index.netbsd.org/tech-kern/2009/04/20/msg004859.html

The vnode is always expected to be locked, so no locking is done outside
the file-system code.
2009-04-25 18:53:43 +00:00
elad f68b0219b0 Per discussion on tech-kern@:
- Replace use of label/goto with returns

  - Rename, change prototype of, and move functions from vfs_subr.c to
    genfs_vnops.c
2009-04-22 22:57:08 +00:00
reinoud 91d6e78060 Fix endian related bug when using discs with a meta-data partition on
big-endian machines.
2009-04-21 16:19:00 +00:00
elad b0745a039e Pass VREAD instead of FREAD to VOP_ACCESS().
Okay christos@.
2009-04-20 21:29:01 +00:00
elad 386808d4a0 Refactor some duplicated file-system code.
Proposed and received no objections on tech-kern@:

	http://mail-index.netbsd.org/tech-kern/2009/04/18/msg004843.html
2009-04-20 18:06:26 +00:00