Tim Kientzle [Tue, 29 Dec 2009 06:34:23 +0000 (06:34 +0000)]
Essentially eliminate problems with false hardlinks in POSIX cpio
archives by generating synthetic ino values and mapping values
from disk into the new values.
Tim Kientzle [Tue, 29 Dec 2009 06:06:20 +0000 (06:06 +0000)]
If we're linking against liblzma, allow the decompressor to use up to
1<<30 bytes of memory, which is required for some streams.
Also, try to make the taster more discriminating about raw lzma streams.
The detection here is still really weak, though; please use xz instead
of lzma.
Tim Kientzle [Tue, 29 Dec 2009 05:47:46 +0000 (05:47 +0000)]
Style and portability fixes for pax writer. Mostly very routine, except for:
* Use ino64 where appropriate
* Don't pass atime or nsec to ustar formatter
Tim Kientzle [Tue, 29 Dec 2009 05:44:39 +0000 (05:44 +0000)]
Style fixes to tar reader:
For portability, prefer int64_t to off_t.
Improve numeric overflow handling when parsing.
Fix some variable types.
Eliminate some unused results.
Tim Kientzle [Tue, 29 Dec 2009 05:41:57 +0000 (05:41 +0000)]
Various style fixes to the 'newc' cpio writer:
* Warn about truncation of ino
* Use a macro to hide the somewhat obscure pad-to-multiple-of-4 calculation
* Eliminate some unused variables
Tim Kientzle [Tue, 29 Dec 2009 05:35:40 +0000 (05:35 +0000)]
Various fixes when creating objects on disk:
* Write xattrs last instead of first (required on platforms that use
system xattrs for security attributes)
* Better handling of chdir() failures
* Don't bother trying to shorten files via seek()/write()
* Fix build on systems that lack link()/symlink()/mknod()
* Prefer futimens()/utimensat() when they're present
Tim Kientzle [Tue, 29 Dec 2009 05:28:28 +0000 (05:28 +0000)]
Various style and portability fixes, including:
* Enforce option interface can only be used before the archive is opened
* Correctly handle large skips on platforms with 32-bit off_t
* Use int64_t instead of off_t
Antoine Brodin [Mon, 28 Dec 2009 22:56:30 +0000 (22:56 +0000)]
(S)LIST_HEAD_INITIALIZER takes a (S)LIST_HEAD as an argument.
Fix some wrong usages.
Note: this does not affect generated binaries as this argument is not used.
Bjoern A. Zeeb [Mon, 28 Dec 2009 21:14:18 +0000 (21:14 +0000)]
Make the compiler happy after r201125:
- + remove two unnecessary initializations in ip_output;
+ + remove one unnecessary initializations in ip_output;
Ed Schouten [Mon, 28 Dec 2009 20:54:34 +0000 (20:54 +0000)]
Migrate finger(1) away from <utmp.h>.
Unfortunately it also uses lastlog, which means we must resort to local
extensions of the utmpx-interface. Because the user name and TTY name
are now nul-terminated, there is no need to copy around strings as
often.
Alexander Motin [Mon, 28 Dec 2009 20:08:01 +0000 (20:08 +0000)]
Add BIO_DELETE support to ada(4):
- For SSDs use TRIM feature of DATA SET MANAGEMENT command, as defined by
ACS-2 specification working draft.
- For CompactFlash use CFA ERASE command, same as ad(4) does.
With this patch, `newfs -E /dev/ada1` was able to restore write speed of
my heavily weared OCZ Vertex SSD (firmware 1.4) up to the initial level
for the most part of it's capacity. Previous 1.3 firmware, even reportiong
TRIM capabilty bit set, was not working, reporting ABORT error for every
DSM command.
I have no idea whether it is normal, but for some reason it takes 200ms
to handle any TRIM command on this drive, that was making delete extremely
slow. But TRIM command is able to accept long list of LBAs and the length of
that list seems doesn't affect it's execution time. Implemented request
clusting algorithm allowed me to rise delete rate up to reasonable numbers,
when many parallel DELETE requests running.
Justin T. Gibbs [Mon, 28 Dec 2009 18:59:13 +0000 (18:59 +0000)]
Correct alignment and boundary constraints in blkfront's bus dma tag. The
blkif interface in Xen requires all I/O to be 512 byte aligned with each
segment bounded by a 4k page.
Note: This submission only documents the proper contraints for blkif I/O.
The alignment code in busdma does not yet handle alignment constraints
correctly in all cases.
Xin LI [Mon, 28 Dec 2009 17:57:37 +0000 (17:57 +0000)]
Make umount(8) WARNS=6 clean:
- Cast delimiter width to integer [1]
- Solve name conflicts against system header
- Constify parameters to avoid qualifier conflict
Add a knob to allow reclaim of the directory vnodes that are source of
the namecache records. The reclamation is not enabled by default because
for typical workload it would make namecache unusable, but large nested
directory tree easily puts any process that accesses filesystem into 1
second wait for vlru.
Reported by: yar (long time ago)
MFC after: 3 days
Luigi Rizzo [Mon, 28 Dec 2009 14:48:32 +0000 (14:48 +0000)]
introduce a local variable rte acting as a cache of ro->ro_rt
within ip_output, achieving (in random order of importance):
- a reduction of the number of 'r's in the source code;
- improved legibility;
- a reduction of 64 bytes in the .text
Luigi Rizzo [Mon, 28 Dec 2009 14:09:46 +0000 (14:09 +0000)]
+ remove an unused #define print_ip;
+ remove two unnecessary initializations in ip_output;
+ localize 'len';
+ introduce a temporary variable n to count the number of fragments,
the compiler seems unable to identify a common subexpression
(written 3 times, used twice);
+ document some assumptions on ip_len and ip_hl
Luigi Rizzo [Mon, 28 Dec 2009 10:47:04 +0000 (10:47 +0000)]
bring in several cleanups tested in ipfw3-head branch, namely:
r201011
- move most of ng_ipfw.h into ip_fw_private.h, as this code is
ipfw-specific. This removes a dependency on ng_ipfw.h from some files.
- move many equivalent definitions of direction (IN, OUT) for
reinjected packets into ip_fw_private.h
- document the structure of the packet tags used for dummynet
and netgraph;
r201049
- merge some common code to attach/detach hooks into
a single function.
r201055
- remove some duplicated code in ip_fw_pfil. The input
and output processing uses almost exactly the same code so
there is no need to use two separate hooks.
ip_fw_pfil.o goes from 2096 to 1382 bytes of .text
r201057 (see the svn log for full details)
- macros to make the conversion of ip_len and ip_off
between host and network format more explicit
r201113 (the remaining parts)
- readability fixes -- put braces around some large for() blocks,
localize variables so the compiler does not think they are uninitialized,
do not insist on precise allocation size if we have more than we need.
r201119
- when doing a lookup, keys must be in big endian format because
this is what the radix code expects (this fixes a bug in the
recently-introduced 'lookup' option)
Tim Kientzle [Mon, 28 Dec 2009 02:20:23 +0000 (02:20 +0000)]
Portability: terminate abnormally via abort() instead of segfault,
watch the return value from write(), and avoid signed arithmetic on
unsigned values.
Ed Schouten [Sun, 27 Dec 2009 22:26:29 +0000 (22:26 +0000)]
Parse DEAD_PROCESS entries properly.
The TTY line name should always be set for DEAD_PROCESS entries right
now. When we parse a clean utmp entry, we don't want to interpret it as
a DEAD_PROCESS entry if the TTY has never been used yet.
Ed Schouten [Sun, 27 Dec 2009 21:14:55 +0000 (21:14 +0000)]
Let rwhod use libulog.
I am not planning on providing a mechanism tot stat() the database files
directly. The disadvantage of this, is that rwhod will now be a little
bit more heavy than it used to be. It normally used to fstat() the file
descriptor to see whether the file had changed, but this is now
impossible to implement, meaning we have to parse the entire utmp file
each 180 seconds.
This is probably not an issue on modern 16-way servers, but if it turns
out to be a problem, we'll think of something.