Home | History | Annotate | Download | only in udf
History log of /src/sys/fs/udf/udf_allocation.c
RevisionDateAuthorComments
 1.48  05-Jan-2025  andvar fix various typos in comments.
 1.47  22-May-2022  andvar fix various small typos, mainly in comments.
 1.46  03-Feb-2022  reinoud Revere modification of initializer; it can lead to race conditions where two
allocation would pick the `empty' space causing a panic later on.
 1.45  28-Jan-2022  reinoud On freeing a virtual address in the VAT, use the correct value; this might
confuse other implementations who can reject the VAT on this.
 1.44  03-Sep-2021  andvar fix typos in comments, mainly s/extention/extension/ and s/sufficent/sufficient/
 1.43  20-Aug-2021  andvar fix various typos in comments and log messages.
 1.42  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.41  23-Apr-2020  ad branches: 1.41.6;
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.40  14-Oct-2018  jdolecek branches: 1.40.4; 1.40.10;
remove M_CANFAIL flag for malloc(9) - it was completely ignored, so had
actually no effect
 1.39  04-Jan-2017  christos branches: 1.39.14; 1.39.16;
PR/51777: David Binderman: Remove unused computation
 1.38  24-Aug-2015  hannken branches: 1.38.2;
Remove dirtynodes_cv, it is only used for timed waits without any signals.

Replace the cv_timedwait with kpause.
 1.37  03-Dec-2014  reinoud Relax the KASSERT since an equal size is no issue
 1.36  30-Oct-2013  mrg branches: 1.36.6;
used __diagused where appropriate.
 1.35  18-Oct-2013  christos fix unused variable warnings
 1.34  09-Aug-2013  reinoud Fix 32 bit issue in main file read-in function. On both 32 bit and 64 bit
hosts a missing cast would result in `garbage' after the 4Gbyte limit.
 1.33  03-Jul-2013  reinoud On growing a node that was recorded inside the (E)FE, don't forget to set the
