ocfs2: use list_for_each_entry() instead of list_for_each()
[dan.carpenter@oracle.com: fix up some NULL dereference bugs] Signed-off-by: Dong Fang <yp.fangdong@gmail.com> Cc: Mark Fasheh <mfasheh@suse.com> Cc: Joel Becker <jlbec@evilplan.org> Cc: Jeff Liu <jeff.liu@oracle.com> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:

committed by
Linus Torvalds

orang tua
8dd7903e48
melakukan
df53cd3b70
@@ -91,19 +91,14 @@ void dlm_destroy_lock_cache(void)
|
||||
static int dlm_can_grant_new_lock(struct dlm_lock_resource *res,
|
||||
struct dlm_lock *lock)
|
||||
{
|
||||
struct list_head *iter;
|
||||
struct dlm_lock *tmplock;
|
||||
|
||||
list_for_each(iter, &res->granted) {
|
||||
tmplock = list_entry(iter, struct dlm_lock, list);
|
||||
|
||||
list_for_each_entry(tmplock, &res->granted, list) {
|
||||
if (!dlm_lock_compatible(tmplock->ml.type, lock->ml.type))
|
||||
return 0;
|
||||
}
|
||||
|
||||
list_for_each(iter, &res->converting) {
|
||||
tmplock = list_entry(iter, struct dlm_lock, list);
|
||||
|
||||
list_for_each_entry(tmplock, &res->converting, list) {
|
||||
if (!dlm_lock_compatible(tmplock->ml.type, lock->ml.type))
|
||||
return 0;
|
||||
if (!dlm_lock_compatible(tmplock->ml.convert_type,
|
||||
|
Reference in New Issue
Block a user