Home | History | Annotate | Download | only in udf
History log of /src/sys/fs/udf/udf_vnops.c
RevisionDateAuthorComments
 1.127  27-Jun-2023  reinoud Convert UDF file system code from the depricated tsleep(9)/wakeup(9) to the MP
friendly condvar(9). No functional change intended.
 1.126  28-May-2022  andvar fix various typos in comments, mainly origional->original,
extened->extended, incomming->incoming.
 1.125  03-May-2022  andvar fix various typos, mainly s/trasfering/transferring/ and s/theese/these/.
 1.124  03-May-2022  hannken No IO_NODELOCKED for unlocked vnode.
 1.123  10-Apr-2022  andvar fix various typos in comments and output/log messages.
 1.122  01-Apr-2022  reinoud Fix malformed DPRINTF() macro
 1.121  30-Mar-2022  christos Fix locking in udf_link(). XXX: udf_symlink is prolly similarly broken.
 1.120  27-Mar-2022  christos add a kauth vnode check for creating links
 1.119  16-Feb-2022  andvar fix various typos, mainly in comments.
 1.118  06-Feb-2022  andvar fix various typos in comments, log messages and documentation.
mainly s/aparently/apparently/ and s/implmented/implemented/.
 1.117  20-Oct-2021  thorpej Overhaul of the EVFILT_VNODE kevent(2) filter:

- Centralize vnode kevent handling in the VOP_*() wrappers, rather than
forcing each individual file system to deal with it (except VOP_RENAME(),
because VOP_RENAME() is a mess and we currently have 2 different ways
of handling it; at least it's reasonably well-centralized in the "new"
way).
- Add support for NOTE_OPEN, NOTE_CLOSE, NOTE_CLOSE_WRITE, and NOTE_READ,
compatible with the same events in FreeBSD.
- Track which kevent notifications clients are interested in receiving
to avoid doing work for events no one cares about (avoiding, e.g.
taking locks and traversing the klist to send a NOTE_WRITE when
someone is merely watching for a file to be deleted, for example).

In support of the above:

- Add support in vnode_if.sh for specifying PRE- and POST-op handlers,
to be invoked before and after vop_pre() and vop_post(), respectively.
Basic idea from FreeBSD, but implemented differently.
- Add support in vnode_if.sh for specifying CONTEXT fields in the
vop_*_args structures. These context fields are used to convey information
between the file system VOP function and the VOP wrapper, but do not
occupy an argument slot in the VOP_*() call itself. These context fields
are initialized and subsequently interpreted by PRE- and POST-op handlers.
- Version VOP_REMOVE(), uses the a context field for the file system to report
back the resulting link count of the target vnode. Return this in tmpfs,
udf, nfs, chfs, ext2fs, lfs, and ufs.

NetBSD 9.99.92.
 1.116  24-Jul-2021  andvar Fix all remaining typos, mainly in comments but also in few definitions and log messages, reported by me in PR kern/54889.
Also fixed some additional typos in comments, found on review of same files or typos.
 1.115  29-Jun-2021  dholland - Add a new vnode op: VOP_PARSEPATH.
- Move namei_getcomponent to genfs_vnops.c and call it genfs_parsepath.
- Add a parsepath entry to every vnode ops table.

VOP_PARSEPATH takes a directory vnode to be searched and a complete
following path and chooses how much of that path to consume. To begin
with, all parsepath calls are genfs_parsepath, which locates the first
'/' as always.

Note that the call doesn't take the whole struct componentname, only
the string. The other bits of struct componentname should not be
needed and there's no reason to cause potential complications by
exposing them.
 1.114  27-Jun-2020  christos branches: 1.114.6;
Introduce genfs_pathconf() and use it for the default case in all filesystems.
 1.113  16-May-2020  christos Add ACL support for FFS. From FreeBSD.
 1.112  23-Apr-2020  ad PR kern/54759 (vm.ubc_direct deadlock when read()/write() into mapping of itself)

- Add new flag UBC_ISMAPPED which tells ubc_uiomove() the object is mmap()ed
somewhere. Use it to decide whether to do direct-mapped copy, rather than
poking around directly in the vnode in ubc_uiomove(), which is ugly and
doesn't work for tmpfs. It would be nicer to contain all this in UVM but
the filesystem provides the needed locking here (VV_MAPPED) and to
reinvent that would suck more.

- Rename UBC_UNMAP_FLAG() to UBC_VNODE_FLAGS(). Pass in UBC_ISMAPPED where
appropriate.
 1.111  14-Apr-2020  reinoud fix debug print flag
 1.110  13-Apr-2020  ad Replace most uses of vp->v_usecount with a call to vrefcnt(vp), a function
that hides the details and does atomic_load_relaxed(). Signature matches
FreeBSD.
 1.109  23-Feb-2020  ad branches: 1.109.4;
