Date: Thu, 7 Sep 2006 13:27:01 GMT From: Todd Miller <millert@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 105779 for review Message-ID: <200609071327.k87DR1LP010844@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=105779 Change 105779 by millert@millert_g5tower on 2006/09/07 13:26:42 Slightly less obfuscated label handle locking: Rename mutex in label handle from io_lock_data to lh_lock_data since it is part of the label handle and not an ipc_object struct. This means we need to define lh_lock, lh_unlock and lh_lock_init in terms of the mutex_* functions and not io_*. Affected files ... .. //depot/projects/trustedbsd/sedarwin8/darwin/xnu/osfmk/ipc/ipc_labelh.c#6 edit .. //depot/projects/trustedbsd/sedarwin8/darwin/xnu/osfmk/ipc/ipc_labelh.h#3 edit .. //depot/projects/trustedbsd/sedarwin8/darwin/xnu/osfmk/kern/task.h#2 edit Differences ... ==== //depot/projects/trustedbsd/sedarwin8/darwin/xnu/osfmk/ipc/ipc_labelh.c#6 (text+ko) ==== @@ -71,7 +71,7 @@ /* Allocate new label handle, insert port and label. */ lh = (ipc_labelh_t)zalloc(ipc_labelh_zone); - io_lock_init(lh); + lh_lock_init(lh); lh->lh_port = port; lh->lh_label = *inl; lh->lh_type = LABELH_TYPE_USER; ==== //depot/projects/trustedbsd/sedarwin8/darwin/xnu/osfmk/ipc/ipc_labelh.h#3 (text+ko) ==== @@ -37,7 +37,7 @@ int lh_type; struct label lh_label; ipc_port_t lh_port; - decl_mutex_data(, io_lock_data) + decl_mutex_data(, lh_lock_data) } *ipc_labelh_t; #define LABELH_TYPE_KERN 0 @@ -60,8 +60,9 @@ extern zone_t ipc_labelh_zone; -#define lh_lock io_lock -#define lh_unlock io_unlock +#define lh_lock_init(lh) mutex_init(&(lh)->lh_lock_data, 0) +#define lh_lock(lh) mutex_lock(&(lh)->lh_lock_data) +#define lh_unlock(lh) mutex_unlock(&(lh)->lh_lock_data) /* * Check the number of references the label handle has left. ==== //depot/projects/trustedbsd/sedarwin8/darwin/xnu/osfmk/kern/task.h#2 (text+ko) ==== @@ -215,8 +215,8 @@ #ifdef MAC #define maclabel label->lh_label -#define tasklabel_lock(task) io_lock((task)->label) -#define tasklabel_unlock(task) io_unlock((task)->label) +#define tasklabel_lock(task) lh_lock((task)->label) +#define tasklabel_unlock(task) lh_unlock((task)->label) extern void tasklabel_lock2(task_t a, task_t b); extern void tasklabel_unlock2(task_t a, task_t b);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200609071327.k87DR1LP010844>