Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 77916
b: refs/heads/master
c: 7b75106
h: refs/heads/master
v: v3
  • Loading branch information
Mingming Cao authored and Theodore Ts'o committed Jan 29, 2008
1 parent cf0cc60 commit 2c34f1d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b939e3766ec19eb556cb784c2faace253c6e1560
refs/heads/master: 7b7510662f4d05ddcc45d435769860e73e6aa20e
11 changes: 11 additions & 0 deletions trunk/fs/jbd2/transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ static int start_this_handle(journal_t *journal, handle_t *handle)
return ret;
}

static struct lock_class_key jbd2_handle_key;

/* Allocate a new handle. This should probably be in a slab... */
static handle_t *new_handle(int nblocks)
{
Expand All @@ -251,6 +253,9 @@ static handle_t *new_handle(int nblocks)
handle->h_buffer_credits = nblocks;
handle->h_ref = 1;

lockdep_init_map(&handle->h_lockdep_map, "jbd2_handle",
&jbd2_handle_key, 0);

return handle;
}

Expand Down Expand Up @@ -293,7 +298,11 @@ handle_t *jbd2_journal_start(journal_t *journal, int nblocks)
jbd2_free_handle(handle);
current->journal_info = NULL;
handle = ERR_PTR(err);
goto out;
}

lock_acquire(&handle->h_lockdep_map, 0, 0, 0, 2, _THIS_IP_);
out:
return handle;
}

Expand Down Expand Up @@ -1419,6 +1428,8 @@ int jbd2_journal_stop(handle_t *handle)
spin_unlock(&journal->j_state_lock);
}

lock_release(&handle->h_lockdep_map, 1, _THIS_IP_);

jbd2_free_handle(handle);
return err;
}
Expand Down
4 changes: 4 additions & 0 deletions trunk/include/linux/jbd2.h
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,10 @@ struct handle_s
unsigned int h_sync: 1; /* sync-on-close */
unsigned int h_jdata: 1; /* force data journaling */
unsigned int h_aborted: 1; /* fatal error on handle */

#ifdef CONFIG_DEBUG_LOCK_ALLOC
struct lockdep_map h_lockdep_map;
#endif
};


Expand Down

0 comments on commit 2c34f1d

Please sign in to comment.