Commit Graph

1161 Commits

Author SHA1 Message Date
thorpej e1afed9c2d Experimental support for extended attributes on UFS1 file systems, using a
backing file per attribute type indexed by inode number to hold the extended
attributes.

This is working pretty well on my test systems, except for the "autostart"
feature.  I need someone with a better handle on the VFS locking protocol
to go over that.

This is a work-in-progress.  There are parts of this that could be re-factored
allowing this approach to be used on other types of file systems.

Adapted from FreeBSD.
2005-08-28 19:37:58 +00:00
yamt 4c32aa5945 PRId64 -> ld in UVMHIST_LOG format strings. 2005-08-24 10:19:43 +00:00
yamt d5c3f1e190 ufs_readdir: don't leak kernel garbage to userland. 2005-08-23 12:27:47 +00:00
yamt 3f2c6f0661 ufs_readdir: when computing the maximum number of entries,
use _DIRENT_RECLEN(cdp, 1) instead of "4".
2005-08-23 12:27:16 +00:00
christos 0b0eb1328b Don't overload MAXNAMLEN, use a separate constant for each filesystem type. 2005-08-23 08:05:13 +00:00
yamt 84c9e5bbc1 whitespace. 2005-08-22 09:08:17 +00:00
christos b0e192f2b6 change ino_t to u_int32_t for syscall compatibility. 2005-08-22 08:53:03 +00:00
christos 23e602002f now that we've changed the _DIRENT_ALIGN macro, provide a d_fileno for struct
direct
2005-08-19 05:28:48 +00:00
christos 50f8955b6e 64 bit inode changes. 2005-08-19 02:04:03 +00:00
jmmv 38501db2ff Drop extra word from comment. 2005-08-12 22:31:51 +00:00
christos bce5269120 Move extern kernel variable declarations, into a _KERNEL protected session
so that the don't pollute userland's namespace.
2005-07-31 20:18:32 +00:00
yamt 946832fd33 revert VCHR part of ffs_vnops.c 1.71.
as VCHR uses the device pager, no point to call VOP_PUTPAGES here.
pointed by Chuck Silvers.
2005-07-26 12:14:46 +00:00
drochner e32ba1775e fix crash in mount error handling: don't free storage which was not
malloc'd
2005-07-25 11:42:38 +00:00
yamt b7bfe82866 update file timestamps for nfsd loaned-read and mmap.
PR/25279.  discussed on tech-kern@.
2005-07-23 12:18:41 +00:00
yamt 6afb995fea ffs_full_fsync: because VBLK/VCHR can be mmap'ed,
do VOP_PUTPAGES for them as well.
2005-07-21 22:00:08 +00:00
yamt 2a6dc9d02d - introduce PGO_NOBLOCKALLOC and use it for ubc mapping
to prevent unnecessary block allocations in the case that
  page size > block size.

- ufs_balloc_range: use VM_PROT_WRITE+PGO_NOBLOCKALLOC rather than
  VM_PROT_READ.
2005-07-17 09:13:35 +00:00
thorpej 29af9583d2 Use ANSI function decls. 2005-07-15 05:01:16 +00:00
thorpej 4457fd076f Defflag UFS_DIRHASH. 2005-07-10 01:08:52 +00:00
thorpej 175c3312a8 - Use ANSI function decls.
- Sprinkle some static.
2005-07-10 00:18:52 +00:00
kml dab4c6d721 Ensure that we change the size of the vnode at the same time as
we change the size of the inode, and use ext2fs_size uniformly.
This fixes a crash that occurs when I create a directory, then
move it, all on an ext2 filesystem.
2005-06-28 16:53:14 +00:00
yamt 44d128fa8e - constify genfs_ops.
- use member designators.
2005-06-28 09:30:37 +00:00
atatat df13e3579e Change the rest of the sysctl subsystem to use const consistently.
The __UNCONST macro is now used only where necessary and the RW macros
are gone.  Most of the changes here are consumers of the
sysctl_createv(9) interface that now takes a pair of const pointers
which used not to be.
2005-06-20 02:49:18 +00:00
atatat 420d91208b Properly fix the constipated lossage wrt -Wcast-qual and the sysctl
code.  I know it's not the prettiest code, but it seems to work rather
well in spite of itself.
2005-06-09 02:19:59 +00:00
dbj 7753d41b8e remove (long) cast on bpref, which is daddr_t 2005-06-06 17:10:25 +00:00
dbj 331e001f0c the cluster summary must be swapped even for ufs2 2005-06-03 01:14:07 +00:00
is 4daeda666d fix copy/paste/don'tupdate bug (fix from PR 22232 by Robert Elz). 2005-06-02 10:08:36 +00:00
christos c76e17575e s/buf/sbuf. 2005-05-31 02:37:50 +00:00
christos 07d1f24ff5 rename delay because it is a function on sparc. 2005-05-30 22:13:22 +00:00
christos 273df63602 - sprinkle const
- avoid shadow variables.
2005-05-29 21:25:24 +00:00
hannken a69fbd6a18 - Use an empty snap block list to set the initial file size. Snapshot is
now valid from the beginning.  No need to copy the last fs block two times.
- No need to allocate the cylinder group blocks twice.
- cgbuf -> sbbuf
2005-05-25 11:07:13 +00:00
perseant 96f8f74d91 Don't update lfs_stats.segs_reclaimed if we're not keeping statistics.
Patch from Juan RP.
2005-05-25 01:50:01 +00:00
hannken ffa83f8f0d ffs/ffs_alloc.c:
- Add a missing ACTIVECG_CLR().

