Home | History | Annotate | Download | only in tmpfs
History log of /src/sys/fs/tmpfs/tmpfs_rename.c
RevisionDateAuthorComments
 1.12  20-Oct-2021  thorpej Move a mis-placed KASSERT().
 1.11  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.10  03-Dec-2019  riastradh Omit obsolete comment and needless __diagused marker.
 1.9  14-Jul-2019  maxv Fix uninitialized variable: if 'tvp' is NULL, '*tdep' is not initialized.
This could have caused the KASSERT to wrongfully fire.

ok riastradh@
 1.8  06-Jul-2015  wiz branches: 1.8.10; 1.8.18;
Fix typo in comment.
 1.7  06-Jul-2015  hannken Change tmpfs to vcache.
- Use tmpfs node address as key.
- Remove tn_vlock, field tn_vnode now protected by vcache.
- Add a hold count to tmpfs node to prevent nodes from disappearing
while tmpfs_fhtovp() trys to vcache_get() them. Last holder
destroys reclaimed nodes.
- Remove the now unneeded parent unlock/lock for lookup of '..'.
 1.6  23-Nov-2013  rmind branches: 1.6.6;
- Simplify tmpfs_update(), eliminate tmpfs_note_t::tn_status and deferred
timestamp updates. Fix some incorrect updates and plug some missing ones.
Should fix PR/48385.
- tmpfs_rmdir: avoid O(n) scan when the directory is not empty and whiteout
entries were never added.
 1.5  08-Nov-2013  rmind tmpfs: replace the broken tmpfs_dircookie() logic which uses the node
address truncated to 31 bits (required for 32-bit readdir compatibility,
e.g. linux32). Instead, assign 2^31 range using the following logic:
- The first half of the 2^31 is assigned incrementally (the fast path).
- When exceeded, use the second half of 2^31, but manage with vmem(9).

It will require 2 billion files per-directory to trigger vmem(9) usage.
Also, while here, add some fixes for tmpfs_unmount().

Should fix PR/47739, PR/47480, PR/46088 and PR/41068.
Thanks to wiz@ for stress testing.
 1.4  27-Sep-2012  riastradh branches: 1.4.2;
Uncomment call to genfs_rename_cache_purge.

Fixes a side issue mentioned in PR kern/46990.

I left this commented to preserve the old behaviour of tmpfs_rename,
but it is obviously broken to omit the cache purge, and I'm surprised
nobody had encountered any problems with it until now.
 1.3  25-Sep-2012  riastradh Check tmpfs_rmdired_p after tmpfs_vnode_get when walking up the tree.

tmpfs_vnode_get drops all locks except possibly the reclaiming bit
lock to keep the tmpfs node from being reclaimed while we're still
interested in it. Consequently, it does not keep the directory's
existence invariant, so we must check that after tmpfs_vnode_get.

Fixes PR kern/46990. Tested by Wolfgang Stukenbrock.
 1.2  09-May-2012  riastradh branches: 1.2.2; 1.2.4; 1.2.6;
Fix omitted VN_KNOTE(fvp, NOTE_RENAME) in tmpfs_rename.

Missed that line while refactoring tmpfs_rename to use genfs_rename.
 1.1  09-May-2012  riastradh Adapt tmpfs_rename to use genfs_rename.
 1.2.6.3  03-Dec-2017  jdolecek update from HEAD
 1.2.6.2  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.6.1  20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.2.4.2  02-Jun-2012  mrg sync to latest -current.
 1.2.4.1  09-May-2012  mrg file tmpfs_rename.c was added on branch jmcneill-usbmp on 2012-06-02 11:09:32 +0000
 1.2.2.4  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.2.2.3  30-Oct-2012  yamt sync with head
 1.2.2.2  23-May-2012  yamt sync with head.
 1.2.2.1  09-May-2012  yamt file tmpfs_rename.c was added on branch yamt-pagecache on 2012-05-23 10:08:09 +0000
 1.4.2.1  18-May-2014  rmind sync with head
 1.6.6.1  22-Sep-2015  skrll Sync with HEAD
 1.8.18.2  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.8.18.1  08-Apr-2020  martin Merge changes from current as of 20200406
 1.8.10.1  29-Aug-2019  martin Pull up following revision(s) (requested by maxv in ticket #1345):

sys/fs/tmpfs/tmpfs_rename.c: revision 1.9

Fix uninitialized variable: if 'tvp' is NULL, '*tdep' is not initialized.

This could have caused the KASSERT to wrongfully fire.

ok riastradh@

RSS XML Feed