size of the node to the NEW size. This was reported by the `t_io
udf_shrinkfile' testcase.

Fixes PR kern/47985
 1.32  16-Jun-2011  hannken branches: 1.32.2; 1.32.8; 1.32.12; 1.32.14; 1.32.16; 1.32.22;
Rename uvm_vnp_zerorange(struct vnode *, off_t, size_t) to
ubc_zerorange(struct uvm_object *, off_t, size_t, int) changing
the first argument to an uvm_object and adding a flags argument.

Modify tmpfs_reg_resize() to zero the backing store (aobj) instead
of the vnode. Ubc_purge() no longer panics when unmounting tmpfs.

Keep uvm_vnp_zerorange() until the next kernel version bump.
 1.31  14-Jan-2011  reinoud branches: 1.31.6;
Metadata partition (v2.50+) bugfix commit :

* fix copying of the extents of the metadata node to the metadatamirror node;
it was not copying all extents.

* fix truncing metadata partition:
* fix endian conversions
* fix information length calculation so its truncated to the right length!

* allow for setting maximum extent length in extent merging. This is needed
since extents in the metadata partition files are only to be in allocation
unit sizes.

* adjust grow and shrink node to set the granularity of the maximum length of
an extent when encountering a metadatafile or metadatamirror file.
 1.30  22-Dec-2010  reinoud Growing the metadata partition is not yet implemented. Be so kind to report
this as unimplemented when the debug flag asks for it!
 1.29  26-Feb-2010  reinoud branches: 1.29.2;
Typo and style
 1.28  25-Feb-2010  reinoud First part of shrinking/growing metadata partition support:

- extending the metadata partition

Still to follow:
- sparsify metadata partition
- growing the metadata partition
- unsparsifying metadata partition
 1.27  27-Jun-2009  reinoud branches: 1.27.2;
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.
 1.26  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.25  18-Jun-2009  reinoud Fix nitpicky spacing and debug printout
 1.24  18-Jun-2009  reinoud Remove unneeded (and unused) inclusion of "opt_quota.h"
 1.23  19-May-2009  reinoud Account for the logical blocks recorded by the extent in the right endian!
 1.22  19-May-2009  reinoud A descriptor's CRC lenth is 16 bit so use udf_rw16() on tag.desc_crc_len.
 1.21  21-Apr-2009  reinoud Fix endian related bug when using discs with a meta-data partition on
big-endian machines.
 1.20  25-Mar-2009  reinoud Fix possible overshoot when allocating from a space bitmap when ffs(3) returns
a too big offset for the bitmap.
 1.19  16-Dec-2008  pooka branches: 1.19.2;
The great QUOTA purge of '08: get rid of those #ifdef QUOTA and
#include "opt_quota.h" which do exactly nothing. Speeds up kernel
compilation by 1.375*10^-20001 seconds. But leave the most moxious
comment in msdosfs_vfsops untouched.
 1.18  29-Aug-2008  reinoud branches: 1.18.2; 1.18.4;
Remove all remaining traces of UDF_READWRITE since it has been removed as
option.
 1.17  06-Aug-2008  reinoud Rewrite allocation scheme's determination and implementation replacing the
old somewhat naive selection scheme that didn't allow different allocation
settings for nodes, directory information (FIDs) and data.

Also fix some curious side-effects of atime updates on RMW devices.
 1.16  28-Jul-2008  reinoud Streamline allocation to prepare it for metadata partition. Also add
preliminary Metadata partition write support but its disabled still since
its not finished yet and not functioning correctly. All other formats are
checked and should work fine.
 1.15  26-Jul-2008  reinoud Clarify not implemented allocation schemes; mostly UDF 2.50
HD-DVD/BluRay-RE and UDF 2.60 for BluRay-R
 1.14  19-Jul-2008  reinoud Use the allocation descriptor types selected on mount when growing from an
internal to an extent recording.
 1.13  18-Jul-2008  reinoud Hopefully fix gcc type puned warning.
 1.12  16-Jul-2008  reinoud Make UDF allocation-sanity check optional even if the DEBUG flag is
specified. This should be sysctl-able when compiled with the DEBUG flag
eventually.
 1.11  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.10  03-Jul-2008  reinoud branches: 1.10.2;
Fix rare allocation problem when a fragmented file is truncated to a
non-zero length and the last extent was allocated.
 1.9  02-Jul-2008  reinoud Update node sanity check system and redo allocation recording fixing
corruptions that could take place when overwriting sparse files.

Still one rare corruption possible where blocks are accidentally marked
free, but the cause is not yet found and looking at the pattern it won't
happen in every day use.
 1.8  30-Jun-2008  reinoud Fix serious allocation recording bug if overwriting piece that was
allocated before. Fixes regression test on random overwriting data.

Also fix endian issues and add extra documentation to variables.
 1.7  28-Jun-2008  reinoud When shrinking the file, do clean the freed part in the descriptor; all
unused space need to be zero filled.
 1.6  26-Jun-2008  reinoud Count the length correctly when encountering an allocation extension
redirect in the sanity checking.
 1.5  25-Jun-2008  reinoud Fix lookup problems in very fragmented metadata partitions that use
allocation extent descriptors.
 1.4  25-Jun-2008  reinoud Fix extended allocation descriptor handling in translate file extent
 1.3  25-Jun-2008  reinoud Fix allocation extensions descriptor reading and do free them on node
destruction!
 1.2  20-May-2008  reinoud branches: 1.2.2; 1.2.4; 1.2.6;
Remove bogus KASSERT(); if we shrink the file, the number of allocated
blocsk are of course not the same... duh!
 1.1  14-May-2008  reinoud branches: 1.1.2; 1.1.4;
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.1.4.3  04-Jun-2008  yamt sync with head
 1.1.4.2  18-May-2008  yamt sync with head.
 1.1.4.1  14-May-2008  yamt file udf_allocation.c was added on branch yamt-pf42 on 2008-05-18 12:35:05 +0000
 1.1.2.6  11-Mar-2010  yamt sync with head
 1.1.2.5  18-Jul-2009  yamt sync with head.
 1.1.2.4  20-Jun-2009  yamt sync with head
 1.1.2.3  04-May-2009  yamt sync with head.
 1.1.2.2  16-May-2008  yamt sync with head.
 1.1.2.1  14-May-2008  yamt file udf_allocation.c was added on branch yamt-nfs-mp on 2008-05-16 02:25:21 +0000
 1.2.6.3  18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.2.6.2  23-Jun-2008  wrstuden Add files to branch that were added on -current.

After this, all that's left of update is to merge some changes
that had conflicts.
 1.2.6.1  20-May-2008  wrstuden file udf_allocation.c was added on branch wrstuden-revivesa on 2008-06-23 05:02:13 +0000
 1.2.4.6  31-Jul-2008  simonb Sync with head.
 1.2.4.5  28-Jul-2008  simonb Sync with head.
 1.2.4.4  22-Jul-2008  simonb Sync with head.
 1.2.4.3  18-Jul-2008  simonb Sync with head.
 1.2.4.2  03-Jul-2008  simonb Sync with head.
 1.2.4.1  27-Jun-2008  simonb Sync with head.
 1.2.2.6  17-Jan-2009  mjf Sync with HEAD.
 1.2.2.5  28-Sep-2008  mjf Sync with HEAD.
 1.2.2.4  02-Jul-2008  mjf Sync with HEAD.
 1.2.2.3  29-Jun-2008  mjf Sync with HEAD.
 1.2.2.2  02-Jun-2008  mjf Sync with HEAD.
 1.2.2.1  20-May-2008  mjf file udf_allocation.c was added on branch mjf-devfs2 on 2008-06-02 13:24:06 +0000
 1.10.2.1  19-Oct-2008  haad Sync with HEAD.
 1.18.4.4  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.18.4.3  06-Jun-2009  bouyer Pull up following revision(s) (requested by reinoud in ticket #770):
sys/fs/udf/udf_subr.c: revision 1.88, 1.89
sys/fs/udf/udf_bswap.h: revision 1.6, 1.7
sys/fs/udf/udf_allocation.c: revision 1.22, 1.23
sbin/newfs_udf/udf_create.c: revision 1.16
Fix *serious* bug in bswapping definitions for big endian machines.
ANSI-fy. No idea why they weren't so in the first place.
Fix newfs_udf to create a valid disc images on bigendian machines.
A descriptor's CRC lenth is 16 bit so use udf_rw16() on tag.desc_crc_len.
Forgot to use the udf_rw16() on the descriptor crc lengths of FID's!
Also fix a few dubiously formatted checks.
On creation of a new node, don't forget to set the length of the allocated
space in the right endian!
Account for the logical blocks recorded by the extent in the right endian!
 1.18.4.2  23-Apr-2009  snj branches: 1.18.4.2.4;
Pull up following revision(s) (requested by reinoud in ticket #716):
sys/fs/udf/udf_allocation.c: revision 1.21
Fix endian related bug when using discs with a meta-data partition on
big-endian machines.
 1.18.4.1  31-Mar-2009  snj Pull up following revision(s) (requested by reinoud in ticket #610):
sys/fs/udf/udf_allocation.c: revision 1.20
Fix possible overshoot when allocating from a space bitmap when ffs(3) returns
a too big offset for the bitmap.
 1.18.4.2.4.1  21-Apr-2010  matt sync to netbsd-5
 1.18.2.2  28-Apr-2009  skrll Sync with HEAD.
 1.18.2.1  19-Jan-2009  skrll Sync with HEAD.
 1.19.2.2  23-Jul-2009  jym Sync with HEAD.
 1.19.2.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.27.2.1  30-Apr-2010  uebayasi Sync with HEAD.
 1.29.2.1  05-Mar-2011  rmind sync with head
 1.31.6.1  23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.32.22.1  07-Sep-2013  bouyer Pull up following revision(s) (requested by reinoud in ticket #930):
sys/fs/udf/udf_allocation.c: revision 1.34
Fix 32 bit issue in main file read-in function. On both 32 bit and 64 bit
hosts a missing cast would result in `garbage' after the 4Gbyte limit.
 1.32.16.2  18-May-2014  rmind sync with head
 1.32.16.1  28-Aug-2013  rmind sync with head
 1.32.14.1  07-Sep-2013  bouyer Pull up following revision(s) (requested by reinoud in ticket #930):
sys/fs/udf/udf_allocation.c: revision 1.34
Fix 32 bit issue in main file read-in function. On both 32 bit and 64 bit
hosts a missing cast would result in `garbage' after the 4Gbyte limit.
 1.32.12.2  03-Dec-2017  jdolecek update from HEAD
 1.32.12.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.32.8.1  07-Sep-2013  bouyer Pull up following revision(s) (requested by reinoud in ticket #930):
sys/fs/udf/udf_allocation.c: revision 1.34
Fix 32 bit issue in main file read-in function. On both 32 bit and 64 bit
hosts a missing cast would result in `garbage' after the 4Gbyte limit.
 1.32.2.1  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.36.6.3  05-Feb-2017  skrll Sync with HEAD
 1.36.6.2  22-Sep-2015  skrll Sync with HEAD
 1.36.6.1  06-Apr-2015  skrll Sync with HEAD
 1.38.2.1  07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.39.16.1  10-Jun-2019  christos Sync with HEAD
 1.39.14.1  20-Oct-2018  pgoyette Sync with head
 1.40.10.1  25-Apr-2020  bouyer Sync with bouyer-xenpvh-base2 (HEAD)
 1.40.4.2  18-Apr-2022  martin Pull up following revision(s) (requested by reinoud in ticket #1437):

sys/fs/udf/udf_allocation.c: revision 1.46

Revere modification of initializer; it can lead to race conditions where two
allocation would pick the `empty' space causing a panic later on.
 1.40.4.1  13-Mar-2022  martin Pull up following revision(s), all via patch,
requested by reinoud in ticket #1432:

sys/fs/udf/udf_vfsops.c: revision 1.83
sys/fs/udf/udf_allocation.c: revision 1.45
sys/fs/udf/udf_subr.c: revision 1.160
sys/fs/udf/udf_subr.c: revision 1.161

While searching the VAT on recordable media, search the last sector too!
This fixes Win10 formatted discs from being mounted incorrectly.

Make sysctl udf.verbose dependent on UDF_DEBUG instead of DEBUG

Fix serious issue with recordable media formatted with Win10. When closing it
after modification the VAT was written out corrupted making the disc
unreadable anymore on remount. Thanks for ig@ for spotting it in the wild!

On freeing a virtual address in the VAT, use the correct value; this might
confuse other implementations who can reject the VAT on this.
 1.41.6.1  01-Aug-2021  thorpej Sync with HEAD.

RSS XML Feed