Commit Graph

57 Commits

Author SHA1 Message Date
pooka c3183f3251 The VATTR_NULL/VREF/VHOLD/HOLDRELE() macros lost their will to live
years ago when the kernel was modified to not alter ABI based on
DIAGNOSTIC, and now just call the respective function interfaces
(in lowercase).  Plenty of mix'n match upper/lowercase has creeped
into the tree since then.  Nuke the macros and convert all callsites
to lowercase.

no functional change
2010-01-08 11:35:07 +00:00
mbalmer 982581e04d Remove extra semicolons. 2010-01-05 13:30:10 +00:00
reinoud c1a508d11c Rework simplistic UBC flushing. Recent changes to genfs made the old flush
system generate heaps of odd allocations since the end of write request was
overwritten by the start of the second resulting in another relocation.

Also added a full flush of the file on a VOP_CLOSE(). This automatically
flushes file tails to disc.
2009-09-14 21:10:44 +00:00
reinoud 7cbe9b45a2 Fix uid/gid check; it was checking if the old values would fit in 32 bits
instead of checking if the new values would.
2009-07-30 12:13:51 +00:00
reinoud 1f6bbe277a System nodes are not written out on becomming inactive; they should be written
out before automatically.

However, when dealing with faulty discs that fail to mount, system nodes are
of course not written out and thus may still be marked dirty, if only due to
access. Especially on sequential media this gave rise to panics on reading
trackinfo since the write track section had not yet been initialised.
2009-07-27 13:20:41 +00:00
reinoud 7f0e98bc0d Since OSTA has not defined a good set of flags to cover our flags, its not
usefull to implement chflags(). Instead ignore it for now since the error
codes might confuse esp. gui's.
2009-07-08 14:46:55 +00:00
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 2f9a24b61c Make source prettier 2009-07-06 17:06:57 +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
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
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 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
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
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 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
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
reinoud a3665ba58f Fix panic due to memory leak on symlink creation. A test copy with 3000+
symlinks could get the machine down.
2009-03-20 23:06:52 +00:00
dsl 02cdf4d2c8 Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
2009-03-14 14:45:51 +00:00
reinoud 193ccd2d90 Improve write throttling by doing it on page-size basis. The `standard'
solution would cut up files unnessisary during allocation. It also made
assumptions about ucb wich were propably right but still.
2009-02-11 13:08:08 +00:00
reinoud 78466aa1e7 Add simplistic UBC async flushing as other FS's seem to do. Its a clutch and
needs to be addressed in UBC properly.
2009-02-10 21:24:27 +00:00
reinoud 0be5b3fe22 Fix endless loop occuring on empty directories listing on 512 bytes/sector
media like harddiscs. Also provide provide a `safety net' on readdir so it
will signal EOF when its requested an entry outside the directory.
2008-12-16 14:28:34 +00:00
reinoud 42dbf4bb33 Elaborate SYNC debug messages and rename some debug messages to a more
proper category.
2008-12-16 10:30:19 +00:00
reinoud 4b1a812950 Split uid/gid remapping code to be independent of eachother. 2008-12-01 14:19:01 +00:00
pooka b4099c3e1d Rototill all remaining file systems to use ubc_uiomove() instead
of the ubc_alloc() - uiomove() - ubc_release() dance.
2008-11-26 20:17:33 +00:00
reinoud 2ac28d554b Implement directory hashing to speed up directory traversals. Speed
improvements of at least 4 times in untarring and roughly 100 to 500 times
on file creation in big directories. Lookup of files was O(n*n) and is now
O(1) even for file creation. Free spaces in the directory are kept in a
seperate list for fast file creation.

The postmark benchmark gives:

UDF old:
pm>set transactions 2000
pm>set number 3000
pm>run
Creating files...Done
Performing transactions..........Done
Deleting files...Done
Time:
        1593 seconds total
        681 seconds of transactions (2 per second)

Files:
        3956 created (2 per second)
                Creation alone: 3000 files (4 per second)
                Mixed with transactions: 956 files (1 per second)
        990 read (1 per second)
        1010 appended (1 per second)
        3956 deleted (2 per second)
                Deletion alone: 2912 files (9 per second)
                Mixed with transactions: 1044 files (1 per second)

Data:
        5.26 megabytes read (3.38 kilobytes per second)
        21.93 megabytes written (14.10 kilobytes per second)
pm>



UDF new:
pm>set transactions 2000
pm>set number 3000
pm>run
Creating files...Done
Performing transactions..........Done
Deleting files...Done
Time:
        19 seconds total
        3 seconds of transactions (666 per second)

Files:
        3956 created (208 per second)
                Creation alone: 3000 files (230 per second)
                Mixed with transactions: 956 files (318 per second)
        990 read (330 per second)
        1010 appended (336 per second)
        3956 deleted (208 per second)
                Deletion alone: 2912 files (970 per second)
                Mixed with transactions: 1044 files (348 per second)

Data:
        5.26 megabytes read (283.66 kilobytes per second)
        21.93 megabytes written (1.15 megabytes per second)
