Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 67687
b: refs/heads/master
c: 55c0c4a
h: refs/heads/master
i:
  67685: 4ab7ada
  67683: ecce521
  67679: 2671dd3
v: v3
  • Loading branch information
Bob Peterson authored and Steven Whitehouse committed Oct 10, 2007
1 parent 7e47ab4 commit 18496e5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 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: d66f8277f53407754f50ae6bada68f1b68d04d48
refs/heads/master: 55c0c4ac0be144014651b19e77c9b77f367955de
20 changes: 13 additions & 7 deletions trunk/fs/gfs2/locking/dlm/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,20 +268,16 @@ static inline int check_drop(struct gdlm_ls *ls)
return 0;
}

static int gdlm_thread(void *data)
static int gdlm_thread(void *data, int blist)
{
struct gdlm_ls *ls = (struct gdlm_ls *) data;
struct gdlm_lock *lp = NULL;
int blist = 0;
uint8_t complete, blocking, submit, drop;
DECLARE_WAITQUEUE(wait, current);

/* Only thread1 is allowed to do blocking callbacks since gfs
may wait for a completion callback within a blocking cb. */

if (current == ls->thread1)
blist = 1;

while (!kthread_should_stop()) {
set_current_state(TASK_INTERRUPTIBLE);
add_wait_queue(&ls->thread_wait, &wait);
Expand Down Expand Up @@ -333,20 +329,30 @@ static int gdlm_thread(void *data)
return 0;
}

static int gdlm_thread1(void *data)
{
return gdlm_thread(data, 1);
}

static int gdlm_thread2(void *data)
{
return gdlm_thread(data, 0);
}

int gdlm_init_threads(struct gdlm_ls *ls)
{
struct task_struct *p;
int error;

p = kthread_run(gdlm_thread, ls, "lock_dlm1");
p = kthread_run(gdlm_thread1, ls, "lock_dlm1");
error = IS_ERR(p);
if (error) {
log_error("can't start lock_dlm1 thread %d", error);
return error;
}
ls->thread1 = p;

p = kthread_run(gdlm_thread, ls, "lock_dlm2");
p = kthread_run(gdlm_thread2, ls, "lock_dlm2");
error = IS_ERR(p);
if (error) {
log_error("can't start lock_dlm2 thread %d", error);
Expand Down

0 comments on commit 18496e5

Please sign in to comment.