rwatson [Wed, 13 Nov 2002 15:47:09 +0000 (15:47 +0000)]
Introduce a condition variable to avoid returning EBUSY when
the MAC policy list is busy during a load or unload attempt.
We assert no locks held during the cv wait, meaning we should
be fairly deadlock-safe. Because of the cv model and busy
count, it's possible for a cv waiter waiting for exclusive
access to the policy list to be starved by active and
long-lived access control/labeling events. For now, we
accept that as a necessary tradeoff.
mux [Wed, 13 Nov 2002 15:14:57 +0000 (15:14 +0000)]
Add the sys/stddef.h header, so that we can have ptrdiff_t
definition in the kernel. It also includes the offsetof()
definition which, according to bde@ should be here and not
in sys/types.h, and the definition of NULL so that we're
closer to make it closer to standard C.
maxim [Wed, 13 Nov 2002 11:31:44 +0000 (11:31 +0000)]
Due to a memory alignment sizeof(struct ipfw_flow_id) is bigger than
ipfw_flow_id structure actual size and bcmp(3) may fail to compare
them properly. Compare members of these structures instead.
marcel [Wed, 13 Nov 2002 05:39:59 +0000 (05:39 +0000)]
Also test for type efi everywhere we currently test for type fat.
With this change there's no a priori difference between EFI and
FAT partitions. With this change and the corresponding change to
libdisk, we can create EFI partitions, just like regular FAT
partitions.
alc [Wed, 13 Nov 2002 05:39:58 +0000 (05:39 +0000)]
Move pmap_collect() out of the machine-dependent code, rename it
to reflect its new location, and add page queue and flag locking.
Notes: (1) alpha, i386, and ia64 had identical implementations
of pmap_collect() in terms of machine-independent interfaces;
(2) sparc64 doesn't require it; (3) powerpc had it as a TODO.
marcel [Wed, 13 Nov 2002 05:31:32 +0000 (05:31 +0000)]
Handle EFI partitions the same as regular FAT partitions. The only
difference between the two from a low-level point of view is that
the partition type is different. This change adds EFI related cases
to existing switch statements with existing FAT related cases.
rwatson [Tue, 12 Nov 2002 22:30:01 +0000 (22:30 +0000)]
Add LOGIN_SETMAC to the list of flags that can't be set without class
information, since we rely on the pwd entry to know what MAC labels
to set as part of the login process.
peter [Tue, 12 Nov 2002 21:18:21 +0000 (21:18 +0000)]
Fix a "bug" in sysctl(8). Limit the length when we print a string from
the kernel rather than ignoring the length and keeping on going till we
finally hit a \0 character in the buffer.
jhb [Tue, 12 Nov 2002 21:12:42 +0000 (21:12 +0000)]
Remove a line that set the status to success. We already do that at the
beginning, so the best this could achieve would be to mask an earlier
failure. Break instead of continue for another failure case.
jhb [Tue, 12 Nov 2002 21:09:58 +0000 (21:09 +0000)]
Try to cleanup the non-interactive disk labeling code a bit. Rework
the loop that runs through the environment variables to be a bit more
intuitive. Also, change some 'continue's in failure cases to 'break's
instead. If we are going to fail, we should just do it.
PR: bin/40654
Submitted by: Thomas Zenker <thz@Lennartz-electronic.de> (partially)
jhb [Tue, 12 Nov 2002 20:48:49 +0000 (20:48 +0000)]
Do a bit of cleanup. new_part() basically ignored the passed in size
argument as of revision 1.52 (July 12, 1996, about a month after I
graduated from high school) when 'newfs -u' support was axed, so remove it.
This also allows us to remove a hack in the create partition case where we
created the partition twice since we didn't have the size the first time.
simokawa [Tue, 12 Nov 2002 13:49:17 +0000 (13:49 +0000)]
Use struct fw_device in fwmem.c
- specify fwmem target by EUI64.
- fw_noderesolve returns struct fw_device rather than dst.
- include struct firewire_comm in struct fw_device.
scottl [Tue, 12 Nov 2002 10:22:49 +0000 (10:22 +0000)]
Use better return types and a couple of casts to eliminate warnings on
alpha. This will take the file out of sync with the private version
that we maintain, but alpha tinderbox has been broken for too long.
scottl [Tue, 12 Nov 2002 08:23:27 +0000 (08:23 +0000)]
Step one of cleaning and fixing cardbus:
- Fix some especially bad style in the CIS BAR tuple parsing code.
- activate Option ROMS correctly.
- de-obfuscate the Option ROM image selection code.
- Fix mis-interpretation of the PCI spec that prevented Option ROMs whose
CIS section wasn't in the first image from working.
- Fix mis-interpretation of the PCI spec that prevented CIS's mapped into
MEMIO space from working at all.
- Reject invalid CIS pointers.
rwatson [Tue, 12 Nov 2002 04:20:36 +0000 (04:20 +0000)]
Garbage collect mac_create_devfs_vnode() -- it hasn't been used since
we brought in the new cache and locking model for vnode labels. We
now rely on mac_associate_devfs_vnode().
jhb [Mon, 11 Nov 2002 16:36:20 +0000 (16:36 +0000)]
Correct an assertion in the code to traverse the list of locks to find an
earlier acquired lock with the same witness as the lock currently being
acquired. If we had released several earlier acquired locks after
acquiring enough locks to require another lock_list_entry bucket in the
lock list, then subsequent lock_list_entry buckets could contain only one
lock instance in which case i would be zero.
rwatson [Mon, 11 Nov 2002 14:15:58 +0000 (14:15 +0000)]
Garbage collect definition of M_MACOPVEC -- we no longer perform a
dynamic mapping of an operation vector into an operation structure,
rather, we rely on C99 sparse structure initialization.
tmm [Mon, 11 Nov 2002 10:45:31 +0000 (10:45 +0000)]
Declare the snp ioctl()s to work on udev_t, since that is what they
really do and dev_t is defined differently in kernel and userland.
Return a correctly formed udev from SNPGTTY.
marcel [Mon, 11 Nov 2002 08:11:44 +0000 (08:11 +0000)]
ia64 ABI breaker:
Don't force 16-byte alignment at run-time. Do it at compile-time.
This saves us the pointer fiddling by the setjmp functions and
reduces complexity. While here, increase the jmp_buf by 16 bytes
to an even 512 bytes. Coincidentally, due to the way alignment
was handled prior to this change, the jmp_buf has not changed in
size, but only in how the space is used. Prior to this change
the 16 bytes were reserved for enforcing alignment; now they are
reserved by us for future extensions.
Therefore, this ABI breaker is relatively save: the failure is
always an alignment trap.
yar [Mon, 11 Nov 2002 07:31:48 +0000 (07:31 +0000)]
Don't free the current addrinfo list, or else a pointer to a freed
memory area would arise. Only an addrinfo list from an earlier
call to getaddrinfo() should be freed there because it will be
substituted by the current list referenced by "res".
Reported by: John Long <fbsd1@pruam.com>
MFC after: 5 days
alc [Mon, 11 Nov 2002 05:17:34 +0000 (05:17 +0000)]
- Clear the page's PG_WRITEABLE flag in the i386's pmap_changebit()
if we're removing write access from the page's PTEs.
- Export pmap_remove_all() on alpha, i386, and ia64. (It's already
exported on sparc64.)
marcel [Mon, 11 Nov 2002 00:29:01 +0000 (00:29 +0000)]
Given that we have 3 places to document UUID related information,
namely uuidgen(1), uuidgen(2) and uuid(3), the following division
has been choosen:
uuidgen(1) A description of the command line utility,
and other user oriented UUID information.
uuidgen(2) A mostly technical description of UUIDs.
uuid(3) A description of the functions and other
programmer oriented UUID information.
According to the division: add more technical contents.
Contributed by: Hiten Pandya <hiten@uk.FreeBSD.org>
Edited and enhanced: marcel
jake [Sun, 10 Nov 2002 21:07:29 +0000 (21:07 +0000)]
Write the boot block to the first 16 sectors of all partitions, instead of
always to the first 16 sectors of the disk. The firmware reads the boot
code from a partition, defaulting to 'a' if none is specified, which only
corresponds to the first 16 sectors of the disk if 'a' is first. Solaris
often makes the swap partition first, instead of the root partition, and
users expect to be able to do the same with freebsd as well. This also
allows one to temporarily boot from another partition if the boot block
on the root partition gets scrambled somehow.
marcel [Sun, 10 Nov 2002 20:53:10 +0000 (20:53 +0000)]
Add efi to the list of types for which we need to return tha name.
Also, return chunk type efi in case we find an EFI partition in
the GPT. We used to return FAT due to a lack of EFI type.
marcel [Sun, 10 Nov 2002 20:47:02 +0000 (20:47 +0000)]
General cleanup:
o Remove all code guarded by !defined(__ia64__). This file is
specifically written for ia64,
o Handle the case when read_block() or write_block() fails. We
don't want sysinstall(8) to signal a thumbs-up on error,
o Set the starting (cyl,hd,sect) triple to 0xFFFFFF when either
bios_hd or bios_sect is zero or the LBA us not representable
with the triple. In that case automaticly initialize the
ending triple with 0xFFFFFF as well,
o Reindent Write_Int32() as it was different than the rest of
the file,
o Remove some unused variables that appeared to be used but
were effectively useless.
o Plug a memory leak: The second timne we read the MBR, we write
out a modified block, but didn't free the memory after writing.
o Replace d1->sector_size with 512 when we read/write the MBR.
We ignore the sector size in cases we shouldn't but adhered to
it in cases it would be wrong if the sector_size wasn't 512.
This file should eventually be rewritten to write out a GPT. For
now, a MBR will do...
marcel [Sun, 10 Nov 2002 20:22:25 +0000 (20:22 +0000)]
Remove inclusion of <sys/uuid.h>. We now include <sys/uuid.h> in
<sys/gpt.h>. This avoids having to include both <sys/uuid.h> and
<uuid.h>, which is considered by your friendly committer to be
aestheticly displeasing (= ballyhoo barf barf :-)