Commit Graph

2533 Commits

Author SHA1 Message Date
maya 8f063ba0d0 Rename i_flag to i_state.
The similarity to i_flags has previously caused errors.
2017-06-10 05:29:36 +00:00
chs ec5ea71a90 move some buffer cache internals declarations from buf.h to vfs_bio.c.
this is needed to avoid name conflicts with ZFS and also
makes it clearer that other code shouldn't be messing with these.
remove the LFS debug code that poked around in bufqueues and
remove the BQ_EMPTY bufqueue since nothing uses it anymore.
provide a function to let LFS and wapbl read the value of nbuf for now.
2017-06-08 01:23:01 +00:00
maya 01329061eb Add an XXX about the missing flags so it's not buried in a commit
message.

now the XXX count for LFS is 260
2017-06-05 07:47:32 +00:00
maya 3648207f6f Correct confusion between i_flag and i_flags
These will have to be renamed.

Spotted by Riastradh, thanks!
2017-06-05 01:29:21 +00:00
maya 5ad9db10cd Move definition of IN_ALLMOD near the flag it's a mask for.
Now we can see that it doesn't match all the flags, but changing that will
require more careful thought.
2017-06-05 01:01:42 +00:00
hannken 287643b0da Operations fstrans_start() and fstrans_start_nowait() now always
use FSTRANS_SHARED as lock type so remove the lock type argument.

File system state FSTRANS_SUSPENDING is now unused so remove it.

Regen vnode_if files.

Ride 8.99.1 less than a hour ago.
2017-06-04 08:05:41 +00:00
chs fd34ea77eb remove checks for failure after memory allocation calls that cannot fail:
kmem_alloc() with KM_SLEEP
  kmem_zalloc() with KM_SLEEP
  percpu_alloc()
  pserialize_create()
  psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.
2017-06-01 02:45:05 +00:00
hannken 56074bee21 Change ext2fs to use vcache_new like we did for ffs:
- Change ext2fs_valloc to return an inode number.
- Make ext2fs_makeinode private to ext2fs_vnops.c and
  pass vattr instead of mode.
2017-05-28 16:38:55 +00:00
hannken f8f707e163 No need to call vgone() on the just created in file system log vnode,
vput() is sufficient.
2017-05-28 16:37:55 +00:00
riastradh 93562e3f53 Eliminate crusty debugging sludge.
We have a mostly sane vnode lifecycle now.  If this needs debugging,
it should be done once at the call site of VOP_RECLAIM.
2017-05-26 14:34:19 +00:00
riastradh 7f7aad09bd Make VOP_RECLAIM do the last unlock of the vnode.
VOP_RECLAIM naturally has exclusive access to the vnode, so having it
locked on entry is not strictly necessary -- but it means if there
are any final operations that must be done on the vnode, such as
ffs_update, requiring exclusive access to it, we can now kassert that
the vnode is locked in those operations.

We can't just have the caller release the last lock because some file
systems don't use genfs_lock, and require the vnode to remain valid
for VOP_UNLOCK to work, notably unionfs.
2017-05-26 14:20:59 +00:00
riastradh 6fa7b15833 Change VOP_REMOVE and VOP_RMDIR to preserve lock/ref on dvp.
No change to vp -- the plan is to replace the node by the
componentname in the vop parameters, and let all directory vops do
lookups internally.

Proposed on tech-kern with no objections:
https://mail-index.netbsd.org/tech-kern/2017/04/17/msg021825.html
2017-04-26 03:02:47 +00:00
hannken 20bb034f5b Remove unused argument "nextp" from vfs_busy() and vfs_unbusy().
Remove argument "keepref" from vfs_unbusy() and add vfs_ref() where needed.
2017-04-17 08:32:00 +00:00
hannken ebb8f73b4b Add vfs_ref(mp) and vfs_rele(mp) to add or remove a reference to
struct mount.  Rename vfs_destroy(mp) to vfs_rele(mp) and replace
incrementing mp->mnt_refcnt with vfs_ref(mp).
2017-04-17 08:31:01 +00:00
hannken 4f91c8bb19 Switch lfs_flush() and lfs_writerd() to mountlist iterator. 2017-04-13 09:57:28 +00:00
riastradh 87fb32292e Make VOP_INACTIVE preserve vnode lock on return.
Discussed on tech-kern:
https://mail-index.netbsd.org/tech-kern/2017/04/01/msg021751.html

