Commit Graph

102 Commits

Author SHA1 Message Date
christos 3e4993b396 fix unused variable warnings. 2013-10-19 01:09:58 +00:00
christos 855bb66ef7 Prefix most of the cpp macros with lfs_ and LFS_ to avoid conflicts with ffs.
This was done so that boot blocks that want to compile both FFS and LFS in
the same file work.
2013-06-18 18:18:57 +00:00
dholland a65dc3fc86 Redo these changes properly:
-r1.12 libexec/lfs_cleanerd/Makefile
 -r1.15 sbin/fsck_lfs/Makefile
 -r1.6 sbin/newfs_lfs/Makefile

hi ad@
2013-06-08 21:13:19 +00:00
dholland c13a12500a Tidy up the LFS userland build hacks.
Don't use -I${NETBSDSRCDIR}/sys; don't include files other than the
exported LFS headers, which are lfs.h, lfs_inode.h, and (for now)
lfs_extern.h.
2013-06-08 02:16:03 +00:00
dholland 25bc01ad43 DIRBLKSIZ -> LFS_DIRBLKSIZ
DIRECTSIZ -> LFS_DIRECTSIZ
DIRSIZ -> LFS_DIRSIZ
OLDDIRFMT -> LFS_OLDDIRFMT
NEWDIRFMT -> LFS_NEWDIRFMT
IFTODT -> LFS_IFTODT
DTTOIF -> LFS_DTTOIF
2013-06-08 02:14:46 +00:00
dholland 4b157546cf struct direct -> struct lfs_direct
struct dirtemplate -> struct lfs_dirtemplate
struct odirtemplate -> struct lfs_odirtemplate
DT_* -> LFS_DT_*
2013-06-08 02:12:56 +00:00
dholland b6eb36b1f1 Stick LFS_ in front of IFMT, IFIFO, IFREG, etc. so as not to conflict
with the UFS copies of these symbols. (Which themselves ought to have
UFS_ stuck on.)
2013-06-08 02:11:11 +00:00
dholland 5fce92dbf7 Move the dinode (on-disk inode) structures to lfs.h, since they are
and will be obviously required by userland tools that need to read
the on-disk structures.

Also, DINODE{1,2}_SIZE -> LFS_DINODE{1,2}_SIZE.
2013-06-08 02:09:35 +00:00
dholland a4fc39c06d Cleanups and hacks to make lfs userland stuff build:
- lfs_cksum.c doesn't actually need ulfs_inode.h any more.
   - neither does lfs_itimes.c.
   - add hacks to fsck_lfs to make it compile.
   - add hacks to newfs_lfs to make it compile.
   - fix warning in ulfs_quota.c when quotas are fully disabled
     (as I guess is happening with the rumpity version)

XXX: This commit adds -I${NETBSDSRCDIR}/sys to the Makefiles for
XXX: fsck_lfs, newfs_lfs, and lfs_cleanerd. This needs to be cleaned
XXX: up ASAP; but I consider this less problematic in the short term
XXX: than spewing ulfs_*.h into /usr/include.
2013-06-06 00:54:49 +00:00
dholland f67ddac196 ufs -> ulfs for newfs_lfs 2013-06-06 00:53:12 +00:00
dholland dcd34a91c5 Stuff UFS_ in front of a few of ufs's symbols to reduce namespace
pollution. Specifically:
   ROOTINO -> UFS_ROOTINO
   WINO -> UFS_WINO
   NXADDR -> UFS_NXADDR
   NDADDR -> UFS_NDADDR
   NIADDR -> UFS_NIADDR
   MAXSYMLINKLEN -> UFS_MAXSYMLINKLEN
   MAXSYMLINKLEN_UFS[12] -> UFS[12]_MAXSYMLINKLEN (for consistency)

Sort out ext2fs's misuse of NDADDR and NIADDR; fortunately, these have
the same values in ext2fs and ffs.

No functional change intended.
2013-01-22 09:39:11 +00:00
perseant ed08fe6512 Pass t_renamerace and t_rmdirrace tests.
Adapt dholland@'s fix to ufs_rename to fix PR kern/43582.  Address several
other MP locking issues discovered during the course of investigating the
same problem.

Removed extraneous vn_lock() calls on the Ifile, since the Ifile writes
are controlled by the segment lock.