2008-07-17 19:10:22 +00:00
reinoud 31a383903d Since the rename logic now locks its source directory too, we ought to
unlock the source directory again on exit. The stub that doesn't allow
cross directory renames for now jumped to the wrong exit point and thus
left a locked directory node that paniced on next locking.
2008-07-17 11:00:29 +00:00
reinoud e4424d53b1 Keep the directory to read '..' from locked until its dirent is read and
its location is extracted.

Also lock the source directory so its contents can safely be changed...
patch from tmpfs.
2008-07-15 15:49:05 +00:00
reinoud 4503919107 Fix chtimes permission checking. This sanitised version is hopefully DTRT. 2008-07-10 17:38:31 +00:00
reinoud 0381f71bf3 Allow the renaming of directories *within* their current directory. No
cross-directory renaming is allowed yet.
2008-07-10 15:29:51 +00:00
reinoud e3eced36a8 Clarifying comments 2008-07-10 14:16:02 +00:00
reinoud 4d5c88faa5 Support for allocation extents descriptor writing to allow for arbitrary
heavily fragmented files.

Also fixing some (rare) allocation bugs and function name streamlining.

Tested on harddisc, CD-RW and CD-R i.e. all three basic backend classes.
2008-07-07 18:45:26 +00:00
reinoud 06993e5f51 Make readsymlink bug-tolerant to MacOS X symlink construction bug. It puts
the name ".." on a parent path component. To prevent other similar errors,
name length checking is not done but the passed name that shouldn't be
passed is ignored.
2008-06-24 15:57:13 +00:00
reinoud dc6314f8ae We are not allowed zero length names in softlinks. 2008-06-24 15:42:07 +00:00
reinoud a88cc8528f Support the creation of extended attributes for file creation in the
kernel and check and update them when found.

Note that it won't *insert* an extended attribute yet if it hasn't found it
while updating the birthtime.
2008-06-24 15:35:57 +00:00
reinoud 9d15fe5137 Cleanup file access,modification,attribute and birthtime setting of files
and make the modification time when set never older than the creation time.
2008-06-18 21:23:32 +00:00
reinoud 8902baa622 Implement wide char support for UDF by properly implementing unicode-16 to
UTF-8 like cd9660 and ntfs already do.
2008-05-19 20:12:36 +00:00
reinoud e979c658c9 Import writing part of the UDF file system making optical media like CD's
and DVD's behave like floppy discs. Writing is supported upto and including
version 2.01; version 2.50 and 2.60 will follow.

Also extending the UDF implementation to support symbolic links and
hardlinks.

Added are the mmcformat(8) tool to format rewritable CD/DVD discs and
newfs_udf(8).

Limitations:
        all operations can be performed on the file system though the
        sheduling is currently optimised for archiving workloads.

        mv(1)/rename(2) is currently only implemented for non-directories.
2008-05-14 16:49:47 +00:00
ad 1997a1e1f4 Remove VOP_LEASE. Discussed on tech-kern. 2008-01-25 14:32:11 +00:00
ad 42c90ece4c Fix dodgy tests of v_usecount. 2008-01-17 10:39:14 +00:00
ad 4a780c9ae2 Merge vmlocking2 to head. 2008-01-02 11:48:20 +00:00
lukem 9a633d3a1a use __KERNEL_RCSID() instead of __RCSID() 2007-12-11 12:05:27 +00:00
pooka 61e8303e9d Remove the "struct lwp *" argument from all VFS and VOP interfaces.
The general trend is to remove it from all kernel interfaces and
this is a start.  In case the calling lwp is desired, curlwp should
be used.

quick consensus on tech-kern
2007-11-26 19:01:26 +00:00
ad 59904ecbd2 Merge from vmlocking: fix dodgy use of VOP_ISLOCKED(). 2007-10-08 17:01:43 +00:00
rumble 0ae0a486c7 Avoid stack allocation of large dirent structures in foo_readdir(). 2007-09-24 00:42:12 +00:00
msaitoh 8ce1f4fff2 fix typos 2007-04-29 20:23:34 +00:00
reinoud 1d48d18121 Add UDF_ICB_FILETYPE_REALTIME type as found on UDF 2.50 discs. Also revert
a multiplication order to enforce 64 bit math.
2007-01-04 04:15:43 +00:00
chs c398ae9734 a smorgasbord of improvements to vnode locking and path lookup:
- LOCKPARENT is no longer relevant for lookup(), relookup() or VOP_LOOKUP().
   these now always return the parent vnode locked.  namei() works as before.
   lookup() and various other paths no longer acquire vnode locks in the
   wrong order via vrele().  fixes PR 32535.
   as a nice side effect, path lookup is also up to 25% faster.
 - the above allows us to get rid of PDIRUNLOCK.
 - also get rid of WANTPARENT (just use LOCKPARENT and unlock it).
 - remove an assumption in layer_node_find() that all file systems implement
   a recursive VOP_LOCK() (unionfs doesn't).
 - require that all file systems supply vfs_vptofh and vfs_fhtovp routines.
   fill in eopnotsupp() for file systems that don't support being exported
   and remove the checks for NULL.  (layerfs calls these without checking.)
 - in union_lookup1(), don't change refcounts in the ISDOTDOT case, just
   adjust which vnode is locked.  fixes PR 33374.
 - apply fixes for ufs_rename() from ufs_vnops.c rev. 1.61 to ext2fs_rename().
2006-12-09 16:11:50 +00:00