Ride 7.99.68, a bumpy bus of incremental vfs improvements!
2017-04-11 14:24:59 +00:00
riastradh 666f39d910 Fix non-DIAGNOSTIC build by using vp outside KASSERT too. 2017-04-11 06:01:03 +00:00
riastradh aba083eab6 Sprinkle lock ownership assertions. 2017-04-11 05:48:04 +00:00
maya 35cd97ea2e don't guard lfs_sbactive or lfs_log with splbio, lfs_lock is plenty. 2017-04-06 03:21:01 +00:00
maya f1b01545d2 remove deprecated comment (and move it below assert)
there's no spl dance for I/O here.
2017-04-06 03:15:03 +00:00
maya b9333d2338 don't guard lfs_reshash with splbio, lfs_lock is plenty 2017-04-06 03:12:48 +00:00
maya b030a154a8 if DEBUG panic => KDASSERT. reduces ifdefs. NFC 2017-04-06 02:55:22 +00:00
maya 4408dea477 Provide a LFS_ENTER_LOG (__nothing) in the !DEBUG case.
so I can drop lots of #ifdef DEBUG around this macro. NFCI
2017-04-06 02:38:08 +00:00
maya 92e2fd3e96 Drop single use macro LFS_BCLEAN_LOG with an inlined implementation.
LFS_ENTER_LOG currently macro grabs lfs_lock, so I'd like to have just one
name for it.
2017-04-06 01:54:23 +00:00
riastradh 30509f8074 KASSERT(mutex_owned(vp->v_interlock)) in vnode iterator selector. 2017-04-01 19:35:56 +00:00
maya 63e604ef39 Switch lfs_writer_daemon to use condvar instead of mtsleep.
track thread existence with struct lwp instead of pid + lid,
it's more useful from ddb.
2017-04-01 17:34:21 +00:00
maya 7171c6cd38 Keep on holding lfs_lock when calling cv_broadcast
pointed out by skrll, thanks.
2017-04-01 14:53:48 +00:00
maya 9f6a52ecd2 switch lfs_dirops to condvar (from mtsleep) 2017-04-01 14:43:00 +00:00
maya 9d86a9c369 switch lfs_sleepers to condvar (from mtsleep) 2017-04-01 01:50:02 +00:00
maya 41b7cd45f6 Simplify locking 2017-04-01 00:40:42 +00:00
maya ef8d65be9d stopgap fix- move lfs_lock to include calls to lfs_dino_{set,get}block
blocks new users that need seglock (need to take lfs_lock) that
setblock before the assert (truncate to 0 but 31 blks/31 effblks)

not proper, but lets me run firefox on lfs
2017-03-31 23:00:21 +00:00
hannken 96f2116337 Remove now redundant calls to fstrans_start()/fstrans_done(). 2017-03-30 09:10:46 +00:00
hannken 63ce83dc30 Remove now redundant calls to fstrans_start()/fstrans_done().
Add fstrans_start()/fstrans_done() to lfs_putpages().
2017-03-30 09:10:08 +00:00
jdolecek 69a701dc2c move the ffs_sync() after wapbl_log_position() call, since that can still
create delayed writes with MNT_ASYNC when log is created
2017-03-22 21:30:59 +00:00
maya ea9463715e Update mtime even if oip->i_size == length
PR kern/51762, LFS version.
2017-03-21 09:53:00 +00:00
riastradh 4c213dd2b6 Fix inadvertently reversed sense of comparisons. 2017-03-19 22:48:00 +00:00
riastradh 5d735856a4 #if DIAGNOSTIC panic ---> KASSERT 2017-03-18 05:43:16 +00:00
riastradh 58bda3f99b #if DIAGNOSTIC panic ---> KASSERT 2017-03-18 05:33:06 +00:00
riastradh 1644321e4e #if DIAGNOSTIC panic ---> KASSERT 2017-03-18 05:20:04 +00:00
jdolecek 59e3b3b831 need to turn off async during ffs_sync(), otherwise its bwrite() calls are
themselves turned to bdwrite(), creating dirty delayed writes

fixes panic for 'mount -o log,async ...' reported by Masanobu SAITOH
on current-users; fix help by hannken@, thank you
2017-03-16 22:09:19 +00:00
maya 9cac905a42 actually cast to unsigned long long and use %llu. certainly not use hex (oops)
suggested by dh
2017-03-16 01:09:24 +00:00
maya 9365aa4083 print inode number in an assert I keep hitting and the adjacent one.
use PRIx64 for printing inode number elsewhere.
2017-03-15 21:28:41 +00:00
maya b3a28a4c38 Fill in some XXXs with the exact action described in them. match
lfs_valloc behaviour.
2017-03-13 20:15:50 +00:00
riastradh 3a7fbf40a4 #if DIAGNOSTIC panic ---> KASSERT
Replace some #if DEBUG by this too.  DEBUG is only for expensive
assertions; these are not.
2017-03-13 14:24:20 +00:00
riastradh a82e1fa815 #if DIAGNOSTIC panic ---> KASSERTMSG 2017-03-13 13:45:53 +00:00
jdolecek 61d1aa6aec sync any delayed writes when updating filesystem to log
Adresses PR kern/52056 by Martin Husemann, fix helped by Juergen Hannken, thanks
2017-03-10 22:43:03 +00:00
jdolecek 03b219b5e7 slightly rearrange the code for IMNT_WANTRDONLY + MNT_UPDATE case for
better readability, no functional change
2017-03-10 20:38:28 +00:00
hannken 95446f2e4a Adapt the test "enable WAPBL on rw mounts only" to the recent change of
the protocol to update a mounted file.

Should fix PR kern/52031 (FFS mount update doesn't play nice with WAPBL)
2017-03-06 10:12:00 +00:00
christos e6016d46a9 ifdef reduction 2017-03-02 00:43:40 +00:00
hannken 08fe30ea3a Make compile again without "options WAPBL".
From John D. Baker via current-users@, slightly modified by me.
2017-03-01 21:55:07 +00:00