Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 54465
b: refs/heads/master
c: ce03f12
h: refs/heads/master
i:
  54463: 4147868
v: v3
  • Loading branch information
David Teigland authored and Steven Whitehouse committed May 1, 2007
1 parent 3cd3854 commit f9297ae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 72c2be776bd6eec5186e316e6d9dd4aab78d314d
refs/heads/master: ce03f12b37c0bd81ad707d3642241cc55c944711
8 changes: 4 additions & 4 deletions trunk/fs/dlm/lock.c
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ static int create_lkb(struct dlm_ls *ls, struct dlm_lkb **lkb_ret)
/* counter can roll over so we must verify lkid is not in use */

while (lkid == 0) {
lkid = bucket | (ls->ls_lkbtbl[bucket].counter++ << 16);
lkid = (bucket << 16) | ls->ls_lkbtbl[bucket].counter++;

list_for_each_entry(tmp, &ls->ls_lkbtbl[bucket].list,
lkb_idtbl_list) {
Expand All @@ -601,8 +601,8 @@ static int create_lkb(struct dlm_ls *ls, struct dlm_lkb **lkb_ret)

static struct dlm_lkb *__find_lkb(struct dlm_ls *ls, uint32_t lkid)
{
uint16_t bucket = lkid & 0xFFFF;
struct dlm_lkb *lkb;
uint16_t bucket = (lkid >> 16);

list_for_each_entry(lkb, &ls->ls_lkbtbl[bucket].list, lkb_idtbl_list) {
if (lkb->lkb_id == lkid)
Expand All @@ -614,7 +614,7 @@ static struct dlm_lkb *__find_lkb(struct dlm_ls *ls, uint32_t lkid)
static int find_lkb(struct dlm_ls *ls, uint32_t lkid, struct dlm_lkb **lkb_ret)
{
struct dlm_lkb *lkb;
uint16_t bucket = lkid & 0xFFFF;
uint16_t bucket = (lkid >> 16);

if (bucket >= ls->ls_lkbtbl_size)
return -EBADSLT;
Expand Down Expand Up @@ -644,7 +644,7 @@ static void kill_lkb(struct kref *kref)

static int __put_lkb(struct dlm_ls *ls, struct dlm_lkb *lkb)
{
uint16_t bucket = lkb->lkb_id & 0xFFFF;
uint16_t bucket = (lkb->lkb_id >> 16);

write_lock(&ls->ls_lkbtbl[bucket].lock);
if (kref_put(&lkb->lkb_ref, kill_lkb)) {
Expand Down

0 comments on commit f9297ae

Please sign in to comment.