UVM locking changes, proposed on tech-kern:

- Change the lock on uvm_object, vm_amap and vm_anon to be a RW lock.
- Break v_interlock and vmobjlock apart. v_interlock remains a mutex.
- Do partial PV list locking in the x86 pmap. Others to follow later.
 1.108  17-Jan-2020  ad VFS_VGET(), VFS_ROOT(), VFS_FHTOVP(): give them a "int lktype" argument, to
allow us to get shared locks (or no lock) on the returned vnode. Matches
FreeBSD.
 1.107  27-Dec-2019  msaitoh branches: 1.107.2;
s/transfered/transferred/
 1.106  26-May-2017  riastradh branches: 1.106.10;
Eliminate crusty debugging sludge.

We have a mostly sane vnode lifecycle now. If this needs debugging,
it should be done once at the call site of VOP_RECLAIM.
 1.105  26-May-2017  riastradh Make VOP_RECLAIM do the last unlock of the vnode.

VOP_RECLAIM naturally has exclusive access to the vnode, so having it
locked on entry is not strictly necessary -- but it means if there
are any final operations that must be done on the vnode, such as
ffs_update, requiring exclusive access to it, we can now kassert that
the vnode is locked in those operations.

We can't just have the caller release the last lock because some file
systems don't use genfs_lock, and require the vnode to remain valid
for VOP_UNLOCK to work, notably unionfs.
 1.104  26-Apr-2017  riastradh Change VOP_REMOVE and VOP_RMDIR to preserve lock/ref on dvp.

No change to vp -- the plan is to replace the node by the
componentname in the vop parameters, and let all directory vops do
lookups internally.

Proposed on tech-kern with no objections:
https://mail-index.netbsd.org/tech-kern/2017/04/17/msg021825.html
 1.103  11-Apr-2017  riastradh Make VOP_INACTIVE preserve vnode lock on return.

Discussed on tech-kern:
https://mail-index.netbsd.org/tech-kern/2017/04/01/msg021751.html

Ride 7.99.68, a bumpy bus of incremental vfs improvements!
 1.102  20-Aug-2016  hannken branches: 1.102.2;
Remove now obsolete operation vcache_remove().

Welcome to 7.99.36
 1.101  20-Apr-2015  riastradh branches: 1.101.2;
Make VOP_LINK return directory still locked and referenced.

Ride 7.99.10 bump.
 1.100  06-Apr-2015  hannken Change udf to vcache, keyed on udf_node->loc.loc.
 1.99  06-Apr-2015  hannken Move the removal of unlinked nodes from udf_inactive() to udf_reclaim().
 1.98  04-Apr-2015  riastradh Fix remaining read(fd, NULL, 1) cases.
 1.97  28-Jan-2015  martin When udf_symlink() fails, do not explicitly call udf_delete_node(), as
vrele() called next will do that again - avoids a double free of the
bitmap, leading to a KASSERT failure (or worse in real life) in the
udf_symlink_long in the fs/vfs::t_vnops test.
 1.96  04-Jan-2015  reinoud Add missing vrele() as found by the testsuite.

Thanks Jurgen Hannken for the patch.
 1.95  03-Dec-2014  reinoud Explicitly delete the failing node; it would be killed with the unlink too but
explicitly deleting it is better than just setting the file size to zero.
 1.94  29-Jul-2014  reinoud branches: 1.94.4;
Posix requires the va_size of a symlink to be pathlength for symbolic links.
This fixes yet another atf case.
 1.93  29-Jul-2014  reinoud Access time should only be set on accessing the data or messing with the
contents, not on inode access rights and ownership changes. Should address
PR kern/49033 for UDF.

Test results now come clean for bugs related to this issue in the ATF.
 1.92  25-Jul-2014  dholland Add VOP_FALLOCATE and VOP_FDISCARD to every vnode ops table I can
find.

The filesystem ones all call genfs_eopnotsupp - right now I am only
implementing the plumbing and we can implement fallocate and/or
fdiscard for files later.

The device ones call spec_fallocate (which is also genfs_eopnotsupp)
and spec_fdiscard, which dispatches to the device-level op.

The fifo ones all call vn_fifo_bypass, which also ends up being
EOPNOTSUPP.
 1.91  23-Mar-2014  christos branches: 1.91.2;
fix unused
 1.90  07-Feb-2014  hannken Change vnode operation lookup to return the resulting vnode *vpp unlocked.
Change cache_lookup() to return an unlocked vnode.

Discussed on tech-kern@

Welcome to 6.99.31
 1.89  23-Jan-2014  hannken Change vnode operations create, mknod, mkdir and symlink to return
the resulting vnode *vpp unlocked.

Discussed on tech-kern@

Welcome to 6.99.30
 1.88  17-Jan-2014  hannken Change vnode operations create, mknod, mkdir and symlink to keep the