Fix PR kern/45982 by deemphasizing the estimate of how much metadata
will fill the empty space on disk when the disk is nearly empty
(t_renamerace crates a lot of inode blocks on a tiny empty disk).
2012-02-16 02:47:54 +00:00
perseant 2e80c2a7d9 When creating a very small filesystem, use well-known small segment,
block and fragment sizes by default instead of the ordinary 1M/8k/1k
default for larger filesystems.
2012-02-02 03:50:32 +00:00
perseant 8c0be006bf If invoked with -D and creating an image file, ensure that the image
file is filled to the given size.  This prevents false failures
with "lfs: ifile read: 22" in ATF tests.
2012-02-02 03:49:22 +00:00
perseant 76c43fd1cf Use an even smaller segment size when creating a very small filesystem.
This allows the lfs_renamerace_dirs case of the t_renamerace test to
fail correctly, rather than with a bogus "file system full" error as it
has since rev 1.135 of sys/ufs/lfs/lfs.h.
2012-01-17 16:27:19 +00:00
mlelstv 7974872552 Three changes in a single commit.
- drop the notion of frags (LFS fragments) vs fsb (FFS fragments)
  The code uses a complicated unity function that just makes the
  code difficult to understand.

- support larger sector sizes. Fix disk address computations
  to use DEV_BSIZE in the kernel as required by device drivers
  and to use sector sizes in userland.

- Fix several locking bugs in lfs_bio.c and lfs_subr.c.
2010-02-16 23:20:30 +00:00
pooka 709a4d5bb6 Define syscalls of lfs userspace tools (cleaner, mainly) through
a struct called kernelops, which contains standard system calls
for the normal case and rump system calls for the rump case.

Make it possible to run the lfs cleaner in a library fashion (taking
the quick route with the implementation).
2009-08-06 00:51:55 +00:00
haad f5b48500f1 Add support for DIOCGDISKINFO to disk like device drivers. Change
partutil.c::getdiskinfo to use it to get disk geometry info.
Use DIOCGWEDGEINFO ioctl to get information about partition size, if disk
driver doesn't support it use old DIOCGDINFO. This patch adds support for
wedge like devices(lvm logical volumes, ZFS zvol partitions) to newfs and
other tools.

No objections on tech-userlevel@.
2009-06-05 21:52:31 +00:00
lukem ef685eeea9 Enable WARNS=4 by default except for:
dump  dump_lfs  fsck_ffs  fsck_lfs  fsdb  mount_smbfs
	newfs_ext2fs  newfs_lfs  resize_lfs  setkey
2009-04-11 07:58:11 +00:00
joerg 32a51b5de6 Fix markup. 2009-04-08 13:13:42 +00:00
dholland 481da53c30 Restore newfs_lfs after softdep removal (hi ad) 2009-02-22 23:06:23 +00:00
ad 59fcf21389 PR kern/26878 FFSv2 + softdep = livelock (no free ram)
PR kern/16942 panic with softdep and quotas
PR kern/19565 panic: softdep_write_inodeblock: indirect pointer #1 mismatch
PR kern/26274 softdep panic: allocdirect_merge: ...
PR kern/26374 Long delay before non-root users can write to softdep partitions
PR kern/28621 1.6.x "vp != NULL" panic in ffs_softdep.c:4653 while unmounting a softdep (+quota) filesystem
PR kern/29513 FFS+Softdep panic with unfsck-able file-corruption
PR kern/31544 The ffs softdep code appears to fail to write dirty bits to disk
PR kern/31981 stopping scsi disk can cause panic (softdep)
PR kern/32116 kernel panic in softdep (assertion failure)
PR kern/32532 softdep_trackbufs deadlock
PR kern/37191 softdep: locking against myself
PR kern/40474 Kernel panic after remounting raid root with softdep

Retire softdep, pass 2. As discussed and later formally announced on the
mailing lists.
2009-02-22 20:28:05 +00:00
lukem 6543a91fea Remove the \n and tabs from the __COPYRIGHT() strings.
(Tweak some to use a consistent format.)
2008-07-20 01:20:21 +00:00
hannken 5d2bff060a Make sure all cached buffers with valid, not yet written data have been
run through copy-on-write.  Call fscow_run() with valid data where possible.

The LP_UFSCOW hack is no longer needed to protect ffs_copyonwrite() against
endless recursion.

- Add a flag B_MODIFY to bread(), breada() and breadn().  If set the caller
  intends to modify the buffer returned.

- Always run copy-on-write on buffers returned from ffs_balloc().

- Add new function ffs_getblk() that gets a buffer, assigns a new blkno,
  may clear the buffer and runs copy-on-write.  Process possible errors
  from getblk() or fscow_run().  Part of PR kern/38664.

Welcome to 4.99.63

