Hi,
Is that mean instead of locking the module with a global variable like
in status = 0;
open()
{
if(status) return -EBUSY;
status++;
...........
some codes
........
}
release()
{
status--;
......some codes......
}
can i replace the if(status) return -EBUSY; status++;
with try_module_get(THIS_MODULE);
and status--; with module_put(THIS_MODULE);
. am i correct. please correct me if my understanding was wrong.
-
Best Regards,
Mohamed Thalib .H
On Fri, 2008-06-13 at 08:26 +0300, Daniel Baluta wrote:
> On Fri, Jun 13, 2008 at 7:19 AM, Mohamed Thalib .H
> <[EMAIL PROTECTED]> wrote:
> > Hi ,,
> >
> > can any one please help me in understanding the folowing function.
> >
> >
> > try_module_get(THIS_MODULE)
> > module_put(THIS_MODULE)
> >
> > -
> > Best Regards,
> > Mohamed Thalib .H
> >
> > --
> > To unsubscribe from this list: send an email with
> > "unsubscribe kernelnewbies" to [EMAIL PROTECTED]
> > Please read the FAQ at http://kernelnewbies.org/FAQ
> >
> >
>
> http://www.aoc.nrao.edu/~tjuerges/ALMA/Kernel/kernel-hacking/ch06s13.html
>
> --
> To unsubscribe from this list: send an email with
> "unsubscribe kernelnewbies" to [EMAIL PROTECTED]
> Please read the FAQ at http://kernelnewbies.org/FAQ
>
--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to [EMAIL PROTECTED]
Please read the FAQ at http://kernelnewbies.org/FAQ