]> err.no Git - linux-2.6/commitdiff
[GFS2] Remove unused zero_readpage from stuffed_readpage
authorRussell Cattelan <cattelan@redhat.com>
Thu, 9 Nov 2006 16:42:33 +0000 (11:42 -0500)
committerSteven Whitehouse <swhiteho@redhat.com>
Thu, 30 Nov 2006 15:34:57 +0000 (10:34 -0500)
Stuffed files only consist of a maximum of
(gfs2 block size - sizeof(struct gfs2_dinode)) bytes. Since the
gfs2 block size is always less than page size, we will never see
a call to stuffed_readpage for anything other than the first page
in the file.

Signed-off-by: Russell Cattelan <cattelan@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
fs/gfs2/ops_address.c

index 3822189454a30e75be8f6d64497725afa31ad945..2f7ef980d029b871c8263681fe09dda6e716dab4 100644 (file)
@@ -156,19 +156,6 @@ out_ignore:
        return 0;
 }
 
-static int zero_readpage(struct page *page)
-{
-       void *kaddr;
-
-       kaddr = kmap_atomic(page, KM_USER0);
-       memset(kaddr, 0, PAGE_CACHE_SIZE);
-       kunmap_atomic(kaddr, KM_USER0);
-
-       SetPageUptodate(page);
-
-       return 0;
-}
-
 /**
  * stuffed_readpage - Fill in a Linux page with stuffed file data
  * @ip: the inode
@@ -183,9 +170,7 @@ static int stuffed_readpage(struct gfs2_inode *ip, struct page *page)
        void *kaddr;
        int error;
 
-       /* Only the first page of a stuffed file might contain data */
-       if (unlikely(page->index))
-               return zero_readpage(page);
+       BUG_ON(page->index);
 
        error = gfs2_meta_inode_buffer(ip, &dibh);
        if (error)
@@ -737,6 +722,9 @@ int gfs2_releasepage(struct page *page, gfp_t gfp_mask)
                        if (!atomic_read(&aspace->i_writecount))
                                return 0;
 
+                       if (!(gfp_mask & __GFP_WAIT))
+                               return 0;
+
                        if (time_after_eq(jiffies, t)) {
                                stuck_releasepage(bh);
                                /* should we withdraw here? */