Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 69455
b: refs/heads/master
c: 094f282
h: refs/heads/master
i:
  69453: 6d27591
  69451: f02bfcc
  69447: 03c63e5
  69439: ab9c91a
v: v3
  • Loading branch information
Matthias Kaehlcke authored and J. Bruce Fields committed Oct 9, 2007
1 parent 45c645c commit 587dfc1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 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: dfad9441be82f1eadc3fa3f1bbc93f93d48d1bdf
refs/heads/master: 094f2825218fec1b240cb8537d2d0a10edf5ddc9
17 changes: 7 additions & 10 deletions trunk/fs/locks.c
Original file line number Diff line number Diff line change
Expand Up @@ -700,13 +700,12 @@ EXPORT_SYMBOL(posix_test_lock);
static int posix_locks_deadlock(struct file_lock *caller_fl,
struct file_lock *block_fl)
{
struct list_head *tmp;
struct file_lock *fl;

next_task:
if (posix_same_owner(caller_fl, block_fl))
return 1;
list_for_each(tmp, &blocked_list) {
struct file_lock *fl = list_entry(tmp, struct file_lock, fl_link);
list_for_each_entry(fl, &blocked_list, fl_link) {
if (posix_same_owner(fl, block_fl)) {
fl = fl->fl_next;
block_fl = fl;
Expand Down Expand Up @@ -2164,24 +2163,22 @@ static void move_lock_status(char **p, off_t* pos, off_t offset)

int get_locks_status(char *buffer, char **start, off_t offset, int length)
{
struct list_head *tmp;
struct file_lock *fl;
char *q = buffer;
off_t pos = 0;
int i = 0;

lock_kernel();
list_for_each(tmp, &file_lock_list) {
struct list_head *btmp;
struct file_lock *fl = list_entry(tmp, struct file_lock, fl_link);
list_for_each_entry(fl, &file_lock_list, fl_link) {
struct file_lock *bfl;

lock_get_status(q, fl, ++i, "");
move_lock_status(&q, &pos, offset);

if(pos >= offset+length)
goto done;

list_for_each(btmp, &fl->fl_block) {
struct file_lock *bfl = list_entry(btmp,
struct file_lock, fl_block);
list_for_each_entry(bfl, &fl->fl_block, fl_block) {
lock_get_status(q, bfl, i, " ->");
move_lock_status(&q, &pos, offset);

Expand Down

0 comments on commit 587dfc1

Please sign in to comment.