Skip to content

Commit

Permalink
NFS: Debugging code for nfs_direct_(read|write)_schedule()
Browse files Browse the repository at this point in the history
Make sure that we're doing our list accounting correctly.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Mar 20, 2006
1 parent a8881f5 commit 5db3a7b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fs/nfs/direct.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ static void nfs_direct_read_schedule(struct nfs_direct_req *dreq)
if (count < rsize)
bytes = count;

BUG_ON(list_empty(list));
data = list_entry(list->next, struct nfs_read_data, pages);
list_del_init(&data->pages);

Expand Down Expand Up @@ -378,6 +379,7 @@ static void nfs_direct_read_schedule(struct nfs_direct_req *dreq)

count -= bytes;
} while (count != 0);
BUG_ON(!list_empty(list));
}

static ssize_t nfs_direct_read(struct kiocb *iocb, unsigned long user_addr, size_t count, loff_t pos, struct page **pages, unsigned int nr_pages)
Expand Down Expand Up @@ -657,6 +659,7 @@ static void nfs_direct_write_schedule(struct nfs_direct_req *dreq, int sync)
if (count < wsize)
bytes = count;

BUG_ON(list_empty(list));
data = list_entry(list->next, struct nfs_write_data, pages);
list_move_tail(&data->pages, &dreq->rewrite_list);

Expand Down Expand Up @@ -697,6 +700,7 @@ static void nfs_direct_write_schedule(struct nfs_direct_req *dreq, int sync)

count -= bytes;
} while (count != 0);
BUG_ON(!list_empty(list));
}

static ssize_t nfs_direct_write(struct kiocb *iocb, unsigned long user_addr, size_t count, loff_t pos, struct page **pages, int nr_pages)
Expand Down

0 comments on commit 5db3a7b

Please sign in to comment.