What's past is prologue.
使用宏初始化锁,文件中将会自动定义 rw_lock 变量
DEFINE_RWLOCK(rw_lock);
加锁
read_lock_bh(&rw_lock);
解锁
read_unlock_bh(&rw_lock);
write_lock_bh(&rw_lock);
write_unlock_bh(&rw_lock);