directory node dvp locked on return.

Discussed on tech-kern@

Welcome to 6.99.29
 1.87  18-Oct-2013  christos fix unused variable warnings
 1.86  04-Oct-2013  hannken Remove a bogus vrecycle() from udf_inactive(). Vrecycle() works on inactive
vnodes while VOP_INACTIVE() should never be called on an inactive vnode.

Ok: Reinoud Zandijk <reinoud@netbsd.org>
 1.85  10-Jul-2013  reinoud Implement udf_rename() using the new genfs_rename() framework.

Fixes PR kern/47986
 1.84  08-Jul-2013  reinoud Clarify the sticky-bit check
 1.83  07-Jul-2013  reinoud Pull forward the node creation returned from the lookup call. Its vnode is
used in the access determination on delete/rename of TXT files.

Thanks for joerg@ and clang for detecting this!
 1.82  07-Jul-2013  reinoud Implement a real empty-directory checking for rmdir().

Should should fix the other part of PR kern/47987
Solves tests/vfs/t_vnops udf_dir_notempty
 1.81  05-Jul-2013  reinoud Fixes chflags. They were silently rejected before but the VFS standard demands
it complains with EOPNOTSUPP.

Fixes chflags test case.
 1.80  05-Jul-2013  reinoud Provide additional checks to udf_lookup and restructure it a bit.

Should fix PR 47988
 1.79  03-Jul-2013  reinoud Remove spurious empty line
 1.78  03-Jul-2013  reinoud On removing a directory make sure the leaf directory doesn't have a valid '..'
link anymore. In a corner case this leaf can be held by a process as a CWD. It
is guaranteed to be empty at this stage so we trunc it removing the only valid
FID, being the '..' entry.

Solves part of PR kern/47987
Solves tests/vfs/t_vnops udf_dir_rmdirdotdot
 1.77  03-Jul-2013  reinoud Typo in debug message: we are removing a directory and not a file.
 1.76  27-Jun-2013  reinoud branches: 1.76.2;
Since UDF volumes are always mounted async, the simple UBC purging with
VOP_PUTPAGES() was never triggered resulting in far too much data in the UBC
that needed to be written out. This could result in instability on small
memory machines.
 1.75  18-Mar-2013  plunky C99 section 6.7.2.3 (Tags) Note 3 states that:

A type specifier of the form

enum identifier

without an enumerator list shall only appear after the type it
specifies is complete.

which means that we cannot pass an "enum vtype" argument to
kauth_access_action() without fully specifying the type first.
Unfortunately there is a complicated include file loop which
makes that difficult, so convert this minimal function into a
macro (and capitalize it).

(ok elad@)
 1.74  05-Nov-2012  dholland Excise struct componentname from the namecache.

This uglifies the interface, because several operations need to be
passed the namei flags and cache_lookup also needs for the time being
to be passed cnp->cn_nameiop. Nonetheless, it's a net benefit.

The glop should be able to go away eventually but requires structural
cleanup elsewhere first.

This change requires a kernel bump.
 1.73  05-Nov-2012  dholland Disentangle the namecache from the internals of namei.

- Move the namecache's hash computation to inside the namecache code,
instead of being spread out all over the place. Remove cn_hash from
struct componentname and delete all uses of it.

- It is no longer necessary (if it ever was) for cache_lookup and
cache_lookup_raw to clear MAKEENTRY from cnp->cn_flags for the cases
that cache_enter already checks for.

- Rearrange the interface of cache_lookup (and cache_lookup_raw) to
make it somewhat simpler, to exclude certain nonexistent error
conditions, and (most importantly) to make it not require write access
to cnp->cn_flags.

This change requires a kernel bump.
 1.72  22-Jul-2012  rmind branches: 1.72.2;
Move some the test for MAKEENTRY into the cache_enter(9). Make some
variables in vfs_cache.c static, __read_mostly, etc.

No objection on tech-kern@.
 1.71  29-Apr-2012  chs change vflushbuf() to take the full FSYNC_* flags.
translate FSYNC_LAZY into PGO_LAZY for VOP_PUTPAGES() so that
genfs_do_io() can set the appropriate io priority for the I/O.
this is the first part of addressing PR 46325.
 1.70  13-Mar-2012  elad Replace the remaining KAUTH_GENERIC_ISSUSER authorization calls with
something meaningful. All relevant documentation has been updated or
written.

Most of these changes were brought up in the following messages:

http://mail-index.netbsd.org/tech-kern/2012/01/18/msg012490.html
http://mail-index.netbsd.org/tech-kern/2012/01/19/msg012502.html
http://mail-index.netbsd.org/tech-kern/2012/02/17/msg012728.html

Thanks to christos, manu, njoly, and jmmv for input.

Huge thanks to pgoyette for spinning these changes through some build
cycles and ATF.
 1.69  18-Nov-2011  christos branches: 1.69.4; 1.69.6;
Obey MNT_RELATIME, the only addition is that mkdir in ufs sets IN_ACCESS too.
 1.68  18-Oct-2011  hannken branches: 1.68.2;
VOP_GETATTR() needs a shared lock at least.

While here fix a typo (fvp -> tvp).
 1.67  27-Sep-2011  christos return UDF_MAXNAMLEN instead of NAME_MAX
 1.66  12-Jun-2011  rmind Welcome to 5.99.53! Merge rmind-uvmplock branch:

- Reorganize locking in UVM and provide extra serialisation for pmap(9).
New lock order: [vmpage-owner-lock] -> pmap-lock.

- Simplify locking in some pmap(9) modules by removing P->V locking.

- Use lock object on vmobjlock (and thus vnode_t::v_interlock) to share
the locks amongst UVM objects where necessary (tmpfs, layerfs, unionfs).

- Rewrite and optimise x86 TLB shootdown code, make it simpler and cleaner.
Add TLBSTATS option for x86 to collect statistics about TLB shootdowns.

- Unify /dev/mem et al in MI code and provide required locking (removes
kernel-lock on some ports). Also, avoid cache-aliasing issues.

Thanks to Andrew Doran and Joerg Sonnenberger, as their initial patches
formed the core changes of this branch.
 1.65  19-May-2011  rmind branches: 1.65.2;
Remove cache_purge(9) calls from reclamation routines in the file systems,
as vclean(9) performs it for us since Lite2 merge.
 1.64  26-Apr-2011  hannken Change vflushbuf() to return an error if a synchronous write fails.

Welcome to 5.99.51.
 1.63  24-Apr-2011  rmind sys_link: prevent hard links on directories (cross-mount operations are
already prevented). File systems are no longer responsible to check this.
Clean up and add asserts (note that dvp == vp cannot happen in vop_link).

OK dholland@
 1.62  02-Jan-2011  dholland branches: 1.62.2;
Remove the special refcount behavior (adding an extra reference to the
parent dir) associated with SAVESTART in relookup().

Check all call sites to make sure that SAVESTART wasn't set while
calling relookup(); if it was, adjust the refcount behavior. Remove
related references to SAVESTART.

The only code that was reaching the extra ref was msdosfs_rename,
where the refcount behavior was already fairly broken and/or gross;
repair it.

Add a dummy 4th argument to relookup to make sure code that hasn't
been inspected won't compile. (This will go away next time the
relookup semantics change, which they will.)
 1.61  30-Nov-2010  dholland Abolish the SAVENAME and HASBUF flags. There is now always a buffer,
so the path in a struct componentname is now always valid during VOP
calls.
 1.60  30-Nov-2010  dholland Abolish struct componentname's cn_pnbuf. Use the path buffer in the
