/* * trylock for writing -- returns 1 if successful, 0 if contention */ int down_write_trylock(struct rw_semaphore *sem) { int ret = __down_write_trylock(sem); if (ret == 1) rwsem_acquire(&sem->dep_map, 0, 1, _RET_IP_); return ret; }
int down_write_trylock_nested(struct rw_semaphore *sem, int subclass) { int ret = __down_write_trylock(sem); if (ret == 1) rwsem_acquire(&sem->dep_map, subclass, 1, _RET_IP_); return ret; }