Commit Graph

867 Commits

Author SHA1 Message Date
fvdl 67c9fa950a OS X still seems to use the old nrpos field in the superblock, and gets
unhappy after NetBSD wrote an Apple UFS filesystem. Just set it to 0
in this case.
2003-06-12 18:50:43 +00:00
fvdl d9f47e809c free the ext2fs dinode struct in ext2fs_reclaim. From Ted Unangst. 2003-05-26 21:22:19 +00:00
yamt ab2238cfad make is_sequential a callback in order to achieve better lfs write clustering.
since lfs always rewrite blocks into the new segment,
current on-disk place of the block doesn't affect to write clustering.

ok'ed by Konrad Schroder.
2003-05-18 12:59:05 +00:00
nakayama a6d8c9185d Avoid comparison is always false warning in gcc 3.3 w/ 64-bit size_t. 2003-05-17 01:44:39 +00:00
kristerw 07936511f0 The C language does not permit statements of the form
(X ? Y : Z) = 0;
even though gcc handles this by a stupid extension.

Transform these to correct C.

Approved by fvdl.
2003-05-15 20:25:31 +00:00
ragge 97fa6ef77b Add a missing ifdef DDB. 2003-05-07 18:49:29 +00:00
gmcgarry 835240b191 Print pid on error. From Greg A. Woods in PR#17393. 2003-05-04 01:52:18 +00:00
christos 7a96f65456 make sure we update fs_fsmnt. 2003-05-03 16:24:35 +00:00
perseant e18585deb2 Correct arguments to check_dirty, ensuring that all pages in a block are
written if any of them are dirty.  Pointed out by yamt.
2003-05-02 01:47:39 +00:00
perseant 100c8f971f Restrict the run of cluster blocks to on-disk contiguous blocks (back out
part of rev 1.115), to avoid writing over holes.  This is the lesser of two
evils, to be replaced soon.
2003-04-29 17:45:11 +00:00
yamt 3f3b3242de constify 'mastertemplate'. 2003-04-29 07:45:23 +00:00
yamt 982fbc7db4 add an assertion. 2003-04-29 07:44:04 +00:00
yamt b4d5e11ffe fix a comment. 2003-04-27 06:47:45 +00:00
yamt c2b802ff24 fix b_interlock lock/unlock mismatches. 2003-04-27 06:46:38 +00:00
perseant b691ba8a71 Don't change update time on block write; lets e.g. "tar xp" work properly. 2003-04-27 04:18:29 +00:00
fvdl 94e92b1bb3 Assign the right linkcount when renaming a directory. 2003-04-25 23:12:33 +00:00
gmcgarry 0645f99b01 More ufs2 merge fall-out. Pass the correct pointer to the dinode
for clearing.  Fixes PR#21241.
2003-04-24 08:05:35 +00:00
perseant ef3c60764c Make LFS work better (though still not "well") as an NFS-exported
filesystem (and other things that needed to be fixed before the tests
would complete), to wit:

* Include the fs ident in the filehandle; improve stale filehandle checks.

* Change definition of blksize() to use the on-dinode size instead of
  the inode's i_size, so that fsck_lfs will work properly again.

* Use b_interlock in lfs_vtruncbuf.

* Postpone dirop reclamation until after the seglock has been released,
  so that lfs_truncate is not called with the segment lock held.

* Don't loop in lfs_fsync(), just write everything and wait.

* Be more careful about the interlock/uobjlock in lfs_putpages: when we
  lose this lock, we have to resynchronize dirtiness of pages in each
  block.

* Be sure to always write indirect blocks and update metadata in
  lfs_putpages; fixes a bug that caused blocks to be accounted to the
  wrong segment.
2003-04-23 07:20:37 +00:00
tls 85c8cfb533 Correct use of MAXBSIZE where MAXPHYS was intended. This is a necessary
first step towards per-device MAXPHYS, and has the beneficial side effect
of allowing clustering to MAXPHYS even on systems that need to run with
a reduced MAXBSIZE to get more metadata buffers.
2003-04-23 00:55:17 +00:00
christos d864ba0136 fix lkm malloc lossage. 2003-04-22 17:14:12 +00:00
christos db7b52084a choose the smaller size of the two strings when memcpy'ing them. A better
fix would be to strncpy and null terminate? From enami.
2003-04-22 13:18:52 +00:00
christos a94b10edf1 PR/2996: Greg Oster: Fix comment to match reality. Names are padded to
four bytes, but the bytes are not null.
2003-04-19 22:02:39 +00:00
fvdl 0545901d27 configdirs was changed to an array of u_int8_t, so don't compare values
to 65535.
2003-04-17 09:32:43 +00:00
christos 80ecd573c0 PR/1796: John Kohl: statfs misbehaves under chrooted environments.
- Under chroot it displays only the visible filesystems with appropriate paths.
- The statfs f_mntonname gets adjusted to contain the real path from root.
- While was there, fixed a bug in ext2fs, locking problems with vfs_getfsstat(),
  and factored out some of the vfsop statfs() code to copy_statfs_info(). This
  fixes the problem where some filesystems forgot to set fsid.
