Commit Graph

413 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
christos 0b0eb1328b Don't overload MAXNAMLEN, use a separate constant for each filesystem type. 2005-08-23 08:05:13 +00:00
christos 50f8955b6e 64 bit inode changes. 2005-08-19 02:04:03 +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
thorpej 29af9583d2 Use ANSI function decls. 2005-07-15 05:01:16 +00:00
yamt 44d128fa8e - constify genfs_ops.
- use member designators.
2005-06-28 09:30:37 +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 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
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
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
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
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
yamt 5241cb4bbc don't assign to non-lvalue. found by gcc4. 2005-04-21 14:02:02 +00:00
thorpej e633e8b61b - Define a VFS_ATTACH() macro that places a reference to a vfsops structure
into the "vfsops" link set.
- Use VFS_ATTACH() where vfsops are declared for individual file systems.
- In vfsinit(), traverse the "vfsops" link set, rather than vfs_list_initial[].
2005-03-29 02:41:05 +00:00
christos cac7cf0758 PR/26823: Michael L. Hitch: Endianness flag were not preserved in the compat
superblock read routine.
2005-03-04 21:45:29 +00:00
perry bcfcddbac1 nuke trailing whitespace 2005-02-26 22:31:44 +00:00
hannken 1d85e05ec4 Make `options FFS_NO_SNAPSHOT' only disable snapshot creation
while not trashing existing snapshots.

Approved by: core@
2005-02-21 17:52:11 +00:00
dsl 2f6f4269bd Add a stub file so that snapshot support can be compiled out.
Will allow INSTALL_TINY to fit back in its designated space.
Since the calling code doesn't allow a snapshot mount to fail, this code
will output a warning and delete any snapshots it finds.
This only happend on rw mounts - snapshots don't seem to be created
when mounting ro.
The whole way the snapshots gets mounted is a PITA anyway, the superblock
'last mounted' time should be used to validate that the fs hasn't been
mounted elsewhere.
2005-02-10 22:22:32 +00:00
hannken 8bb5af4d2e Fss device only checks read access to snapshot vode. On snapshot creation
check we are either super-user or owner of the snapshot vnode.
2005-02-09 16:05:29 +00:00
hannken c13136f43f No longer needed. Ffs snapshots are enabled by default. 2005-01-31 22:21:17 +00:00
wrstuden 442d792d00 Fix pasto in previous. We only perform the DIOCCACHESYNC call if
FSYNC_CACHE is set, not if FSYNC_WAIT is set.
2005-01-27 02:16:42 +00:00
wrstuden e384a44e9d Extend fsync_range(2) to support the FDISKSYNC flag, which requests
that the sync be propogated out through the disk drive caches.
2005-01-25 23:55:20 +00:00
hannken 5b0fdd5c72 Protect calls to `ffs_*_swap' with `#ifdef FFS_EI'. 2005-01-18 10:40:21 +00:00
mycroft 7f1fe4e81f Rearrange some code slightly to avoid uninitialized variable warnings. 2005-01-11 00:19:36 +00:00
mycroft 0461b30ac3 Rework the mountroot interface so that vfs_mountroot() opens the root device
and just passes it on to the file system functions.  This avoids opening and
closing the device several times.

Mentioned on tech-kern some time ago, IIRC.  I've been running this for a
long time.
2005-01-09 03:11:48 +00:00
thorpej 1c95472d01 Add the system call and VFS infrastructure for file system extended
attributes.

From FreeBSD.
2005-01-02 16:08:28 +00:00
dbj 0c5a27af69 remove opt_compat_netbsd.h, afaict it is no longer needed.
i think it was previously used to pull in COMPAT_09 for ffs_statfs
2004-12-26 17:34:39 +00:00
mycroft 5ac91d4849 Remove some unnecessary (int32_t) casts that would cause us to screw up the
top bit in block addresses.

Also, change some daddr_t->int32_t casts (mostly as arguments to ufs_rw32(),
where they would get promoted anyway) to u_int32_t.
2004-12-15 07:11:51 +00:00
jdolecek 3524fe97e8 allow changes of the sysctl values 2004-11-21 19:21:51 +00:00
dbj 2bd0f63fd0 print absolute inode number in debug output when freeing free inode occurs.
previously, the number was relative to the cylinder group, which was confusing.
prefix debug message with "ifree:" so this can be differentiated in bug reports.
2004-10-11 17:15:36 +00:00
thorpej 11afd11faa Add a new VNODE_LOCKDEBUG option, which enables checks in the VOP_*()
calls to ensure that the vnode lock state is as expected when the VOP
call is made.  Modify vnode_if.src to set the expected state according
to the documenting lock table for each VOP.  Modify vnode_if.sh to emit
the checks.