ffs/ffs_snapshot.c:
- Use async/delayed writes for snapshot creation and sync/uncache these buffers
  on end. Reduces the time the file system must be suspended.
- Remove um_snaplistsize. Was a duplicate of um_snapblklist[0].
- Byte swap the list of preallocated blocks on read/write instead of access.
- Always keep this list on ip->i_snapblklist so it may be rolled back when the
  newest snapshot gets removed. Fixes a rare snapshot corruption when using
  more than one snapshot on a file system.

ufs/ufsmount.h:
  - Make TAILQ_LAST() possible on member um_snapshots.
  - Remove um_snaplistsize. Was a duplicate of um_snapblklist[0].
2005-05-22 08:35:28 +00:00
perseant 2ecd1730c0 Keep track of the number of segments reclaimed, since the cleaner doesn't
do this anymore (it hasn't for quite some time).  Add a couple of conditional
debugging messages to indicate why segments are not cleaned, in the event
that lfs_segclean is used.

Make the LFCNSEGWAITALL fcntl work again.
2005-05-20 19:48:25 +00:00
perseant f8677583c3 VOP_LOCK drops the interlock; pick it up again to avoid an "already unlocked"
panic in lfs_putpages.
2005-05-20 19:09:25 +00:00
perseant 5760c21b8b Fill in the lfs_fsmnt field in the superblock when we mount the filesystem,
so fsck(8) can tell where it was last mounted.
2005-05-20 19:03:11 +00:00
hannken a71c653aca flush_inodedep_deps(): If softdep_lookupvp() returns NULL it means the
inode has been reclaimed.  Skip the VOP_PUTPAGES() in this case.

Reviewed by: Chuck Silvers <chs@netbsd.org>
2005-05-07 14:24:14 +00:00
perseant 0d41dd0d46 Don't let the pager_map deadlock avoidance code in lfs_putpages() write
segments containing zero-block FINFO records.  These records cause segments
to become uncleanable, which would eventually result in a "no clean segments"
panic.
2005-05-04 04:58:22 +00:00
hannken cad9d39281 Fix last commit. The last block of the file system may have changed
even if the last cylinder group is not modified.
2005-05-03 09:43:23 +00:00
perseant 5ed293c5d5 Recognize that we hold the v_interlock when relocking after a flush in
lfs_putpages.
2005-04-27 20:35:10 +00:00
skrll d1c90589d8 Use the right arg structure for lfs_setattr, i.e. s/getattr/setattr/. 2005-04-25 06:28:51 +00:00
hannken dc13562a0c Fix an inconsistency where the last block of the snapshot contains old data.
The last block of the file system is written to the snapshot before the
file system is suspended.  If the last cylinder group is modified after
the file system is suspended the last block of the snapshot may contain
old data.  So update this block again.
2005-04-24 15:49:37 +00:00
perseant 2f695b5476 Provide a resize_lfs(8), including kernel and cleaner support. The current
implementation requires the fs to be mounted while resizing.  Tested in both
directions, and everything appears to work happily, but ymmv.
2005-04-23 19:47:51 +00:00
yamt 5241cb4bbc don't assign to non-lvalue. found by gcc4. 2005-04-21 14:02:02 +00:00
perseant f4a7694fc9 Keep per-inode, per-fs, and subsystem-wide counts of blocks allocated through
lfs_balloc(), and use that to estimate the number of dirty pages belonging
to LFS (subsystem or filesystem).  This is almost certainly wrong for
the case of a large mmap()ed region, but the accounting is tighter than
what we had before, and performs much better in the typical case of pages
dirtied through write().
2005-04-19 20:59:05 +00:00
perseant f63fa194c2 Check the to-be-on-disk consistency of directories as well (correct a typo
in an earlier commit).
2005-04-18 23:03:08 +00:00
perseant b2d19f57a3 Check for the inode having been previously freed, in UNMARK_VNODE().
Avoids a panic when calling mkdir() on a full filesystem.
2005-04-18 17:36:46 +00:00
perseant 5923fa20f1 Make userland compile again. 2005-04-16 19:52:09 +00:00
perseant ad0169af41 Remove left-over reference to "lfs_blist", for _LKM case. 2005-04-16 18:10:12 +00:00
perseant 5ed792ecb0 Use splay trees, rather than a hash table, to manage the accounting of
blocks allocated through VOP_BALLOC() for pages to be written to disk.
This accounting no longer takes a noticeable fraction of the system CPU.
2005-04-16 17:35:58 +00:00
perseant 94decdd25d Use lfs_malloc() to manage the blkiov arrays that the cleaner functions use,
since the cleaner is likely to operate in a low-memory condition.
2005-04-16 17:28:37 +00:00