aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/ops_vm.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-06-14 15:32:57 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2006-06-14 15:32:57 -0400
commitfeaa7bba026c181ce071d5a4884f7f9dd26207a1 (patch)
treec858deb225917265cb07820730e9764674d133e8 /fs/gfs2/ops_vm.c
parent22da645fd6675b7abc55cf937ddf6132f343e5b9 (diff)
[GFS2] Fix unlinked file handling
This patch fixes the way we have been dealing with unlinked, but still open files. It removes all limits (other than memory for inodes, as per every other filesystem) on numbers of these which we can support on GFS2. It also means that (like other fs) its the responsibility of the last process to close the file to deallocate the storage, rather than the person who did the unlinking. Note that with GFS2, those two events might take place on different nodes. Also there are a number of other changes: o We use the Linux inode subsystem as it was intended to be used, wrt allocating GFS2 inodes o The Linux inode cache is now the point which we use for local enforcement of only holding one copy of the inode in core at once (previous to this we used the glock layer). o We no longer use the unlinked "special" file. We just ignore it completely. This makes unlinking more efficient. o We now use the 4th block allocation state. The previously unused state is used to track unlinked but still open inodes. o gfs2_inoded is no longer needed o Several fields are now no longer needed (and removed) from the in core struct gfs2_inode o Several fields are no longer needed (and removed) from the in core superblock There are a number of future possible optimisations and clean ups which have been made possible by this patch. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/ops_vm.c')
-rw-r--r--fs/gfs2/ops_vm.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/gfs2/ops_vm.c b/fs/gfs2/ops_vm.c
index 263c1fb7bbaf..08709f19ea98 100644
--- a/fs/gfs2/ops_vm.c
+++ b/fs/gfs2/ops_vm.c
@@ -38,15 +38,15 @@ static void pfault_be_greedy(struct gfs2_inode *ip)
38 ip->i_last_pfault = jiffies; 38 ip->i_last_pfault = jiffies;
39 spin_unlock(&ip->i_spin); 39 spin_unlock(&ip->i_spin);
40 40
41 gfs2_inode_hold(ip); 41 igrab(&ip->i_inode);
42 if (gfs2_glock_be_greedy(ip->i_gl, time)) 42 if (gfs2_glock_be_greedy(ip->i_gl, time))
43 gfs2_inode_put(ip); 43 iput(&ip->i_inode);
44} 44}
45 45
46static struct page *gfs2_private_nopage(struct vm_area_struct *area, 46static struct page *gfs2_private_nopage(struct vm_area_struct *area,
47 unsigned long address, int *type) 47 unsigned long address, int *type)
48{ 48{
49 struct gfs2_inode *ip = area->vm_file->f_mapping->host->u.generic_ip; 49 struct gfs2_inode *ip = GFS2_I(area->vm_file->f_mapping->host);
50 struct gfs2_holder i_gh; 50 struct gfs2_holder i_gh;
51 struct page *result; 51 struct page *result;
52 int error; 52 int error;
@@ -69,7 +69,7 @@ static struct page *gfs2_private_nopage(struct vm_area_struct *area,
69 69
70static int alloc_page_backing(struct gfs2_inode *ip, struct page *page) 70static int alloc_page_backing(struct gfs2_inode *ip, struct page *page)
71{ 71{
72 struct gfs2_sbd *sdp = ip->i_sbd; 72 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
73 unsigned long index = page->index; 73 unsigned long index = page->index;
74 uint64_t lblock = index << (PAGE_CACHE_SHIFT - 74 uint64_t lblock = index << (PAGE_CACHE_SHIFT -
75 sdp->sd_sb.sb_bsize_shift); 75 sdp->sd_sb.sb_bsize_shift);
@@ -114,7 +114,7 @@ static int alloc_page_backing(struct gfs2_inode *ip, struct page *page)
114 unsigned int extlen; 114 unsigned int extlen;
115 int new = 1; 115 int new = 1;
116 116
117 error = gfs2_extent_map(ip->i_vnode, lblock, &new, &dblock, &extlen); 117 error = gfs2_extent_map(&ip->i_inode, lblock, &new, &dblock, &extlen);
118 if (error) 118 if (error)
119 goto out_trans; 119 goto out_trans;
120 120
@@ -142,7 +142,7 @@ static int alloc_page_backing(struct gfs2_inode *ip, struct page *page)
142static struct page *gfs2_sharewrite_nopage(struct vm_area_struct *area, 142static struct page *gfs2_sharewrite_nopage(struct vm_area_struct *area,
143 unsigned long address, int *type) 143 unsigned long address, int *type)
144{ 144{
145 struct gfs2_inode *ip = area->vm_file->f_mapping->host->u.generic_ip; 145 struct gfs2_inode *ip = GFS2_I(area->vm_file->f_mapping->host);
146 struct gfs2_holder i_gh; 146 struct gfs2_holder i_gh;
147 struct page *result = NULL; 147 struct page *result = NULL;
148 unsigned long index = ((address - area->vm_start) >> PAGE_CACHE_SHIFT) + 148 unsigned long index = ((address - area->vm_start) >> PAGE_CACHE_SHIFT) +