Notes:
- The checks are only performed if the vnode has the VLOCKSWORK bit
  set.  Some file systems (e.g. specfs) don't even bother with vnode
  locks, so of course the checks will fail.
- We can't actually run with VNODE_LOCKDEBUG because there are so many
  vnode locking problems, not the least of which is the "use SHARED for
  VOP_READ()" issue, which screws things up for the entire call chain.

Inspired by similar changes in OpenBSD, but implemented differently.
2004-09-21 03:10:35 +00:00
yamt cc047d3821 um_maxfilesize should be set after
ffs_oldfscompat_read adjusted fs_maxfilesize.
2004-09-19 11:58:29 +00:00
skrll f7155e40f6 There's no need to pass a proc value when using UIO_SYSSPACE with
vn_rdwr(9) and uiomove(9).

OK'd by Jason Thorpe
2004-09-17 14:11:20 +00:00
hannken 5816dad45e While creating a snapshot inodes must be freed from the
snapshot, not from the file system.
ffs_freefile() needs explicit "fs" and "devvp" arguments.
2004-08-29 10:13:48 +00:00
mycroft bb17450999 Don't write out the extra zero pages with PGO_SYNCIO. We start an asynchronous
write anyway, and they will not be freed until that write is finished.
2004-08-15 19:01:16 +00:00
mycroft a97f7bfcbd Correct the fix for the partial-truncate inefficiency. We still need to zero,
but we only need to sync those pages that are being lopped off, if any.
2004-08-15 17:36:00 +00:00
mycroft f3fbefe76a Minor simplification to some arithmetic. 2004-08-15 16:17:37 +00:00
mycroft 45a21b76f0 Fixing age old cruft:
* Rather than using mnt_maxsymlinklen to indicate that a file systems returns
  d_type fields(!), add a new internal flag, IMNT_DTYPE.

Add 3 new elements to ufsmount:
* um_maxsymlinklen, replaces mnt_maxsymlinklen (which never should have existed
  in the first place).
* um_dirblksiz, which tracks the current directory block size, eliminating the
  FS-specific checks littered throughout the code.  This may be used later to
  make the block size variable.
* um_maxfilesize, which is the maximum file size, possibly adjusted lower due
  to implementation issues.

Sync some bug fixes from FFS into ext2fs, particularly:
* ffs_lookup.c 1.21, 1.28, 1.33, 1.48
* ffs_inode.c 1.43, 1.44, 1.45, 1.66, 1.67
* ffs_vnops.c 1.84, 1.85, 1.86

Clean up some crappy pointer frobnication.
2004-08-15 07:19:54 +00:00
mycroft 5d31d187f3 Partially fix a performance problem in the partial-truncate case. We were
doing synchronous writes unnecessarily in a couple of places.  Now it's 1
write per truncate in my test case rather than 3.  :-P
2004-08-14 02:26:57 +00:00
mycroft 14ae52970e There is no need to do a synchronous write when truncating a short symlink. 2004-08-14 01:32:02 +00:00
mycroft 9f8efecd46 In the indirect block unwind case, we only need to do the synchronous writes
of the inode in the softdep case.  XXX This is really a deficiency in softdep.
2004-08-14 01:30:56 +00:00
mycroft bc25b30608 Add a new flag, IN_MODIFY. This is like IN_UPDATE|IN_CHANGE, but unlike
setting those flags, it does not cause the inode to be written in the periodic
sync.  This is used for writes to special files (devices and named pipes) and
FIFOs.

Do not preemptively sync updates to access times and modification times.  They
are now updated in the inode only opportunistically, or when the file or device
is closed.  (Really, it should be delayed beyond close, but this is enough to
help substantially with device nodes.)

And the most amusing part:
Trickle sync was broken on both FFS and ext2fs, in different ways.  In FFS, the
periodic call to VFS_SYNC(MNT_LAZY) was still causing all file data to be
synced.  In ext2fs, it was causing the metadata to *not* be synced.  We now
only call VOP_UPDATE() on the node if we're doing MNT_LAZY.  I've confirmed
that we do in fact trickle correctly now.
2004-08-14 01:08:02 +00:00