Hello!

> The following piece of code is from the unregister_netdevice() function.
> I would like to know why no read_lock is acquired when looping thru the
> list. 

Because there is another lock, which is acquired by caller and
prohibits modification of the list by anyone but this process.


> or why the write_lock isn't acquired before the start of the loop.

Because it will stop all the network, when you have enough of devices.
It is not necessary while semaphore is used.

> Also i'd greatly appreciate if someone can explain the differences between
> write_lock() and write_lock_bh().

It prevents reentry from BHs, which could try to get read_lock
and dead lock.


Alexey Kuznetsov
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]

Reply via email to