From: shadow Date: Sat, 24 May 2008 08:52:17 +0000 (+0000) Subject: fix liblustre build. use OBD_BRW macros instead of linux specific. X-Git-Tag: v1_8_0_110~507 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=397213bdea5f759ad65a2ee02ff9b87900db07ba;p=fs%2Flustre-release.git fix liblustre build. use OBD_BRW macros instead of linux specific. b=14010 i=green --- diff --git a/lustre/ldlm/ldlm_lock.c b/lustre/ldlm/ldlm_lock.c index b510df6..f76d547 100644 --- a/lustre/ldlm/ldlm_lock.c +++ b/lustre/ldlm/ldlm_lock.c @@ -34,7 +34,6 @@ # include #endif -#include #include #include "ldlm_internal.h" @@ -992,12 +991,13 @@ int ldlm_lock_fast_match(struct ldlm_lock *lock, int rw, loff_t start, loff_t end, void **cookie) { - LASSERT(rw == READ || rw == WRITE); + LASSERT(rw == OBD_BRW_READ || rw == OBD_BRW_WRITE); /* should LCK_GROUP be handled in a special way? */ - if (lock && (rw == READ || (lock->l_granted_mode & (LCK_PW|LCK_GROUP))) && + if (lock && (rw == OBD_BRW_READ || + (lock->l_granted_mode & (LCK_PW|LCK_GROUP))) && (lock->l_policy_data.l_extent.start <= start) && (lock->l_policy_data.l_extent.end >= end)) { - ldlm_lock_addref_internal(lock, rw == WRITE ? LCK_PW : LCK_PR); + ldlm_lock_addref_internal(lock, rw == OBD_BRW_WRITE ? LCK_PW : LCK_PR); *cookie = (void *)lock; return 1; /* avoid using rc for stack relief */ } @@ -1009,9 +1009,9 @@ void ldlm_lock_fast_release(void *cookie, int rw) struct ldlm_lock *lock = (struct ldlm_lock *)cookie; LASSERT(lock != NULL); - LASSERT(rw == READ || rw == WRITE); - LASSERT(rw == READ || (lock->l_granted_mode & (LCK_PW | LCK_GROUP))); - ldlm_lock_decref_internal(lock, rw == WRITE ? LCK_PW : LCK_PR); + LASSERT(rw == OBD_BRW_READ || rw == OBD_BRW_WRITE); + LASSERT(rw == OBD_BRW_READ || (lock->l_granted_mode & (LCK_PW | LCK_GROUP))); + ldlm_lock_decref_internal(lock, rw == OBD_BRW_WRITE ? LCK_PW : LCK_PR); } /* Can be called in two ways: diff --git a/lustre/llite/file.c b/lustre/llite/file.c index 4366c7c..4c42e52 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -1179,7 +1179,7 @@ static int ll_file_get_tree_lock_iov(struct ll_lock_tree *tree, if (file->f_flags & O_NONBLOCK) ast_flags |= LDLM_FL_BLOCK_NOWAIT; node = ll_node_from_inode(inode, start, end, - (rw == WRITE) ? LCK_PW : LCK_PR); + (rw == OBD_BRW_WRITE) ? LCK_PW : LCK_PR); if (IS_ERR(node)) { rc = PTR_ERR(node); GOTO(out, rc); @@ -1502,7 +1502,7 @@ repeat: } lock_style = ll_file_get_lock(file, *ppos, end, iov_copy, nrsegs_copy, - &cookie, &tree, READ); + &cookie, &tree, OBD_BRW_READ); if (lock_style < 0) GOTO(out, retval = lock_style); @@ -1537,7 +1537,7 @@ repeat: if (retval) { if (lock_style != LL_LOCK_STYLE_NOLOCK) ll_file_put_lock(inode, end, lock_style, - cookie, &tree, READ); + cookie, &tree, OBD_BRW_READ); goto out; } } else { @@ -1579,7 +1579,7 @@ repeat: retval = generic_file_aio_read(iocb, iov_copy, nrsegs_copy, *ppos); #endif - ll_file_put_lock(inode, end, lock_style, cookie, &tree, READ); + ll_file_put_lock(inode, end, lock_style, cookie, &tree, OBD_BRW_READ); } else { retval = ll_file_lockless_io(file, iov_copy, nrsegs_copy, ppos, READ, chunk); @@ -1722,7 +1722,7 @@ repeat: tree_locked = ll_file_get_tree_lock_iov(&tree, file, iov_copy, nrsegs_copy, lock_start, - lock_end, WRITE); + lock_end, OBD_BRW_WRITE); if (tree_locked < 0) GOTO(out, retval = tree_locked);