Home | History | Annotate | Download | only in msdosfs
History log of /src/sys/fs/msdosfs/msdosfs_lookup.c
RevisionDateAuthorComments
 1.41  06-Aug-2022  andvar s/blity/bility/ in various words, mainly in comments.
 1.40  23-Oct-2021  thorpej Sanitize the symbol namespace. NFC.
 1.39  23-Oct-2021  hannken Move msdosfs_rename() and doscheckpath() to new file msdosfs_rename.c.

No functional change.
 1.38  23-Oct-2021  hannken Factor out the lookup results from struct denode.

No functional change.
 1.37  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.36  04-Apr-2020  ad branches: 1.36.8;
Merge the remaining changes from the ad-namecache branch, affecting namei()
and getcwd():

- push vnode locking back as far as possible.
- do most lookups directly in the namecache, avoiding vnode locks & refs.
- don't block new refs to vnodes across VOP_INACTIVE().
- get shared locks for VOP_LOOKUP() if the file system supports it.
- correct lock types for VOP_ACCESS() / VOP_GETATTR() in a few places.

Possible future enhancements:

- make the lookups lockless.
- support dotdot lookups by being lockless and inferring absence of chroot.
- maybe make it work for layered file systems.
- avoid vnode references at the root & cwd.
 1.35  30-Jan-2016  mlelstv branches: 1.35.18; 1.35.24;
Add support to msdosfs and makefs to generate correct Unicode (UCS-2) directory
entries from UTF8 encoded file names.
 1.34  28-Mar-2015  maxv Remove the 'cred' argument from bread(). Remove a now unused var in
ffs_snapshot.c. Update the man page accordingly.

ok hannken@
 1.33  08-Jul-2014  hannken branches: 1.33.4;
Change msdosfs from hashlist to vcache:
- Use (dir_cluster, dir_offset, dir_generation) as key, where
dir_generation is non-zero and unique for unlinked but open nodes.
- Change deget() to return a vnode as it is unsafe to return a
referenced but unlocked denode.
 1.32  07-Feb-2014  hannken branches: 1.32.2;
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.31  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.30  24-Dec-2013  mlelstv don't treat adjacent members as a larger array
Coverity CID 977367
 1.29  26-Jan-2013  christos branches: 1.29.2;
more cross-compile friendly.
 1.28  26-Jan-2013  christos expose more stuff if MAKEFS is defined for the headers, and arrange for
the source file to be compilable from userland.
 1.27  20-Dec-2012  hannken Change bread() and breadn() to never return a buffer on
error and modify all callers to not brelse() on error.

Welcome to 6.99.16

PR kern/46282 (6.0_BETA crash: msdosfs_bmap -> pcbmap -> bread -> bio_doread)
 1.26  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.25  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.24  22-Jul-2012  rmind branches: 1.24.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.23  30-Nov-2010  dholland branches: 1.23.8; 1.23.14;
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.22  30-Jul-2010  mlelstv Return EINVAL for rename and delete operations to the
root directory instead of the erroneous EROFS.
 1.21  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.20  08-Jan-2010  pooka branches: 1.20.2; 1.20.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.19  14-Mar-2009  dsl ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.18  14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.17  23-Jan-2009  jmcneill branches: 1.17.2;
From FreeBSD, 10 years ago;

Now empty DOS filesystems default to long file names. Non-empty filesystems
without traces of Win95 default to short file names, as before.
 1.16  16-May-2008  hannken branches: 1.16.6; 1.16.8;
Make sure all cached buffers with valid, not yet written data have been
run through copy-on-write. Call fscow_run() with valid data where possible.

The LP_UFSCOW hack is no longer needed to protect ffs_copyonwrite() against
endless recursion.

- Add a flag B_MODIFY to bread(), breada() and breadn(). If set the caller
intends to modify the buffer returned.

- Always run copy-on-write on buffers returned from ffs_balloc().

- Add new function ffs_getblk() that gets a buffer, assigns a new blkno,
may clear the buffer and runs copy-on-write. Process possible errors
from getblk() or fscow_run(). Part of PR kern/38664.

