Re: [patch 18/19] Use page_cache_xxx for fs/xfs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 28, 2007 at 07:28:17PM -0800, Christoph Lameter wrote:
> In other words the following patch?
> Index: mm/fs/xfs/linux-2.6/xfs_aops.c
> ===================================================================
> --- mm.orig/fs/xfs/linux-2.6/xfs_aops.c	2007-11-28 19:13:13.323382722 -0800
> +++ mm/fs/xfs/linux-2.6/xfs_aops.c	2007-11-28 19:22:15.686920219 -0800
> @@ -75,7 +75,7 @@ xfs_page_trace(
>  	xfs_inode_t	*ip;
>  	bhv_vnode_t	*vp = vn_from_inode(inode);
>  	loff_t		isize = i_size_read(inode);
> -	loff_t		offset = page_cache_offset(page->mapping);
> +	loff_t		offset = page_cache_pos(page->mapping, page->index, 0);
>  	int		delalloc = -1, unmapped = -1, unwritten = -1;
>  
>  	if (page_has_buffers(page))

Good.

> @@ -780,13 +780,11 @@ xfs_convert_page(
>  	 * count of buffers on the page.
>  	 */
>  	end_offset = min_t(unsigned long long,
> -			(xfs_off_t)(page->index + 1) << page_cache_shift(map),
> +			(xfs_off_t)page_cache_pos(map, page->index + 1, 0),
>  			i_size_read(inode));
>  
>  	len = 1 << inode->i_blkbits;
> -	p_offset = min_t(unsigned long, page_cache_offset(map, end_offset),
> -					page_cache_size(map));
> -	p_offset = p_offset ? roundup(p_offset, len) : page_cache_size(map);
> +	p_offset = page_cache_offset(map, end_offset);

No, still need the roundup. i.e.:

-	p_offset = min_t(unsigned long, page_cache_offset(map, end_offset),
-					page_cache_size(map));
+	p_offset = page_cache_offset(map, end_offset);
	p_offset = p_offset ? roundup(p_offset, len) : page_cache_size(map);

>  	page_dirty = p_offset / len;
>  
>  	bh = head = page_buffers(page);
> @@ -943,7 +941,6 @@ xfs_page_state_convert(
>  	int			trylock = 0;
>  	int			all_bh = unmapped;
>  	struct address_space	*map = inode->i_mapping;
> -	int			pagesize = page_cache_size(map);
>  
>  	if (startio) {
>  		if (wbc->sync_mode == WB_SYNC_NONE && wbc->nonblocking)
> @@ -979,9 +976,7 @@ xfs_page_state_convert(
>  	end_offset = min_t(unsigned long long,
>  			(xfs_off_t)page_cache_pos(map, page->index + 1, 0), offset);
>  	len = 1 << inode->i_blkbits;
> -	p_offset = min_t(unsigned long, page_cache_offset(map, end_offset),
> -					pagesize);
> -	p_offset = p_offset ? roundup(p_offset, len) : pagesize;
> +	p_offset = page_cache_offset(map, end_offset);

And still need the roundup here as well.

>  	page_dirty = p_offset / len;
>  
>  	bh = head = page_buffers(page);
> @@ -1132,8 +1127,8 @@ xfs_page_state_convert(
>  		xfs_start_page_writeback(page, wbc, 1, count);
>  
>  	if (ioend && iomap_valid) {
> -		offset = (iomap.iomap_offset + iomap.iomap_bsize - 1) >>
> -					page_cache_shift(map);
> +		offset = page_cache_index(map,
> +			(iomap.iomap_offset + iomap.iomap_bsize - 1));

Good.

>  		tlast = min_t(pgoff_t, offset, last_index);
>  		xfs_cluster_write(inode, page->index + 1, &iomap, &ioend,
>  					wbc, startio, all_bh, tlast);
> Index: mm/fs/xfs/linux-2.6/xfs_lrw.c
> ===================================================================
> --- mm.orig/fs/xfs/linux-2.6/xfs_lrw.c	2007-11-28 19:22:35.454383115 -0800
> +++ mm/fs/xfs/linux-2.6/xfs_lrw.c	2007-11-28 19:22:59.222132796 -0800
> @@ -142,7 +142,7 @@ xfs_iozero(
>  		unsigned offset, bytes;
>  		void *fsdata;
>  
> -		offset = page_cache_offset(mapping, pos); /* Within page */
> +		offset = page_cache_offset(mapping, pos);

Ok.

Cheers,

Dave.
-- 
Dave Chinner
Principal Engineer
SGI Australian Software Group
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux