diff options
author | Fred Isaman <iisaman@citi.umich.edu> | 2011-07-31 04:52:41 +0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-07-31 20:18:16 +0400 |
commit | 9e69296999362c4e4b2821b64389b47e86e4821b (patch) | |
tree | e8810b4207cc054086eaeb519aa53d2af621ff0d /fs/nfs/blocklayout/blocklayout.c | |
parent | e9643fe80d1a1e0ad6acdf43138c39b5709fdbbe (diff) | |
download | linux-9e69296999362c4e4b2821b64389b47e86e4821b.tar.xz |
pnfsblock: basic extent code
Adds structures and basic create/delete code for extents.
Signed-off-by: Fred Isaman <iisaman@citi.umich.edu>
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: Zhang Jingwang <Jingwang.Zhang@emc.com>
Signed-off-by: Benny Halevy <bhalevy@tonian.com>
Signed-off-by: Jim Rees <rees@umich.edu>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/blocklayout/blocklayout.c')
-rw-r--r-- | fs/nfs/blocklayout/blocklayout.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/fs/nfs/blocklayout/blocklayout.c b/fs/nfs/blocklayout/blocklayout.c index 1f5287c2230a..8dde3723482e 100644 --- a/fs/nfs/blocklayout/blocklayout.c +++ b/fs/nfs/blocklayout/blocklayout.c @@ -53,12 +53,24 @@ bl_write_pagelist(struct nfs_write_data *wdata, return PNFS_NOT_ATTEMPTED; } -/* STUB */ +/* FIXME - range ignored */ static void -release_extents(struct pnfs_block_layout *bl, - struct pnfs_layout_range *range) +release_extents(struct pnfs_block_layout *bl, struct pnfs_layout_range *range) { - return; + int i; + struct pnfs_block_extent *be; + + spin_lock(&bl->bl_ext_lock); + for (i = 0; i < EXTENT_LISTS; i++) { + while (!list_empty(&bl->bl_extents[i])) { + be = list_first_entry(&bl->bl_extents[i], + struct pnfs_block_extent, + be_node); + list_del(&be->be_node); + bl_put_extent(be); + } + } + spin_unlock(&bl->bl_ext_lock); } /* STUB */ |