Welcome to 4.99.63

Reviewed by: YAMAMOTO Takashi <yamt@netbsd.org>
 1.15  26-Nov-2007  pooka branches: 1.15.14; 1.15.16; 1.15.18; 1.15.20;
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.14  10-Oct-2007  ad branches: 1.14.4;
Merge from vmlocking:

- Split vnode::v_flag into three fields, depending on field locking.
- simple_lock -> kmutex in a few places.
- Fix some simple locking problems.
 1.13  08-Oct-2007  ad Merge brelse() changes from the vmlocking branch.
 1.12  04-Mar-2007  christos branches: 1.12.2; 1.12.14; 1.12.16; 1.12.18;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.11  09-Dec-2006  chs branches: 1.11.2;
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.10  25-Nov-2006  scw branches: 1.10.2;
Support FAT filesystems on non-DEV_BSIZE media.

Based on the patches provided in PR kern/17398 by Trevin Beattie.
 1.9  14-May-2006  elad branches: 1.9.8; 1.9.10;
integrate kauth.
 1.8  11-Dec-2005  christos branches: 1.8.4; 1.8.6; 1.8.8; 1.8.10; 1.8.12;
merge ktrace-lwp.
 1.7  14-Sep-2005  soda mention what is the failure case, from FreeBSD revision 1.46 cvs log
 1.6  14-Sep-2005  christos PR/31312: Juan RP: Don't use negative cacheing on msdosfs, because of the
evil case preserving and case sensitive semantics. From FreeBSD.
 1.5  29-May-2005  christos branches: 1.5.2;
- rename variables to avoid shadowing.
- add a few const.
 1.4  26-Feb-2005  perry nuke trailing whitespace
 1.3  29-Jun-2003  fvdl branches: 1.3.2; 1.3.10; 1.3.12;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.2  28-Jun-2003  darrenr Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
 1.1  26-Dec-2002  jdolecek branches: 1.1.2;
move msdosfs code from sys/msdosfs to sys/fs/msdosfs
 1.1.2.2  29-Dec-2002  thorpej With with HEAD.
 1.1.2.1  26-Dec-2002  thorpej file msdosfs_lookup.c was added on branch nathanw_sa on 2002-12-29 19:56:03 +0000
 1.3.12.1  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.3.10.1  29-Apr-2005  kent sync with -current
 1.3.2.5  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.3.2.4  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.3.2.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.2.2  18-Sep-2004  skrll Sync with HEAD.
 1.3.2.1  02-Jul-2003  darrenr Apply the aborted ktrace-lwp changes to a specific branch. This is just for
others to review, I'm concerned that patch fuziness may have resulted in some
errant code being generated but I'll look at that later by comparing the diff
from the base to the branch with the file I attempt to apply to it. This will,
at the very least, put the changes in a better context for others to review
them and attempt to tinker with removing passing of 'struct lwp' through
the kernel.
 1.5.2.5  07-Dec-2007  yamt sync with head
 1.5.2.4  27-Oct-2007  yamt sync with head.
 1.5.2.3  03-Sep-2007  yamt sync with head.
 1.5.2.2  30-Dec-2006  yamt sync with head.
 1.5.2.1  21-Jun-2006  yamt sync with head.
 1.8.12.1  24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.8.10.1  06-May-2006  christos - Move kauth_cred_t declaration to <sys/types.h>
- Cleanup struct ucred; forward declarations that are unused.
- Don't include <sys/kauth.h> in any header, but include it in the c files
that need it.

