diff options
author | jmg <jmg@FreeBSD.org> | 2007-04-28 07:37:49 +0000 |
---|---|---|
committer | jmg <jmg@FreeBSD.org> | 2007-04-28 07:37:49 +0000 |
commit | eac96af0bf6b669bb2644f8fa166b8acb6a58c53 (patch) | |
tree | cb0f33081355405cc3be2966218c2580d0dbbc59 | |
parent | ad4f22d823820394750e39308b7feeecb33b34dd (diff) | |
download | FreeBSD-src-eac96af0bf6b669bb2644f8fa166b8acb6a58c53.zip FreeBSD-src-eac96af0bf6b669bb2644f8fa166b8acb6a58c53.tar.gz |
Complete removal of restriction about overlaps to rman_manage_region:
remove comment and man page verbage...
Document return values for rman_init and rman_manage_region..
MFC after: 1 week
-rw-r--r-- | share/man/man9/rman.9 | 21 | ||||
-rw-r--r-- | sys/kern/subr_rman.c | 4 |
2 files changed, 16 insertions, 9 deletions
diff --git a/share/man/man9/rman.9 b/share/man/man9/rman.9 index f964a3c..7bef25e 100644 --- a/share/man/man9/rman.9 +++ b/share/man/man9/rman.9 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 15, 2005 +.Dd April 28, 2007 .Dt RMAN 9 .Os .Sh NAME @@ -140,6 +140,12 @@ function initializes the region descriptor, pointed to by the .Fa rm argument, for use with the resource management functions. It also initializes any mutexes associated with the structure. +If +.Fn rman_init +fails to initalize the mutex, it will return +.Er ENOMEM ; otherwise it will return 0 and +.Fa rm +will be initalized. .Pp The .Fn rman_fini @@ -167,10 +173,15 @@ The and .Fa end arguments specify the bounds of the region. -.Pp -.Em NOTE : -This interface is not robust against programming errors which -add multiple copies of the same region. +If successful, +.Fn rman_manage_region +will return 0. +If the region overlaps with an existing region, it will return +.Er EBUSY . +.Er ENOMEM +will be return when +.Fn rman_manage_region +failed to allocate memory for the region. .Pp The .Fn rman_reserve_resource_bound diff --git a/sys/kern/subr_rman.c b/sys/kern/subr_rman.c index becf47e..cdac3ef 100644 --- a/sys/kern/subr_rman.c +++ b/sys/kern/subr_rman.c @@ -155,10 +155,6 @@ rman_init(struct rman *rm) return 0; } -/* - * NB: this interface is not robust against programming errors which - * add multiple copies of the same region. - */ int rman_manage_region(struct rman *rm, u_long start, u_long end) { |