Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 242416
b: refs/heads/master
c: 425eb73
h: refs/heads/master
v: v3
  • Loading branch information
Fred Isaman authored and Trond Myklebust committed Mar 23, 2011
1 parent b3ebe42 commit 6c440f6
Show file tree
Hide file tree
Showing 3 changed files with 25 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: c879513e91c9e38957f0d9647d22469f1887e4da
refs/heads/master: 425eb736cd905181a4dd4dc8d66342a7c7ab2f27
22 changes: 22 additions & 0 deletions trunk/fs/nfs/nfs4filelayout.c
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,7 @@ filelayout_free_lseg(struct pnfs_layout_segment *lseg)

dprintk("--> %s\n", __func__);
nfs4_fl_put_deviceid(fl->dsaddr);
kfree(fl->commit_buckets);
_filelayout_free_lseg(fl);
}

Expand All @@ -524,6 +525,27 @@ filelayout_alloc_lseg(struct pnfs_layout_hdr *layoutid,
_filelayout_free_lseg(fl);
return NULL;
}

/* This assumes there is only one IOMODE_RW lseg. What
* we really want to do is have a layout_hdr level
* dictionary of <multipath_list4, fh> keys, each
* associated with a struct list_head, populated by calls
* to filelayout_write_pagelist().
* */
if ((!fl->commit_through_mds) && (lgr->range.iomode == IOMODE_RW)) {
int i;
int size = (fl->stripe_type == STRIPE_SPARSE) ?
fl->dsaddr->ds_num : fl->dsaddr->stripe_count;

fl->commit_buckets = kcalloc(size, sizeof(struct list_head), GFP_KERNEL);
if (!fl->commit_buckets) {
filelayout_free_lseg(&fl->generic_hdr);
return NULL;
}
fl->number_of_buckets = size;
for (i = 0; i < size; i++)
INIT_LIST_HEAD(&fl->commit_buckets[i]);
}
return &fl->generic_hdr;
}

Expand Down
2 changes: 2 additions & 0 deletions trunk/fs/nfs/nfs4filelayout.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ struct nfs4_filelayout_segment {
struct nfs4_file_layout_dsaddr *dsaddr; /* Point to GETDEVINFO data */
unsigned int num_fh;
struct nfs_fh **fh_array;
struct list_head *commit_buckets; /* Sort commits to ds */
int number_of_buckets;
};

static inline struct nfs4_filelayout_segment *
Expand Down

0 comments on commit 6c440f6

Please sign in to comment.