Approved by core.
 1.8.8.1  24-May-2006  yamt sync with head.
 1.8.6.1  01-Jun-2006  kardel Sync with head.
 1.8.4.1  09-Sep-2006  rpaulo sync with head
 1.9.10.1  10-Dec-2006  yamt sync with head.
 1.9.8.1  12-Jan-2007  ad Sync with head.
 1.10.2.2  04-Aug-2010  bouyer Pull up following revision(s) (requested by mlelstv in ticket #1402):
sys/fs/msdosfs/msdosfs_lookup.c: revision 1.22
Return EINVAL for rename and delete operations to the
root directory instead of the erroneous EROFS.
 1.10.2.1  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.11.2.1  12-Mar-2007  rmind Sync with HEAD.
 1.12.18.1  14-Oct-2007  yamt sync with head.
 1.12.16.2  09-Jan-2008  matt sync with HEAD
 1.12.16.1  06-Nov-2007  matt sync with HEAD
 1.12.14.2  27-Nov-2007  joerg Sync with HEAD. amd64 Xen support needs testing.
 1.12.14.1  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.12.2.2  17-Jun-2007  ad - Increase the number of thread priorities from 128 to 256. How the space
is set up is to be revisited.
- Implement soft interrupts as kernel threads. A generic implementation
is provided, with hooks for fast-path MD code that can run the interrupt
threads over the top of other threads executing in the kernel.
- Split vnode::v_flag into three fields, depending on how the flag is
locked (by the interlock, by the vnode lock, by the file system).
- Miscellaneous locking fixes and improvements.
 1.12.2.1  13-May-2007  ad - Pass the error number and residual count to biodone(), and let it handle
setting error indicators. Prepare to eliminate B_ERROR.
- Add a flag argument to brelse() to be set into the buf's flags, instead
of doing it directly. Typically used to set B_INVAL.
- Add a "struct cpu_info *" argument to kthread_create(), to be used to
create bound threads. Change "bool mpsafe" to "int flags".
- Allow exit of LWPs in the IDL state when (l != curlwp).
- More locking fixes & conversion to the new API.
 1.14.4.1  08-Dec-2007  mjf Sync with HEAD.
 1.15.20.1  23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.15.18.3  11-Aug-2010  yamt sync with head.
 1.15.18.2  11-Mar-2010  yamt sync with head
 1.15.18.1  04-May-2009  yamt sync with head.
 1.15.16.1  18-May-2008  yamt sync with head.
 1.15.14.1  02-Jun-2008  mjf Sync with HEAD.
 1.16.8.2  21-Nov-2010  riz Pull up following revision(s) (requested by mlelstv in ticket #1434):
sys/fs/msdosfs/msdosfs_lookup.c: revision 1.22
Return EINVAL for rename and delete operations to the
root directory instead of the erroneous EROFS.
 1.16.8.1  02-Feb-2009  snj Pull up following revision(s) (requested by jmcneill in ticket #383):
sys/fs/msdosfs/msdosfs_lookup.c: revision 1.17
From FreeBSD, 10 years ago;
Now empty DOS filesystems default to long file names. Non-empty filesystems
without traces of Win95 default to short file names, as before.
 1.16.6.2  28-Apr-2009  skrll Sync with HEAD.
 1.16.6.1  03-Mar-2009  skrll Sync with HEAD.
 1.17.2.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.20.4.2  05-Mar-2011  rmind sync with head
 1.20.4.1  03-Jul-2010  rmind sync with head
 1.20.2.1  17-Aug-2010  uebayasi Sync with HEAD.
 1.23.14.1  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.23.8.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.23.8.3  23-Jan-2013  yamt sync with head
 1.23.8.2  16-Jan-2013  yamt sync with (a bit old) head
 1.23.8.1  30-Oct-2012  yamt sync with head
 1.24.2.4  03-Dec-2017  jdolecek update from HEAD
 1.24.2.3  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.24.2.2  25-Feb-2013  tls resync with head
 1.24.2.1  20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.29.2.1  18-May-2014  rmind sync with head
 1.32.2.1  10-Aug-2014  tls Rebase.
 1.33.4.2  19-Mar-2016  skrll Sync with HEAD
 1.33.4.1  06-Apr-2015  skrll Sync with HEAD
 1.35.24.1  19-Jan-2020  ad Set IMNT_SHRLOOKUP and use it for the in-cache case. Need to check what
more can be done with tmpfs though, it can probably do the whole lookup.
 1.35.18.1  08-Apr-2020  martin Merge changes from current as of 20200406
 1.36.8.1  01-Aug-2021  thorpej Sync with HEAD.

RSS XML Feed