- Made coda look more like a normal fs.
2003-04-16 21:44:18 +00:00
yamt aa51f25824 ufs_rwXX: cast to unsigned even without FFS_EI to avoid
possible nasty signed vs unsigned problems.
2003-04-16 14:27:03 +00:00
yamt 1963d34b78 use bswap32 and bswap64 correctly.
(fs_pendingblocks and fs_pendinginodes)
2003-04-16 14:20:25 +00:00
fvdl d0152b0231 ffs_reclaim may be called while the dinode pointer in the inode structure
is still NULL (in the case of an error in ffs_vget). Check for this
condition before doing a pool_put.
2003-04-16 07:38:25 +00:00
fvdl ba400f9233 Don't cache buffers used when finding the superblock, it can lead to
seeing bogus data for the first cg with certain block/frag sizes.
From enami tsugutomo.
2003-04-12 10:35:58 +00:00
fvdl 9e0b0abaa7 Use variables for some cg accesses; makes things more readable and more
similar to FreeBSD. No functional change.
2003-04-12 10:33:17 +00:00
fvdl 4cdcaab92d Remove diagnostic ufs_vinit check, this isn't quite the right place for it;
it'll be reinstated elsewhere.
2003-04-11 14:13:28 +00:00
fvdl 64f0bf8882 Adjust diagnostic check for bad mode field; only the VNON case should
matter. From Enami.
2003-04-11 10:36:33 +00:00
enami b0715b0b82 Make ffs_cg_swap() works even if same chunk is passed as new and old cg.
This is necessary to prevent newfs from dumping core when it is asked to
create a UFS1 file system of non-native endian.
2003-04-11 10:20:35 +00:00
fvdl bf82cd91c6 Add diagnostic check to ufs_vinit in order to catch bad mode fields in
inodes early.
2003-04-10 20:22:04 +00:00
fvdl 63ab1add00 Initialize the 'mirror' i_flags fiels in struct inode to 0. 2003-04-10 20:03:40 +00:00
fvdl 2758e6ad60 Remove some leftover diagnostic checks. 2003-04-10 20:02:36 +00:00
simonb 761de7345c '#if 0' out a variable that is currently only used in other '#if 0'd out
code.
2003-04-10 04:15:38 +00:00
thorpej 24a4b8faa6 Use PAGE_SIZE rather than NBPG. 2003-04-09 00:28:28 +00:00
fvdl 85d5aca005 Actually get an ext2fs_dinode structure from the pool before using it. 2003-04-05 14:01:56 +00:00
fvdl 4f33a6f2e1 * Use the old and new time fields in the superblock as well as a few others
to determine if this filesystem was mounted by an older kernel after
  having been mounted by a newer one, to avoid some summary mismatches.
* Reinstate support for 4.2 cylinder groups (read-only, as it was before).
2003-04-05 13:37:36 +00:00
he f8cf57f9b0 Remember to prefix the manually-swapped FS magic numbers with 0x. 2003-04-05 11:12:42 +00:00
drochner 42b749318f adapt to struct inode change (in UVMHIST code) 2003-04-04 13:39:58 +00:00
fvdl 7847218fc1 FreeBSD revision 1.135:
When removing the last item from a non-empty worklist, the worklist
tail pointer must be updated.
2003-04-03 19:28:07 +00:00
fvdl 7d31e8f0d9 Avoid truncation of values in some macros that shift 64 bit values.
From FreeBSD.
2003-04-03 16:07:09 +00:00
he a1cf02e789 In the inode, i_din.e2fs_din is now a pointer, so there is no longer
a need to take the address here.
2003-04-02 22:38:22 +00:00
fvdl 42614ed3f3 Add support for UFS2. UFS2 is an enhanced FFS, adding support for
64 bit block pointers, extended attribute storage, and a few
other things.

This commit does not yet include the code to manipulate the extended
storage (for e.g. ACLs), this will be done later.

Originally written by Kirk McKusick and Network Associates Laboratories for
FreeBSD.
2003-04-02 10:39:19 +00:00
yamt 0296b9ddb2 add assertions and a debug check. 2003-04-01 14:58:43 +00:00
yamt 418bd96252 lfs_strategy is used only for read. 2003-04-01 14:31:50 +00:00
fvdl e80c0648b1 The modified flag must be cleared before the last sbupdate call in
unmount, because ffs_flushfiles or softdep_flushfiles may have
modified the filesystem (despite VFS_SYNC having been called first).
2003-03-31 21:02:12 +00:00
fvdl 691b2fa7db The checkpoint loop always used (multiples of) lfs_sepb as the number
of segments to mark. However, this may be much more than lfs_nseg.

Originally this wasn't a big problem, since only the structures in the
diskblock were changed, but nowadays there's a mirror of the segflags
in the in-core superblock. This problem caused the code to walk
way past the end of that allocated area, causing memory corruption
in other kernel structures. So, use lfs_nseg as the maximum, as it should be.

While here, simplify the loop; it had become an obfuscated piece of
code overtime.
2003-03-28 22:39:42 +00:00
perseant 3f7016035a Add a sleeper count, to prevent the cleaner from panicing the kernel
when the filesystem is unmounted, relocking the Ifile when its lock is
draining.  (We can't use vfs_busy() since the process is sleeping for a
good long time.)  Clean up / organize lfs.h, while I'm here.

In lfs_update_single, assert that disk addresses are either negative, or
are still positive when converted to int32_t, to prevent recurrence of a
negative/positive block problem.
2003-03-28 08:03:38 +00:00