Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 30084
b: refs/heads/master
c: 0d0b5cb
h: refs/heads/master
v: v3
  • Loading branch information
Chuck Lever authored and Trond Myklebust committed Jun 9, 2006
1 parent 4077d04 commit d1dd4f1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 21 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: bf3fcf89552f24657bcfb6a9d73cd167ebb496c6
refs/heads/master: 0d0b5cb36faf7002a11736032313f06d6f3d881c
11 changes: 4 additions & 7 deletions trunk/fs/nfs/read.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,11 @@ struct nfs_read_data *nfs_readdata_alloc(unsigned int pagecount)
if (p) {
memset(p, 0, sizeof(*p));
INIT_LIST_HEAD(&p->pages);
if (pagecount < NFS_PAGEVEC_SIZE)
p->pagevec = &p->page_array[0];
if (pagecount <= ARRAY_SIZE(p->page_array))
p->pagevec = p->page_array;
else {
size_t size = ++pagecount * sizeof(struct page *);
p->pagevec = kmalloc(size, GFP_NOFS);
if (p->pagevec) {
memset(p->pagevec, 0, size);
} else {
p->pagevec = kcalloc(pagecount, sizeof(struct page *), GFP_NOFS);
if (!p->pagevec) {
mempool_free(p, nfs_rdata_mempool);
p = NULL;
}
Expand Down
18 changes: 7 additions & 11 deletions trunk/fs/nfs/write.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,10 @@ struct nfs_write_data *nfs_commit_alloc(unsigned int pagecount)
if (p) {
memset(p, 0, sizeof(*p));
INIT_LIST_HEAD(&p->pages);
if (pagecount < NFS_PAGEVEC_SIZE)
p->pagevec = &p->page_array[0];
if (pagecount <= ARRAY_SIZE(p->page_array))
p->pagevec = p->page_array;
else {
size_t size = ++pagecount * sizeof(struct page *);
p->pagevec = kzalloc(size, GFP_NOFS);
p->pagevec = kcalloc(pagecount, sizeof(struct page *), GFP_NOFS);
if (!p->pagevec) {
mempool_free(p, nfs_commit_mempool);
p = NULL;
Expand All @@ -126,14 +125,11 @@ struct nfs_write_data *nfs_writedata_alloc(unsigned int pagecount)
if (p) {
memset(p, 0, sizeof(*p));
INIT_LIST_HEAD(&p->pages);
if (pagecount < NFS_PAGEVEC_SIZE)
p->pagevec = &p->page_array[0];
if (pagecount <= ARRAY_SIZE(p->page_array))
p->pagevec = p->page_array;
else {
size_t size = ++pagecount * sizeof(struct page *);
p->pagevec = kmalloc(size, GFP_NOFS);
if (p->pagevec) {
memset(p->pagevec, 0, size);
} else {
p->pagevec = kcalloc(pagecount, sizeof(struct page *), GFP_NOFS);
if (!p->pagevec) {
mempool_free(p, nfs_wdata_mempool);
p = NULL;
}
Expand Down
4 changes: 2 additions & 2 deletions trunk/include/linux/nfs_xdr.h
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ struct nfs_read_data {
#ifdef CONFIG_NFS_V4
unsigned long timestamp; /* For lease renewal */
#endif
struct page *page_array[NFS_PAGEVEC_SIZE + 1];
struct page *page_array[NFS_PAGEVEC_SIZE];
};

struct nfs_write_data {
Expand All @@ -712,7 +712,7 @@ struct nfs_write_data {
#ifdef CONFIG_NFS_V4
unsigned long timestamp; /* For lease renewal */
#endif
struct page *page_array[NFS_PAGEVEC_SIZE + 1];
struct page *page_array[NFS_PAGEVEC_SIZE];
};

struct nfs_access_entry;
Expand Down

0 comments on commit d1dd4f1

Please sign in to comment.