pathbuf object passed to namei as work space instead. (For now a pnbuf
pointer appears in struct nameidata, to support certain unclean things
that haven't been fixed yet, but it will be going away in the future.)

This removes the need for the SAVENAME and HASBUF namei flags.
 1.59  24-Jun-2010  hannken Clean up vnode lock operations pass 2:

VOP_UNLOCK(vp, flags) -> VOP_UNLOCK(vp): Remove the unneeded flags argument.

Welcome to 5.99.32.

Discussed on tech-kern.
 1.58  24-Jun-2010  hannken Clean up vnode lock operations:

- VOP_LOCK(vp, flags): Limit the set of allowed flags to LK_EXCLUSIVE,
LK_SHARED and LK_NOWAIT. LK_INTERLOCK is no longer allowed as it
makes no sense here.

- VOP_ISLOCKED(vp): Remove the for some time unused return value
LK_EXCLOTHER. Mark this operation as "diagnostic only".
Making a lock decision based on this operation is no longer allowed.

Discussed on tech-kern.
 1.57  08-Jan-2010  pooka branches: 1.57.2; 1.57.4;
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
 1.56  05-Jan-2010  mbalmer Remove extra semicolons.
 1.55  14-Sep-2009  reinoud 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.
 1.54  30-Jul-2009  reinoud Fix uid/gid check; it was checking if the old values would fit in 32 bits
instead of checking if the new values would.
 1.53  27-Jul-2009  reinoud 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.
 1.52  08-Jul-2009  reinoud 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.
 1.51  07-Jul-2009  reinoud 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.
 1.50  06-Jul-2009  reinoud Make source prettier
 1.49  03-Jul-2009  pgoyette 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)
 1.48  03-Jul-2009  elad 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
 1.47  25-Jun-2009  reinoud 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.
 1.46  24-Jun-2009  reinoud 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.
 1.45  23-Jun-2009  reinoud 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.
 1.44  23-Jun-2009  elad 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
 1.43  18-Jun-2009  reinoud Add overlooked `cred' declaration in udf_write() when i committed the catchup
patches.
 1.42  18-Jun-2009  reinoud 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.
 1.41  07-May-2009  elad 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
 1.40  22-Apr-2009  elad 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
 1.39  20-Apr-2009  elad 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
 1.38  20-Mar-2009  reinoud Fix panic due to memory leak on symlink creation. A test copy with 3000+
symlinks could get the machine down.
 1.37  14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.36  11-Feb-2009  reinoud 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.
 1.35  10-Feb-2009  reinoud Add simplistic UBC async flushing as other FS's seem to do. Its a clutch and
needs to be addressed in UBC properly.
 1.34  16-Dec-2008  reinoud branches: 1.34.2;
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.
 1.33  16-Dec-2008  reinoud Elaborate SYNC debug messages and rename some debug messages to a more
proper category.
 1.32  01-Dec-2008  reinoud Split uid/gid remapping code to be independent of eachother.
 1.31  26-Nov-2008  pooka Rototill all remaining file systems to use ubc_uiomove() instead
of the ubc_alloc() - uiomove() - ubc_release() dance.
 1.30  17-Jul-2008  reinoud branches: 1.30.2; 1.30.4;
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)
 1.29  17-Jul-2008  reinoud 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.
 1.28  15-Jul-2008  reinoud 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.
 1.27  10-Jul-2008  reinoud Fix chtimes permission checking. This sanitised version is hopefully DTRT.
 1.26  10-Jul-2008  reinoud Allow the renaming of directories *within* their current directory. No
cross-directory renaming is allowed yet.
 1.25  10-Jul-2008  reinoud Clarifying comments
 1.24  07-Jul-2008  reinoud 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.
 1.23  24-Jun-2008  reinoud branches: 1.23.2;
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.
 1.22  24-Jun-2008  reinoud We are not allowed zero length names in softlinks.
 1.21  24-Jun-2008  reinoud 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.
 1.20  18-Jun-2008  reinoud Cleanup file access,modification,attribute and birthtime setting of files
and make the modification time when set never older than the creation time.
 1.19  19-May-2008  reinoud branches: 1.19.2;
Implement wide char support for UDF by properly implementing unicode-16 to
UTF-8 like cd9660 and ntfs already do.
 1.18  14-May-2008  reinoud 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.
 1.17  25-Jan-2008  ad branches: 1.17.6; 1.17.8; 1.17.10; 1.17.12;
Remove VOP_LEASE. Discussed on tech-kern.
 1.16  17-Jan-2008  ad Fix dodgy tests of v_usecount.
 1.15  02-Jan-2008  ad Merge vmlocking2 to head.
 1.14  11-Dec-2007  lukem use __KERNEL_RCSID() instead of __RCSID()
 1.13  26-Nov-2007  pooka branches: 1.13.2; 1.13.4; 1.13.6;
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
 1.12  08-Oct-2007  ad branches: 1.12.4;
Merge from vmlocking: fix dodgy use of VOP_ISLOCKED().
 1.11  24-Sep-2007  rumble Avoid stack allocation of large dirent structures in foo_readdir().
 1.10  29-Apr-2007  msaitoh branches: 1.10.6; 1.10.8; 1.10.10;
fix typos
 1.9  04-Jan-2007  reinoud branches: 1.9.2; 1.9.6; 1.9.8;
Add UDF_ICB_FILETYPE_REALTIME type as found on UDF 2.50 discs. Also revert
a multiplication order to enforce 64 bit math.
 1.8  09-Dec-2006  chs 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().
 1.7  12-Oct-2006  christos branches: 1.7.2;
- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.6  12-Jun-2006  christos branches: 1.6.4; 1.6.8; 1.6.10; 1.6.12;
remove ; from };
 1.5  14-May-2006  elad branches: 1.5.2;
integrate kauth.
 1.4  11-May-2006  mrg quell GCC 4.1 uninitialised variable warnings.

XXX: we should audit the tree for which old ones are no longer needed
after getting the older compilers out of the tree..
 1.3  25-Apr-2006  snj s/allready/already/
 1.2  02-Feb-2006  reinoud branches: 1.2.2; 1.2.4; 1.2.6; 1.2.8; 1.2.10;
Fix $NetBSD$ tags. (sorry)
 1.1  02-Feb-2006  reinoud Initial import of a UDF file system implementation for NetBSD.

The code supports read access to all media types that CD/DVD type drives
can recognize including DVD-RAM and BD- drives as well as harddisc partions
and vnd devices. UDF versions upto the latest 2.60 are to be supported
though due to lack of test media version 2.50 and 2.60 are not implemented
yet though easy to add. Both open and closed media are supported.

Write access is planned and in preparation. To facilitate this some hooks
are present in the code that are not strictly needed in a read-only
implementation but which allow writing to be added more easily.

Implemented and tested media types are CD-ROM, CD-R, CD-RW, CD-MRW,
DVD-ROM, DVD*R, DVD*RW, DVD+MRW but the same code can also read DVD-RAM,
HD-DVD and BluRay discs. Also vnd devices have been tested with several
sector sizes.

Discs created and written by UDFclient, Nero's InCD and Roxio's
DirectCD/Drag2Disc read fine.
 1.2.10.1  24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.2.8.2  11-May-2006  elad sync with head
 1.2.8.1  08-Mar-2006  elad Adapt to kernel authorization KPI.
 1.2.6.2  26-Jun-2006  yamt sync with head.
 1.2.6.1  24-May-2006  yamt sync with head.
 1.2.4.2  18-Feb-2006  yamt sync with head.
 1.2.4.1  02-Feb-2006  yamt file udf_vnops.c was added on branch yamt-uio_vmspace on 2006-02-18 15:39:18 +0000
 1.2.2.1  01-Jun-2006  kardel Sync with head.
 1.5.2.1  19-Jun-2006  chap Sync with head.
 1.6.12.2  10-Dec-2006  yamt sync with head.
 1.6.12.1  22-Oct-2006  yamt sync with head
 1.6.10.2  09-Sep-2006  rpaulo sync with head
 1.6.10.1  12-Jun-2006  rpaulo file udf_vnops.c was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:57:06 +0000
 1.6.8.2  12-Jan-2007  ad Sync with head.
 1.6.8.1  18-Nov-2006  ad Sync with head.
 1.6.4.9  04-Feb-2008  yamt sync with head.
 1.6.4.8  21-Jan-2008  yamt sync with head
 1.6.4.7  07-Dec-2007  yamt sync with head
 1.6.4.6  27-Oct-2007  yamt sync with head.
 1.6.4.5  03-Sep-2007  yamt sync with head.
 1.6.4.4  26-Feb-2007  yamt sync with head.
 1.6.4.3  30-Dec-2006  yamt sync with head.
 1.6.4.2  21-Jun-2006  yamt sync with head.
 1.6.4.1  12-Jun-2006  yamt file udf_vnops.c was added on branch yamt-lazymbuf on 2006-06-21 15:09:37 +0000
 1.7.2.2  17-Feb-2007  tron Apply patch (requested by chs in ticket #422):
- Fix various deadlock problems with nullfs and unionfs.
- Speed up path lookups by upto 25%.
 1.7.2.1  04-Jan-2007  bouyer Pull up following revision(s) (requested by reinoud in ticket #333):
sys/fs/udf/udf_subr.c: revision 1.27-1.29
sys/fs/udf/udf_vnops.c: revision 1.9
sys/fs/udf/ecma167-udf.h: revision 1.6
Fix compilation issue when specifying different flags or compiling with a
different compiler. Thanks to Jared for noting.
Add UDF_ICB_FILETYPE_REALTIME type as found on UDF 2.50 discs. Also revert
a multiplication order to enforce 64 bit math.
Forgot one place for UDF_ICB_FILETYPE_RANDOMACCESS.
 1.9.8.1  11-Jul-2007  mjf Sync with head.
 1.9.6.4  09-Oct-2007  ad Sync with head.
 1.9.6.3  22-Aug-2007  ad Fix dodgy use of VOP_ISLOCKED().
 1.9.6.2  08-Jun-2007  ad Sync with head.
 1.9.6.1  05-Apr-2007  ad Compile fixes.
 1.9.2.1  07-May-2007  yamt sync with head.
 1.10.10.2  14-Oct-2007  yamt sync with head.
 1.10.10.1  06-Oct-2007  yamt sync with head.
 1.10.8.3  23-Mar-2008  matt sync with HEAD
 1.10.8.2  09-Jan-2008  matt sync with HEAD
 1.10.8.1  06-Nov-2007  matt sync with HEAD
 1.10.6.3  27-Nov-2007  joerg Sync with HEAD. amd64 Xen support needs testing.
 1.10.6.2  26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.10.6.1  02-Oct-2007  joerg Sync with HEAD.
 1.12.4.3  18-Feb-2008  mjf Sync with HEAD.
 1.12.4.2  27-Dec-2007  mjf Sync with HEAD.
 1.12.4.1  08-Dec-2007  mjf Sync with HEAD.
 1.13.6.3  19-Jan-2008  bouyer Sync with HEAD
 1.13.6.2  02-Jan-2008  bouyer Sync with HEAD
 1.13.6.1  13-Dec-2007  bouyer Sync with HEAD
 1.13.4.1  11-Dec-2007  yamt sync with head.
 1.13.2.2  26-Dec-2007  ad Sync with head.
 1.13.2.1  04-Dec-2007  ad Pull the vmlocking changes into a new branch.
 1.17.12.2  18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.17.12.1  23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.17.10.8  11-Aug-2010  yamt sync with head.
 1.17.10.7  11-Mar-2010  yamt sync with head
 1.17.10.6  16-Sep-2009  yamt sync with head
 1.17.10.5  19-Aug-2009  yamt sync with head.
 1.17.10.4  18-Jul-2009  yamt sync with head.
 1.17.10.3  16-May-2009  yamt sync with head
 1.17.10.2  04-May-2009  yamt sync with head.
 1.17.10.1  16-May-2008  yamt sync with head.
 1.17.8.2  04-Jun-2008  yamt sync with head
 1.17.8.1  18-May-2008  yamt sync with head.
 1.17.6.4  17-Jan-2009  mjf Sync with HEAD.
 1.17.6.3  28-Sep-2008  mjf Sync with HEAD.
 1.17.6.2  29-Jun-2008  mjf Sync with HEAD.
 1.17.6.1  02-Jun-2008  mjf Sync with HEAD.
 1.19.2.2  18-Jul-2008  simonb Sync with head.
 1.19.2.1  27-Jun-2008  simonb Sync with head.
 1.23.2.2  13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.23.2.1  19-Oct-2008  haad Sync with HEAD.
 1.30.4.8  26-Sep-2009  snj Apply patch (requested by reinoud in ticket #959):
UDF's flushing algorithm was susceptible to interference with genfs.
This patch fixes that and also ensures that there aren't tails around
being allocated later.
 1.30.4.7  09-Jul-2009  snj Apply patch (requested by reinoud in ticket #852):
Numerous UDF improvements:
- a much saner rmw backend
- free space management done right
- the high system time usage when encountering huge numbers of nodes
are a thing of the past due to refactoring
- various small fixes
 1.30.4.6  24-Mar-2009  snj branches: 1.30.4.6.4;
Pull up following revision(s) (requested by reinoud in ticket #592):
sys/fs/udf/udf_vnops.c: revision 1.38
Fix panic due to memory leak on symlink creation. A test copy with 3000+
symlinks could get the machine down.
 1.30.4.5  18-Mar-2009  snj Apply patch (requested by reinoud in ticket #585):
Fix build by bringing in part of 1.35 that was left out.
 1.30.4.4  18-Mar-2009  snj Apply patch (requested by reinoud in ticket #569):
Remove dead code and double check if it's allowed to write out
non-sequential there.
--
Sequential writing goes before normal write. Its not likely to ever go
wrong but there could be a race otherwise.
--
Add simplistic UBC async flushing as other FS's seem to do. Its a clutch
and needs to be addressed in UBC properly.
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.
 1.30.4.3  18-Dec-2008  snj Pull up following revision(s) (requested by reinoud in ticket #192):
sys/fs/udf/udf_vnops.c: revision 1.34
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.
 1.30.4.2  18-Dec-2008  snj Pull up following revision(s) (requested by reinoud in ticket #192):
sys/fs/udf/udf_subr.c: revision 1.77
sys/fs/udf/udf_vnops.c: revision 1.33
Elaborate SYNC debug messages and rename some debug messages to a more
proper category.
 1.30.4.1  06-Dec-2008  snj Pull up following revision(s) (requested by reinoud in ticket #167):
sys/fs/udf/udf_subr.c: revision 1.76
sys/fs/udf/udf_vnops.c: revision 1.32
Split uid/gid remapping code to be independent of eachother.
 1.30.4.6.4.1  21-Apr-2010  matt sync to netbsd-5
 1.30.2.3  28-Apr-2009  skrll Sync with HEAD.
 1.30.2.2  03-Mar-2009  skrll Sync with HEAD.
 1.30.2.1  19-Jan-2009  skrll Sync with HEAD.
 1.34.2.2  23-Jul-2009  jym Sync with HEAD.
 1.34.2.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.57.4.4  31-May-2011  rmind sync with head
 1.57.4.3  05-Mar-2011  rmind sync with head
 1.57.4.2  03-Jul-2010  rmind sync with head
 1.57.4.1  16-Mar-2010  rmind Change struct uvm_object::vmobjlock to be dynamically allocated with
mutex_obj_alloc(). It allows us to share the locks among UVM objects.
 1.57.2.1  17-Aug-2010  uebayasi Sync with HEAD.
 1.62.2.1  06-Jun-2011  jruoho Sync with HEAD.
 1.65.2.1  23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.68.2.5  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.68.2.4  16-Jan-2013  yamt sync with (a bit old) head
 1.68.2.3  30-Oct-2012  yamt sync with head
 1.68.2.2  23-May-2012  yamt sync with head.
 1.68.2.1  17-Apr-2012  yamt sync with head
 1.69.6.2  12-Aug-2012  martin Pull up following revision(s) (requested by manu in ticket #484):
sys/fs/nilfs/nilfs_vnops.c: revision 1.18
sys/ufs/ufs/ufs_lookup.c: revision 1.117
sys/nfs/nfs_vnops.c: revision 1.295
sys/ufs/chfs/chfs_vnops.c: revision 1.8
sys/ufs/ext2fs/ext2fs_lookup.c: revision 1.70
sys/fs/unionfs/unionfs_vnops.c: revision 1.6
sys/kern/vfs_cache.c: revision 1.89
sys/fs/efs/efs_vnops.c: revision 1.26
sys/fs/hfs/hfs_vnops.c: revision 1.26
sys/fs/adosfs/adlookup.c: revision 1.16
sys/fs/puffs/puffs_vnops.c: revision 1.168
sys/fs/tmpfs/tmpfs_vnops.c: revision 1.98
sys/fs/ntfs/ntfs_vnops.c: revision 1.52
sys/fs/cd9660/cd9660_lookup.c: revision 1.20
sys/fs/msdosfs/msdosfs_lookup.c: revision 1.24
sys/fs/smbfs/smbfs_vnops.c: revision 1.80
sys/fs/udf/udf_vnops.c: revision 1.72
sys/fs/filecorefs/filecore_lookup.c: revision 1.14
sys/fs/puffs/puffs_node.c: revision 1.25
Move some the test for MAKEENTRY into the cache_enter(9). Make some
variables in vfs_cache.c static, __read_mostly, etc.
No objection on tech-kern@.
 1.69.6.1  07-May-2012  riz Pull up following revision(s) (requested by chs in ticket #204):
sys/fs/sysvbfs/sysvbfs_vnops.c: revision 1.44
sys/ufs/ffs/ffs_vfsops.c: revision 1.277
sys/fs/v7fs/v7fs_vnops.c: revision 1.11
sys/ufs/chfs/chfs_vnops.c: revision 1.7
sys/ufs/ext2fs/ext2fs_readwrite.c: revision 1.61
sys/miscfs/genfs/genfs_io.c: revision 1.54
sys/kern/vfs_wapbl.c: revision 1.52
sys/uvm/uvm_pager.h: revision 1.43
sys/ufs/ffs/ffs_vnops.c: revision 1.121
sys/kern/vfs_subr.c: revision 1.434
sys/fs/msdosfs/msdosfs_vnops.c: revision 1.83
sys/fs/ntfs/ntfs_vnops.c: revision 1.51
sys/fs/udf/udf_subr.c: revision 1.119
sys/miscfs/specfs/spec_vnops.c: revision 1.135
sys/ufs/ext2fs/ext2fs_vnops.c: revision 1.103
sys/fs/udf/udf_vnops.c: revision 1.71
sys/ufs/ufs/ufs_readwrite.c: revision 1.104
change vflushbuf() to take the full FSYNC_* flags.
translate FSYNC_LAZY into PGO_LAZY for VOP_PUTPAGES() so that
genfs_do_io() can set the appropriate io priority for the I/O.
this is the first part of addressing PR 46325.
mark all wapbl I/O as BPRIO_TIMECRITICAL.
this is the second part of addressing PR 46325.
 1.69.4.2  02-Jun-2012  mrg sync to latest -current.
 1.69.4.1  05-Apr-2012  mrg sync to latest -current.
 1.72.2.4  03-Dec-2017  jdolecek update from HEAD
 1.72.2.3  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.72.2.2  23-Jun-2013  tls resync from head
 1.72.2.1  20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.76.2.2  18-May-2014  rmind sync with head
 1.76.2.1  28-Aug-2013  rmind sync with head
 1.91.2.1  10-Aug-2014  tls Rebase.
 1.94.4.4  28-Aug-2017  skrll Sync with HEAD
 1.94.4.3  05-Oct-2016  skrll Sync with HEAD
 1.94.4.2  06-Jun-2015  skrll Sync with HEAD
 1.94.4.1  06-Apr-2015  skrll Sync with HEAD
 1.101.2.1  26-Apr-2017  pgoyette Sync with HEAD
 1.102.2.1  21-Apr-2017  bouyer Sync with HEAD
 1.106.10.2  21-Apr-2020  martin Sync with HEAD
 1.106.10.1  08-Apr-2020  martin Merge changes from current as of 20200406
 1.107.2.2  29-Feb-2020  ad Sync with head.
 1.107.2.1  17-Jan-2020  ad Sync with head.
 1.109.4.2  25-Apr-2020  bouyer Sync with bouyer-xenpvh-base2 (HEAD)
 1.109.4.1  20-Apr-2020  bouyer Sync with HEAD
 1.114.6.1  01-Aug-2021  thorpej Sync with HEAD.

RSS XML Feed