summaryrefslogtreecommitdiffstats
path: root/sys/ufs
Commit message (Collapse)AuthorAgeFilesLines
* white spacephk2004-12-141-4/+4
|
* Implement simpler panics for VOP_{read,write} on fifos.phk2004-12-141-61/+8
|
* LINT defines things which compile in code that as referring to the oldimp2004-12-131-2/+2
| | | | | | | a_desc element. change this to the new a_gen.a_desc to reflect changes to vnode_if.h generation. Noticed by: tinderbox, phk
* With the introduction of UFS2 we started looking for superblocks inphk2004-12-121-0/+1
| | | | | | | | | | | | | | | | | four different locations on a prospective filesystem. If we found none, we forgot to invalidate the four buffers, thus the following sequence would fails: (md0 = blank disk) mount /dev/md0 /mnt (fails, no superblocks) newfs /dev/md0 (writes using physio which does not go through buffercache). mount /dev/md0 /mnt (still fails, the four cached buffers still contain no superblocks) Found by: ru
* Revert previous commit. The null-pointer function call (a dereferencemarcel2004-12-111-4/+4
| | | | | | | | | on ia64) was not the result of a change in the vector operations. It was caused by the NFS locking code using a FIFO and those bypassing the vnode. This indirectly caused the panic. The NFS locking code has been changed. Requested by: phk
* Fixes a bug that caused UFS2 filesystems bigger than 2TB tomckusick2004-12-092-10/+10
| | | | | | | | prematurely report that they were full and/or to panic the kernel with the message ``ffs_clusteralloc: allocated out of group''. Submitted by: Henry Whincup <henry@jot.to> MFC after: 1 week
* Fix snapshot creation.phk2004-12-081-1/+1
|
* Fix nfs exports (for now). The real fix is to teach mountd aboutphk2004-12-071-9/+4
| | | | nmount.
* The remaining part of nmount/omount/rootfs mount changes. I cannot sensiblyphk2004-12-071-94/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | split the conversion of the remaining three filesystems out from the root mounting changes, so in one go: cd9660: Convert to nmount. Add omount compat shims. Remove dedicated rootfs mounting code. Use vfs_mountedfrom() Rely on vfs_mount.c calling VFS_STATFS() nfs(client): Convert to nmount (the simple way, mount_nfs(8) is still necessary). Add omount compat shims. Drop COMPAT_PRELITE2 mount arg compatibility. ffs: Convert to nmount. Add omount compat shims. Remove dedicated rootfs mounting code. Use vfs_mountedfrom() Rely on vfs_mount.c calling VFS_STATFS() Remove vfs_omount() method, all filesystems are now converted. Remove MNTK_WANTRDWR, handling RO/RW conversions is a filesystem task, and they all do it now. Change rootmounting to use DEVFS trampoline: vfs_mount.c: Mount devfs on /. Devfs needs no 'from' so this is clean. symlink /dev to /. This makes it possible to lookup /dev/foo. Mount "real" root filesystem on /. Surgically move the devfs mountpoint from under the real root filesystem onto /dev in the real root filesystem. Remove now unnecessary getdiskbyname(). kern_init.c: Don't do devfs mounting and rootvnode assignment here, it was already handled by vfs_mount.c. Remove now unused bdevvp(), addaliasu() and addalias(). Put the few necessary lines in devfs where they belong. This eliminates the second-last source of bogo vnodes, leaving only the lemming-syncer. Remove rootdev variable, it doesn't give meaning in a global context and was not trustworth anyway. Correct information is provided by statfs(/).
* VFS_STATFS(mp, ...) is mostly called with &mp->mnt_stat, but a few casesphk2004-12-051-16/+0
| | | | | | | | doesn't. Most of the implementations have grown weeds for this so they copy some fields from mnt_stat if the passed argument isn't that. Fix this the cleaner way: Always call the implementation on mnt_stat and copy that in toto to the VFS_STATFS argument if different.
* Fix null-pointer indirect function calls introduced in the previousmarcel2004-12-051-4/+4
| | | | | | | | | | | | commit. In the new world order, the transitive closure on the vector operations is not precomputed. As such, it's unsafe to actually use any of the function pointers in an indirect function call. They can be null, and we need to use the default vector in that case. This is mostly a quick fix for the four function pointers that are ed explicitly. A more generic or scalable solution is likely to see the light of day. No pathos on: current@
* typo in comment.phk2004-12-031-1/+1
|
* Back when VOP_* was introduced, we did not have new-style structphk2004-12-015-147/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | initializations but we did have lofty goals and big ideals. Adjust to more contemporary circumstances and gain type checking. Replace the entire vop_t frobbing thing with properly typed structures. The only casualty is that we can not add a new VOP_ method with a loadable module. History has not given us reason to belive this would ever be feasible in the the first place. Eliminate in toto VOCALL(), vop_t, VNODEOP_SET() etc. Give coda correct prototypes and function definitions for all vop_()s. Generate a bit more data from the vnode_if.src file: a struct vop_vector and protype typedefs for all vop methods. Add a new vop_bypass() and make vop_default be a pointer to another struct vop_vector. Remove a lot of vfs_init since vop_vector is ready to use from the compiler. Cast various vop_mumble() to void * with uppercase name, for instance VOP_PANIC, VOP_NULL etc. Implement VCALL() by making vdesc_offset the offsetof() the relevant function pointer in vop_vector. This is disgusting but since the code is generated by a script comparatively safe. The alternative for nullfs etc. would be much worse. Fix up all vnode method vectors to remove casts so they become typesafe. (The bulk of this is generated by scripts)
* Mechanically change prototypes for vnode operations to use the new typedefs.phk2004-12-012-36/+36
|
* Use system wide no-op vfs_start function.phk2004-11-253-16/+0
|
* - Eliminate the acquisition and release of the bqlock in bremfree() byjeff2004-11-181-1/+2
| | | | | | | | | | | | | | | | | | | | setting the B_REMFREE flag in the buf. This is done to prevent lock order reversals with code that must call bremfree() with a local lock held. This also reduces overhead by removing two lock operations per buf for fsync() and similar. - Check for the B_REMFREE flag in brelse() and bqrelse() after the bqlock has been acquired so that we may remove ourself from the free-list. - Provide a bremfreef() function to immediately remove a buf from a free-list for use only by NFS. This is done because the nfsclient code overloads the b_freelist queue for its own async. io queue. - Simplify the numfreebuffers accounting by removing a switch statement that executed the same code in every possible case. - getnewbuf() can encounter locked bufs on free-lists once Giant is removed. Remove a panic associated with this condition and delay asserts that inspect the buf until after it is locked. Reviewed by: phk Sponsored by: Isilon Systems, Inc.
* Make VOP_BMAP return a struct bufobj for the underlying storage devicephk2004-11-151-3/+3
| | | | | | | | | instead of a vnode for it. The vnode_pager does not and should not have any interest in what the filesystem uses for backend. (vfs_cluster doesn't use the backing store argument.)
* Be prepared to accept NULL mountargs as part of root-mounting.phk2004-11-131-5/+9
|
* Put back the vfs_object_create() calls, they do make a difference whenphk2004-11-121-0/+2
| | | | | | my test-setup does what I want it to instead of what I ask it to. Pointed out by: tegge
* fix some commentsphk2004-11-101-4/+1
|
* Use mount flags instead of NULL path to detect root filesystem mount.phk2004-11-091-1/+1
|
* Stop pretending to have a vm_object backing the underlying disk vnode:phk2004-11-091-9/+0
| | | | | it isn't used for anything anywhere and the vnode_pager would explode if we attempted to.
* Properly implement a default version of VOP_GETWRITEMOUNT.phk2004-11-061-1/+0
| | | | | Remove improper access to vop_stdgetwritemount() which should and will instead rely on the VOP default path.
* Don't grab the exclusive bit on a root filesystem until we are willingphk2004-11-041-14/+14
| | | | to mount it. Doing so prevented fsck to be run after a refused mount.
* Move UFS from DEVFS backing to GEOM backing.phk2004-10-2910-124/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This eliminates a bunch of vnode overhead (approx 1-2 % speed improvement) and gives us more control over the access to the storage device. Access counts on the underlying device are not correctly tracked and therefore it is possible to read-only mount the same disk device multiple times: syv# mount -p /dev/md0 /var ufs rw 2 2 /dev/ad0 /mnt ufs ro 1 1 /dev/ad0 /mnt2 ufs ro 1 1 /dev/ad0 /mnt3 ufs ro 1 1 Since UFS/FFS is not a synchrousely consistent filesystem (ie: it caches things in RAM) this is not possible with read-write mounts, and the system will correctly reject this. Details: Add a geom consumer and a bufobj pointer to ufsmount. Eliminate the vnode argument from softdep_disk_prewrite(). Pick the vnode out of bp->b_vp for now. Eventually we should find it through bp->b_bufobj->b_private. In the mountcode, use g_vfs_open() once we have used VOP_ACCESS() to check permissions. When upgrading and downgrading between r/o and r/w do the right thing with GEOM access counts. Remove all the workarounds for not being able to do this with VOP_OPEN(). If we are the root mount, drop the exclusive access count until we upgrade to r/w. This allows fsck of the root filesystem and the MNT_RELOAD to work correctly. Set bo_private to the GEOM consumer on the device bufobj. Change the ffs_ops->strategy function to call g_vfs_strategy() In ufs_strategy() directly call the strategy on the disk bufobj. Same in rawread. In ffs_fsync() we will no longer see VCHR device nodes, so remove code which synced the filesystem mounted on it, in case we came there. I'm not sure this code made sense in the first place since we would have taken the specfs route on such a vnode. Redo the highly bogus readblock() function in the snapshot code to something slightly less bogus: Constructing an uio and using physio was really quite a detour. Instead just fill in a bio and ship it down.
* We only support backing UFS/FFS with disks.phk2004-10-281-10/+3
|
* Eliminate unnecessary KASSERTS.phk2004-10-272-4/+0
|
* KASSERT that we only get to prewrite() on writes.phk2004-10-261-2/+2
|
* White space changes. Add missing static.phk2004-10-261-6/+5
|
* Replace single case switch() with if().phk2004-10-261-8/+2
|
* Vertically align comment.phk2004-10-261-1/+1
|
* The island council met and voted buf_prewrite() home.phk2004-10-264-5/+46
| | | | | | | | | | | | | | Give ffs it's own bufobj->bo_ops vector and create a private strategy routine, (currently misnamed for forwards compatibility), which is just a copy of the generic bufstrategy routine except we call softdep_disk_prewrite() directly instead of through the buf_prewrite() indirection. Teach UFS about the need for softdep_disk_prewrite() and call the function directly in FFS. Remove buf_prewrite() from the default bufstrategy() and from the global bio_ops method vector.
* Fix syntax errors introduced by last commit.phk2004-10-261-4/+3
| | | | Why isn't DIRECTIO in NOTES/LINT ?
* Put the I/O block size in bufobj->bo_bsize.phk2004-10-262-1/+2
| | | | | | | We keep si_bsize_phys around for now as that is the simplest way to pull the number out of disk device drivers in devfs_open(). The correct solution would be to do an ioctl(DIOCGSECTORSIZE), but the point is probably mooth when filesystems sit on GEOM, so don't bother for now.
* Degeneralize the per cdev copyonwrite callback. The only possible valuephk2004-10-263-9/+4
| | | | | | is ffs_copyonwrite() and the only place it can be called from is FFS which would never want to call another filesystems copyonwrite method, should one exist, so there is no reason why anything generic should know about this.
* Loose the v_dirty* and v_clean* alias macros.phk2004-10-255-30/+30
| | | | | Check the count field where we just want to know the full/empty state, rather than using TAILQ_EMPTY() or TAILQ_FIRST().
* Remove vnode->v_bsize. This was a dead-end.phk2004-10-251-1/+0
|
* Move the buffer method vector (buf->b_op) to the bufobj.phk2004-10-242-2/+2
| | | | | | | | | | | | | | | | | Extend it with a strategy method. Add bufstrategy() which do the usual VOP_SPECSTRATEGY/VOP_STRATEGY song and dance. Rename ibwrite to bufwrite(). Move the two NFS buf_ops to more sensible places, add bufstrategy to them. Add inlines for bwrite() and bstrategy() which calls through buf->b_bufobj->b_ops->b_{write,strategy}(). Replace almost all VOP_STRATEGY()/VOP_SPECSTRATEGY() calls with bstrategy().
* Add b_bufobj to struct buf which eventually will eliminate the need for b_vp.phk2004-10-222-2/+2
| | | | | | | | | | | | | | | | | | Initialize b_bufobj for all buffers. Make incore() and gbincore() take a bufobj instead of a vnode. Make inmem() local to vfs_bio.c Change a lot of VI_[UN]LOCK(bp->b_vp) to BO_[UN]LOCK(bp->b_bufobj) also VI_MTX() to BO_MTX(), Make buf_vlist_add() take a bufobj instead of a vnode. Eliminate other uses of bp->b_vp where bp->b_bufobj will do. Various minor polishing: remove "register", turn panic into KASSERT, use new function declarations, TAILQ_FOREACH_SAFE() etc.
* Move the VI_BWAIT flag into no bo_flag element of bufobj and call it BO_WWAITphk2004-10-213-18/+12
| | | | | | | | | | Add bufobj_wref(), bufobj_wdrop() and bufobj_wwait() to handle the write count on a bufobj. Bufobj_wdrop() replaces vwakeup(). Use these functions all relevant places except in ffs_softdep.c where the use if interlocked_sleep() makes this impossible. Rename b_vnbufs to b_bobufs now that we touch all the relevant files anyway.
* Explicitly break out NETA license from Berkeley license to clearlyrwatson2004-10-204-0/+84
| | | | | | | indicate license grant, as well as to indicate that NETA is asserting only two clauses, not four clauses. Requested by: imp
* Fix fsbtodb() for UFS1. This fixes an overflow for file sizes >1 TB,njl2004-10-091-1/+1
| | | | | | | allowing for sizes up to 4 TB. This doesn't affect UFS2 since b is already a 64 bit type, coincidental with daddr_t. Submitted by: bde
* Back out changes which were introduced to delay mounting root file system.pjd2004-10-051-1/+4
| | | | | Those changes were made on gmirror needs, but now gmirror handles this by itself.
* Remove support for accessing device nodes in UFS/FFS.phk2004-09-285-151/+7
| | | | Device nodes can still be created and exported with NFS.
* Give cluster_write() an explicit vnode argument.phk2004-09-271-1/+1
| | | | In the future a struct buf will not automatically point out a vnode for us.
* Introduce new /boot/loader.conf variable: root_mount_delay.pjd2004-09-231-4/+1
| | | | | | | | | | It can be used to delay mounting root partition to give a chance to GEOM providers to show up. Now, when there is no needed provider, vfs_rootmount() function will look for it every second and if it can't be find in defined time, it'll ask for root device name (before this change it was done immediately). This will allow to boot from gmirror device in degraded mode.
* The getpages VOP was a good stab at getting scatter/gather I/O withoutphk2004-09-191-112/+5
| | | | | | | | | | | | | | | too much kernel copying, but it is not the right way to do it, and it is in the way for straightening out the buffer cache. The right way is to pass the VM page array down through the struct bio to the disk device driver and DMA directly in to/out off the physical memory. Once the VM/buf thing is sorted out it is next on the list. Retire most of vnode method. ffs_getpages(). It is not clear if what is left shouldn't be in the default implementation which we now fall back to. Retire specfs_getpages() as well, as it has no users now.
* Do not traverse list of snapshots if there isn't one.phk2004-09-161-0/+4
| | | | Found by: scottl
* Missed a place where snapshots were allocated in my last commit tophk2004-09-161-11/+8
| | | | this file.
* Create struct snapdata which contains the snapshot fields from cdevphk2004-09-131-70/+88
| | | | | | | | | | | and the previously malloc'ed snapshot lock. Malloc struct snapdata instead of just the lock. Replace snapshot fields in cdev with pointer to snapdata (saves 16 bytes). While here, give the private readblock() function a vnode argument in preparation for moving UFS to access GEOM directly.
OpenPOWER on IntegriCloud