Re: dev_lock() question

2005-09-30 Thread John Baldwin
On Thursday 29 September 2005 03:36 pm, Poul-Henning Kamp wrote: In message [EMAIL PROTECTED], John Baldwin writes: On Thursday 29 September 2005 02:14 pm, Poul-Henning Kamp wrote: In message [EMAIL PROTECTED], John Baldwin writes: Actually, you would think that it could be initialized

dev_lock() question

2005-09-29 Thread Divacky Roman
Hi, dev_lock() looks this way: void dev_lock(void) { if (!mtx_initialized(devmtx)) mtx_init(devmtx, cdev, NULL, MTX_DEF); mtx_lock(devmtx); } I wonder why is the mtx_initialized checking necessary? shouldnt explicit initialization be sufficient? thnx for answer

Re: dev_lock() question

2005-09-29 Thread Stanislav Sedov
On Thu, Sep 29, 2005 at 06:55:38PM +0200, Divacky Roman wrote: Hi, dev_lock() looks this way: void dev_lock(void) { if (!mtx_initialized(devmtx)) mtx_init(devmtx, cdev, NULL, MTX_DEF); mtx_lock(devmtx); } I wonder why is the mtx_initialized checking

Re: dev_lock() question

2005-09-29 Thread John Baldwin
On Thursday 29 September 2005 01:04 pm, Stanislav Sedov wrote: On Thu, Sep 29, 2005 at 06:55:38PM +0200, Divacky Roman wrote: Hi, dev_lock() looks this way: void dev_lock(void) { if (!mtx_initialized(devmtx)) mtx_init(devmtx, cdev, NULL, MTX_DEF);

Re: dev_lock() question

2005-09-29 Thread Poul-Henning Kamp
In message [EMAIL PROTECTED], John Baldwin writes: Actually, you would think that it could be initialized either via an early SYSINIT() or in the init_mutexes() function in kern_mutex.c and thus not need the early check and avoid penalizing dev_lock(). phk, how early his dev_lock needed? Far

Re: dev_lock() question

2005-09-29 Thread John Baldwin
On Thursday 29 September 2005 02:14 pm, Poul-Henning Kamp wrote: In message [EMAIL PROTECTED], John Baldwin writes: Actually, you would think that it could be initialized either via an early SYSINIT() or in the init_mutexes() function in kern_mutex.c and thus not need the early check and

Re: dev_lock() question

2005-09-29 Thread Poul-Henning Kamp
In message [EMAIL PROTECTED], John Baldwin writes: On Thursday 29 September 2005 02:14 pm, Poul-Henning Kamp wrote: In message [EMAIL PROTECTED], John Baldwin writes: Actually, you would think that it could be initialized either via an early SYSINIT() or in the init_mutexes() function in