Reviewed by: YAMAMOTO Takashi <yamt@netbsd.org>
2008-05-16 09:21:59 +00:00
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
matt aacb8057fd lfs_sb_cksum returns a uint32_t, not a u_long 2008-02-16 17:58:43 +00:00
ad 2b5d04688e Make it build with src/sys from the vmlocking2 branch. 2007-12-28 21:44:32 +00:00
ad 0e7216ebf1 brelse() now takes two args. 2007-10-08 21:42:33 +00:00
hubertf df06563bc3 Remove more duplicate #includes,
from Slava Semushin <slava.semushin@gmail.com>
2007-01-17 21:59:49 +00:00
christos b8a730da20 c99 initializer 2006-10-16 03:15:46 +00:00
riz 3d1e464b85 Deal with wedges and the new disk geometry structures, instead of using
struct disklabel.  From Christos Zoulas.
2006-09-05 19:44:44 +00:00
perseant fb882cd53a Ensure sector size is zero in the debug case, to avoid a division by zero
error pointed out by Zafer Aydogan.
2006-08-06 00:21:14 +00:00
perseant f4bbda4f6c Don't try to even fake building a filesystem on a file descriptor that is
neither a file nor a character special device.
2006-08-06 00:14:17 +00:00
mrg d2eb498e2b - log2() -> lfs_log2().
- fix a couple of entries in struct lfs lfs_default:
	- in a comment, it's called dlfs_freehd now
	- dlfs_inodefmt comes after dlfs_tstamp.  fortunately for this
	one, LFS_44INODEFMT is also 0 so the right thing was happening.
2006-05-11 16:56:50 +00:00
perseant efc48a3bfa newfs_lfs(8) compoment of the recent superblock parameter addition. Change
the wording of the explanation of the -M option, detail a new -R option
that controls initial setting of the new parameter.
2006-05-04 04:39:15 +00:00
jld aab6081169 When testing seek speed (for the -A option), use sector-aligned offsets
so the reads don't always fail, and also be more careful not to read off
the end of the disk.  If a read does fail, error out instead of silently
leaving the loop early (and possibly dividing by zero seconds), because
it means our idea of the disk size is wrong, or worse.

This fixes PR bin/33199.
2006-04-23 07:56:58 +00:00
rumble e948e1b17f Check for allocation failures in malloc, calloc, realloc, asprintf, and
vasprintf and try to handle them.
2006-03-17 15:53:46 +00:00
christos 6d662c2dfa make this compile again. 2005-09-13 04:40:25 +00:00
yamt 653be60965 even with -F, don't overwrite p_size unless filesystem size is
specified by -s.
2005-08-22 09:19:19 +00:00
christos e4b2253c50 add const. 2005-06-27 02:05:30 +00:00
lukem a0618cd165 appease gcc -Wuninitialized 2005-06-02 00:48:48 +00:00
perseant 4c0e96afd6 Use the buffer cache improvements from fsck_lfs. Make it build again. 2005-04-12 01:06:39 +00:00
perseant 7f73a7b740 "#define lfs_devvp lfs_unlockvp" for readability, since that's what we
use it for in fsck_lfs/newfs_lfs.
2005-03-25 20:17:58 +00:00
perseant 5d2f3e4908 Various minor LFS improvements:
* Extend the lfs library from fsck_lfs(8) so that it can be used with a
  not-yet-existent LFS.  Make newfs_lfs(8) use this library, so it can
  create LFSs whose Ifile is larger than one segment.
* Make newfs_lfs(8) use strsuftoi64() for its arguments, a la newfs(8).
* Make fsck_lfs(8) respect the "file system is clean" flag.
* Don't let fsck_lfs(8) think it has dirty blocks when invoked with the
  -n flag.
2005-02-26 05:45:54 +00:00
dsl 9ab983c04a Add (unsigned char) cast to ctype function 2004-10-29 19:04:39 +00:00
yamt 48f5be416a - calculate maxfilesize dynamically rather than having a static table.
- no longer limit filesize to INT32_MAX.  file lbns are 64-bit these days.
  anyway, on-disk format shouldn't be limited by the kernel internals.
2004-09-11 08:33:53 +00:00
yamt 6928fd95a8 fix a sign expansion bug for >=8k blocksizes. 2004-09-09 22:57:19 +00:00
yamt 3223caeba2 remove definitions for ffs, which don't belong here. 2003-12-17 05:08:43 +00:00
wiz ee1b406595 Spell address with two d's. Inspired by similar changes in OpenBSD,
originating from Jonathon Gray and forwarded by jmc@openbsd.
2003-11-10 08:51:51 +00:00
yamt d59161d069 - don't try to write alt super blocks beyond the end of the partition.
- flush stdout when printing each super block addresses.
2003-10-09 14:28:34 +00:00