summaryrefslogtreecommitdiff
path: root/sys/ntfs/ntfs_vfsops.c
AgeCommit message (Collapse)Author
2024-09-04Fix some spelling.Marcus Glocker
Input and ok jmc@, jsg@
2022-01-11spellingJonathan Gray
ok jmc@
2020-02-27Remove unused "struct proc *" argument from the following functions:Martin Pieuchot
- ufs_chown() & ufs_chmod() - ufs_reclaim() - ext2fs_chown() & ext2fs_chmod() - ntfs_ntget() & ntfs_ntput() - ntfs_vgetex(), ntfs_ntlookup() & ntfs_ntlookupfile() While here use `ap->a_p' directly when it is only required to re-enter the VFS layer in order to help reducing the loop. ok visa@
2019-12-26Convert struct vfsops initializer to C99 style.Alexander Bluhm
OK visa@
2019-07-25vinvalbuf(9): tlseep -> tsleep_nsec(9); ok millert@cheloha
2018-05-27Drop unnecessary `p' parameter from vget(9).Visa Hankala
OK mpi@
2018-05-02Remove proc from the parameters of vn_lock(). The parameter isVisa Hankala
unnecessary because curproc always does the locking. OK mpi@
2018-04-28Clean up the parameters of VOP_LOCK() and VOP_UNLOCK(). It is alwaysVisa Hankala
curproc that does the locking or unlocking, so the proc parameter is pointless and can be dropped. OK mpi@, deraadt@
2018-02-10Syncronize filesystems to disk when suspending. Each mountpoint's vnodesTheo de Raadt
are pushed to disk. Dangling vnodes (unlinked files still in use) and vnodes undergoing change by long-running syscalls are identified -- and such filesystems are marked dirty on-disk while we are suspended (in case power is lost, a fsck will be required). Filesystems without dangling or busy vnodes are marked clean, resulting in faster boots following "battery died" circumstances. Tested by numerous developers, thanks for the feedback.
2017-12-11In uvm Chuck decided backing store would not be allocated proactivelyTheo de Raadt
for blocks re-fetchable from the filesystem. However at reboot time, filesystems are unmounted, and since processes lack backing store they are killed. Since the scheduler is still running, in some cases init is killed... which drops us to ddb [noted by bluhm]. Solution is to convert filesystems to read-only [proposed by kettenis]. The tale follows: sys_reboot() should pass proc * to MD boot() to vfs_shutdown() which completes current IO with vfs_busy VB_WRITE|VB_WAIT, then calls VFS_MOUNT() with MNT_UPDATE | MNT_RDONLY, soon teaching us that *fs_mount() calls a copyin() late... so store the sizes in vfsconflist[] and move the copyin() to sys_mount()... and notice nfs_mount copyin() is size-variant, so kill legacy struct nfs_args3. Next we learn ffs_mount()'s MNT_UPDATE code is sharp and rusty especially wrt softdep, so fix some bugs adn add ~MNT_SOFTDEP to the downgrade. Some vnodes need a little more help, so tie them to &dead_vnops. ffs_mount calling DIOCCACHESYNC is causing a bit of grief still but this issue is seperate and will be dealt with in time. couple hundred reboots by bluhm and myself, advice from guenther and others at the hut
2017-03-20Read the free clusters bitmap in 1MB chunksJeremie Courreges-Anglas
instead of trying to read it in one go and panic in malloc(9) with large NTFS filesystems. panic reported and fix tested by landry@
2016-09-07Remove usermount remnants. ok teduMartin Natano
2016-09-01Remove the unused ntfs write code. ok benno beckMartin Natano
2016-08-13Eliminate pointless casts to qaddr_t of a value being assigned to a void*Philip Guenther
ok kettenis@ krw@ natano@ dlg@ espie@
2016-06-19Remove the lockmgr() API. It is only used by filesystems, where it is aMartin Natano
trivial change to use rrw locks instead. All it needs is LK_* defines for the RW_* flags. tested by naddy and sthen on package building infrastructure input and ok jmc mpi tedu
2016-05-22When pulling an msdos formated umass stick during mount while theAlexander Bluhm
usb stack was busy, the kernel could trigger an uvm fault. There is a race between vop_generic_revoke() and sys_mount() where vgonel() could reset v_specinfo. Then v_specmountpoint is no longer valid. So after sleeping, msdosfs_mountfs() could crash in the error path. The code in the different *_mountfs() functions was inconsistent, implement the same check everywhere. OK krw@ natano@
2016-04-26Populate all necessary statfs members in .vfs_statfs. cd9660, udf,Martin Natano
msdosfs and nfsv2 don't set f_namemax. ntfs and ext2fs don't set f_namemeax and f_favail. fusefs doesn't set f_mntfromspec, f_favail and f_iosize. Also, make all filesystems use copy_statfs_info(), so that all statfs information is filled in correctly for the (sb != &mp->mnt-stat) case. ok stefan
2016-03-27When pulling and unmounting an umass USB stick, the file systemAlexander Bluhm
could end up in an inconsistent state. The fstype dependent mp->mnt_data was NULL, but the general mp was still listed as a valid mount point. Next access to the file system would crash with a NULL pointer dereference. If closing the device fails, the mount point must go away anyway. There is nothing we can do about it. Remove the workaround for the EIO error in the general unmount code, but do not generate any error in the file system specific unmount functions. OK natano@ beck@
2016-03-19Remove the unused flags argument from VOP_UNLOCK().natano
torture tested on amd64, i386 and macppc ok beck mpi stefan "the change looks right" deraadt
2016-03-17Set mnt_data to NULL after freeing the file system specific mount point.Alexander Bluhm
OK krw@ natano@ as part of a larger diff
2016-03-05ntfs populates ntfs_args, not msdosfs_args; ok espie@natano
2016-02-27Move mnt_maxsymlink from struct mount to struct ufsmount.natano
The concept of differentiating between "short" and "long" symlinks is specific to ufs/, so it shouldn't creep into the generic fs layer. Inspired by a similar commit to NetBSD. While there replace all references to mnt_maxsymlinklen in ufs/ext2fs with EXT2_MAXSYMLINKLEN, which is the constant max short symlink len for ext2fs. This allows to get rid of some (mnt_maxsymlinklen == 0) checks there, which is always false for ext2fs. input and ok stefan@ ok millert@
2015-03-14Remove some includes include-what-you-use claims don'tJonathan Gray
have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
2014-12-16must include lock.h if you want to play with locksTed Unangst
2014-12-09Sprinkle in a little more mallocarray().Doug Hogan
ok deraadt@ tedu@
2014-11-18Nuke yet more obvious #include duplications.Kenneth R Westerback
ok miod@
2014-07-12add a size argument to free. will be used soon, but for now default to 0.Ted Unangst
after discussions with beck deraadt kettenis.
2014-07-08decouple struct uvmexp into a new file, so that uvm_extern.h and sysctl.hTheo de Raadt
don't need to be married. ok guenther miod beck jsing kettenis
2014-01-19lazy init nthash to save some memory when it's not used. ok jsingTed Unangst
2013-12-02Use appropriate format specifiers in debug messages. In particular, avoidJoel Sing
casting almost everything to u_int32_t, then formatting as a signed int (which really helps when you're trying to debug based on 64-bit values). Looked over by krw@
2013-11-24Clean up the NTFS debug code - use uppercase names for the debug macros,Joel Sing
especially since 'dprintf' now has another meaning (at least outside of the kernel). Tweak the macro syntax so we can avoid having to double bracket all invocations. Also apply a good dose of style(9). ok krw@
2013-05-30More of the same: ntfs doesn't do inode numbers >2^32, so use a smaller typePhilip Guenther
internally, only using ino_t in the VFS layer APIs: vget, readdir, getattr
2013-04-15Add an f_mntfromspec member to struct statfs, which specifies the name ofJoel Sing
the special provided when the mount was requested. This may be the same as the special that was actually used for the mount (e.g. in the case of a device node) or it may be different (e.g. in the case of a DUID). Whilst here, change f_ctime to a 64 bit type and remove the pointless f_spare members. Compatibility goo courtesy of guenther@ ok krw@ millert@
2013-01-18Constrain the amount of kernel memory used by NTFS. Keep a small cache ofJoel Sing
loaded ntnodes and once the maximum is reached, unload the least recently used ntnode before loading a new one. This avoids leaving large data structures hanging around, which only get cleaned up when the vnode is reclaimed. Additionally, the buffer cache should contain the data needed to reload the ntnode. ok beck@
2013-01-14Ansify and apply style(9) to function definitions.Joel Sing
ok krw@
2013-01-13Destatic.Joel Sing
ok krw@
2013-01-02Remove code that is not used on OpenBSD.Joel Sing
ok miod@ krw@
2012-09-10Cleanup VFS mount string handling:Joel Sing
- Avoid using copyinstr() without checking the return value. - sys_mount() has already copied the path in, so pass this to the filesystem mount code so that it does not have to copy it in again. - Avoid copyinstr()/bzero() dance when we can simply bzero() and strlcpy(). ok krw@
2011-12-20respect the MNT_FORCE flag in ntfs_unmount and proceed even if there'sMike Belopuhov
someone holding a system vnode. prevents crashes with forced unmounts. silence ntfs_reclaim so that kernel won't spit out vprint's angrily. ok krw, beck
2011-07-04move the specfs code to a place people can see it; ok guenther thib krwTheo de Raadt
2011-07-04bread does nothing with its ucred argument. remove it. ok matthewTed Unangst
2011-04-03Teach ntfs_mount() how to handle disklabel UIDs.Joel Sing
Diff from Antti Harri.
2010-12-21Bring back the "End the VOP experiment." diff, naddy's issues whereThordur I. Bjornsson
unrelated, and his alpha is much happier now. OK deraadt@
2010-09-10Backout the VOP diff until the issues naddy was seeing on alpha (gcc3)Thordur I. Bjornsson
have been resolved.
2010-09-07Allow NTFS to compile by cutting it over to the new VOP world order.Thordur I. Bjornsson
Small cleanup while here, nuke the ntfs_bypass function and just use eopnotsupp like every other filesystem, it makes no sense to return ENOTTY for unimplemented VOPs.
2010-09-04revert previous "simplification". kcornies at gmail says it doesn't work.Ted Unangst
2010-08-22the upper case table code was a lot more complicated than it needed to be.Ted Unangst
2010-08-12clean up some macro obfuscation and assorted styling problems.Ted Unangst
fix a bonus off by one bug. ok matthew
2010-08-08do not unlock vnode before calling vput. should fix ray's panic.Ted Unangst
ok deraadt krw
2010-07-03Last bit of thib@ locking diff from long ago. Put proper lockingKenneth R Westerback
around vinvalbuf(). vrele() -> vput() after VOP_CLOSE(). ok tedu@