summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Declare a `struct extattr' that defines the format of an extendedmckusick2007-02-262-0/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | attribute. Also define some macros to manipulate one of these structures. Explain their use in the extattr.9 manual page. The next step will be to make a sweep through the kernel replacing the old pointer manipulation code. To get an idea of how they would be used, the ffs_findextattr() function in ufs/ffs/ffs_vnops.c is currently written as follows: /* * Vnode operating to retrieve a named extended attribute. * * Locate a particular EA (nspace:name) in the area (ptr:length), and return * the length of the EA, and possibly the pointer to the entry and to the data. */ static int ffs_findextattr(u_char *ptr, u_int length, int nspace, const char *name, u_char **eap, u_char **eac) { u_char *p, *pe, *pn, *p0; int eapad1, eapad2, ealength, ealen, nlen; uint32_t ul; pe = ptr + length; nlen = strlen(name); for (p = ptr; p < pe; p = pn) { p0 = p; bcopy(p, &ul, sizeof(ul)); pn = p + ul; /* make sure this entry is complete */ if (pn > pe) break; p += sizeof(uint32_t); if (*p != nspace) continue; p++; eapad2 = *p++; if (*p != nlen) continue; p++; if (bcmp(p, name, nlen)) continue; ealength = sizeof(uint32_t) + 3 + nlen; eapad1 = 8 - (ealength % 8); if (eapad1 == 8) eapad1 = 0; ealength += eapad1; ealen = ul - ealength - eapad2; p += nlen + eapad1; if (eap != NULL) *eap = p0; if (eac != NULL) *eac = p; return (ealen); } return(-1); } After applying the structure and macros, it would look like this: /* * Vnode operating to retrieve a named extended attribute. * * Locate a particular EA (nspace:name) in the area (ptr:length), and return * the length of the EA, and possibly the pointer to the entry and to the data. */ static int ffs_findextattr(u_char *ptr, u_int length, int nspace, const char *name, u_char **eapp, u_char **eac) { struct extattr *eap, *eaend; eaend = (struct extattr *)(ptr + length); for (eap = (struct extattr *)ptr; eap < eaend; eap = EXTATTR_NEXT(eap)){ /* make sure this entry is complete */ if (EXTATTR_NEXT(eap) > eaend) break; if (eap->ea_namespace != nspace || eap->ea_namelength != length || bcmp(eap->ea_name, name, length)) continue; if (eapp != NULL) *eapp = eap; if (eac != NULL) *eac = EXTATTR_CONTENT(eap); return (EXTATTR_CONTENT_SIZE(eap)); } return(-1); } Not only is it considerably shorter, but it hopefully more readable :-)
* Remove unused header file <machine/katelib.h>kevlo2007-02-263-4/+0
|
* mii_phy_dev_probe returns its third argument on match, not 0, so pass 0imp2007-02-261-1/+1
| | | | | | in if we're going to test against 0. Noticed by: marius@
* Close race conditions between fork() and [sg]etpriority()'sdelphij2007-02-262-5/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PRIO_USER case, possibly also other places that deferences p_ucred. In the past, we insert a new process into the allproc list right after PID allocation, and release the allproc_lock sx. Because most content in new proc's structure is not yet initialized, this could lead to undefined result if we do not handle PRS_NEW with care. The problem with PRS_NEW state is that it does not provide fine grained information about how much initialization is done for a new process. By defination, after PRIO_USER setpriority(), all processes that belongs to given user should have their nice value set to the specified value. Therefore, if p_{start,end}copy section was done for a PRS_NEW process, we can not safely ignore it because p_nice is in this area. On the other hand, we should be careful on PRS_NEW processes because we do not allow non-root users to lower their nice values, and without a successful copy of the copy section, we can get stale values that is inherted from the uninitialized area of the process structure. This commit tries to close the race condition by grabbing proc mutex *before* we release allproc_lock xlock, and do copy as well as zero immediately after the allproc_lock xunlock. This guarantees that the new process would have its p_copy and p_zero sections, as well as user credential informaion initialized. In getpriority() case, instead of grabbing PROC_LOCK for a PRS_NEW process, we just skip the process in question, because it does not affect the final result of the call, as the p_nice value would be copied from its parent, and we will see it during allproc traverse. Other potential solutions are still under evaluation. Discussed with: davidxu, jhb, rwatson PR: kern/108071 MFC after: 2 weeks
* Move _posix1e_acl_name_to_id out of acl_support.c and intokientzle2007-02-263-55/+52
| | | | | | | | | acl_from_text.c. Since acl_from_text.c is the only place it is used, we can now make this internal utility function "static." As a bonus, acl_set_fd() no longer pulls in getpwuid() for no reason. MFC after: 7 days
* Define FLASHADDR and LOADERRAMADDR for the Avila, so that we can boot acognet2007-02-261-0/+2
| | | | kernel from the onboard flash.
* Erm we can't change the value of arm_memcpy if we're running from flash.cognet2007-02-262-5/+23
| | | | | Instead, make memcpy() check if we're running from flash, and avoid using arm_memcpy if we're doing so.
* Implement the -h flag (set an ACL on a symbolic link).mckusick2007-02-261-4/+14
| | | | | | | Before this fix the -h flag was ignored (i.e. setfacl always set the ACL on the file pointed to by the symbolic link even when the -h flag requested that the ACL be set on the symbolic link itself).
* Update for the new prototype of bus_setup_intr().cognet2007-02-252-4/+4
|
* Don't assert() the TLS allocation requested is big enough; justkientzle2007-02-251-2/+2
| | | | | | fix the argument. In particular, this is a step towards breaking crt1's dependence on stdio.
* Mark the vm_page_unmanage(9) manpage as obsolete.ru2007-02-251-0/+2
| | | | Reminded by: maxim
* Catch up with bus_setup_intr() modification and garbage collect apiso2007-02-251-2/+2
| | | | reference to INTR_FAST.
* Catch up with bus_setup_intr() modification and garbage collect twopiso2007-02-251-4/+4
| | | | references to INTR_FAST.
* Garbage collect a reference to INTR_FAST.piso2007-02-252-2/+2
|
* Fix attach of at91_pio() after bus_setup_intr() modification.piso2007-02-251-1/+1
| | | | Reported and tested by: Krassimir Slavchev
* Update multicast(4) manual page to reflect the new reality of the code.bms2007-02-251-8/+26
|
* Unlock a mutex which should be unlocked before returning.bms2007-02-251-1/+3
| | | | MFC after: 1 week
* semi-automatic style(9)netchild2007-02-2510-1328/+1377
|
* MFp4 (110541):netchild2007-02-251-2/+7
| | | | | | Sync with rev 1.7 in NetBSD. Obtained from: NetBSD
* MFp4 (110523, parts which apply cleanly):netchild2007-02-252-89/+92
| | | | | | | | | semi-automatic style(9) The futex stuff already differs a lot (only a small part does not differ) from NetBSD, so we are already way off and can't apply changes from NetBSD automatically. As we need to merge everything by hand already, we can even make the files comply to our world order.
* Use uma_set_align().marius2007-02-251-0/+1
|
* Remove the traces of vm_page_unmanage().ru2007-02-253-58/+0
|
* Fix ALC883 microphone / recording issues. Setting high(er) VRef onariff2007-02-251-4/+95
| | | | | | | | (external) microphone pin tend to screw it. Internal microphone (found on several laptops) still need high VRef. Tested by: Pietro Cerutti <pietro.cerutti@gmail.com> lenix <irc.freenode.net>
* Change the way that unmanaged pages are created. Specifically,alc2007-02-256-48/+11
| | | | | | | | | | | | | | immediately flag any page that is allocated to a OBJT_PHYS object as unmanaged in vm_page_alloc() rather than waiting for a later call to vm_page_unmanage(). This allows for the elimination of some uses of the page queues lock. Change the type of the kernel and kmem objects from OBJT_DEFAULT to OBJT_PHYS. This allows us to take advantage of the above change to simplify the allocation of unmanaged pages in kmem_alloc() and kmem_malloc(). Remove vm_page_unmanage(). It is no longer used.
* Add a regression test for ethernet link-layer multicast memberships.bms2007-02-252-0/+263
|
* Add support for selecting from multiple tuners.grog2007-02-252-8/+27
| | | | Suggested by: usleepless <usleepless@gmail.com>
* Tidy up forrmat. No functional changes.grog2007-02-251-5/+9
|
* Further style(9) for ipx_ip.rwatson2007-02-252-9/+7
|
* Improve ipx_ip.c's approximation of style(9).rwatson2007-02-251-97/+82
|
* use getifaddrs from libc instead of private codesam2007-02-247-195/+116
| | | | | Reviewed by: bms MFC after: 1 month
* don't call ath_reset when processing sysctl's before the devicesam2007-02-241-4/+5
| | | | | | | is marked running; we don't have all the needed state in place Noticed by: Hugo Silva <hugo@barafranca.com> MFC after: 1 week
* set the antenna switch when fixing the tx antenna using thesam2007-02-242-3/+30
| | | | | | | | dev.ath.X.txantenna sysctl; this is typically what folks want but beware this has the side effect of disabling rx diversity MFC after: 2 weeks
* - Use a permanent URL to reference piso's mail.simon2007-02-241-1/+2
| | | | - Put URL on seperate line to not get very long lines.
* Use sysctl(2), not kvm(3), to read IPv6 multicast information frombms2007-02-242-21/+60
| | | | | | the running system. Use the name 'IPv6 Forwarding Table', not 'IPv6 Routing Table', to be consistent with what the code actually does and is.
* Use the names 'IPv4' and 'Forwarding Table' in program output, notbms2007-02-241-4/+4
| | | | 'Routing Table', to be consistent with what the code actually does and is.
* Add comments about where netstat is using KVM to read things whichbms2007-02-241-1/+3
| | | | should really be available via sysctl for a running system.
* Reword addition about MROUTING.bms2007-02-241-3/+3
| | | | Submitted by: ru
* Fix tinderbox. ip6_mrouter should be defined in raw_ip6.c as it isbms2007-02-242-5/+2
| | | | | | | tested to determine if the userland socket is open; this, in turn, is used to determine if the module has been loaded. Tested with: LINT
* Update my previous note about newbus API breakage mentioning thepiso2007-02-241-2/+3
| | | | __FreeBSD_version bump.
* Note newbus API & ABI breakage.piso2007-02-241-0/+5
|
* Updated ia64 isa support with the new bus_setup_intr() syntax.piso2007-02-241-2/+3
| | | | Approved by: re (implicit?)
* Partial MFp4 of 114977:netchild2007-02-249-39/+40
| | | | | | Whitespace commit: Fix grammar, spelling and punctuation. Submitted by: "Scot Hetzel" <swhetzel@gmail.com>
* exca->pccarddev should always be non-null now. Only call it when theimp2007-02-241-1/+1
| | | | device is actually attached.
* Convert sis(4) to use its own watchdog procedure.delphij2007-02-242-16/+16
| | | | Submitted by: Florian C. Smeets <flo kasimir com>
* Note that IPv6 multicast forwarding is now dynamically loadable.bms2007-02-241-0/+6
|
* Make IPv6 multicast forwarding dynamically loadable from a GENERIC kernel.bms2007-02-2410-35/+171
| | | | | | It is built in the same module as IPv4 multicast forwarding, i.e. ip_mroute.ko, if and only if IPv6 support is enabled for loadable modules. Export IPv6 forwarding structs to userland netstat(1) via sysctl(9).
* o break newbus api: add a new argument of type driver_filter_t topiso2007-02-241-1/+1
| | | | | | | | | | | | bus_setup_intr() o add an int return code to all fast handlers o retire INTR_FAST/IH_FAST For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current Approved by: re (implicit?)
* Redo previous newbus related change to be kinder tomjacob2007-02-235-3/+17
| | | | multi-release support.
* Use tsleep() rather than msleep() with a NULL mtx parameter.jhb2007-02-233-11/+11
|
* Whitespace fix.jhb2007-02-231-1/+1
|
OpenPOWER on IntegriCloud