Re: sema_init fail in 2.6

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, May 26, 2008 at 4:59 AM, Matthew Wilcox <matthew@xxxxxx> wrote:
> On Mon, May 26, 2008 at 03:13:43AM +0700, Iwan Budi Kusnanto wrote:
>> /**
>>  * this code is compiled & working in 2.4 kernel.
>>  * Compiled in 2.6 but fail in module initialization.
>>  */
>> static struct semaphore sem_fail;
>>
>> static init __init my_module_init_fail(void)
>> {
>>         sema_init (&sem_fail, 1);
>> }
>
> I forgot to say that the intended way for you to do this in 2.6 is:
>
> static DECLARE_MUTEX(sem_fail);
>
> BTW, have you considered using a struct mutex instead of a struct
> semaphore?

Yes, i have . But, maybe what i need is not binary semaphore.

Thx



-- 
Iwan Budi Kusnanto
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux