Re: [PATCH 4/8 ver5] exofs: address_space_operations

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

 



On 03/31/2009 11:04 AM, Andrew Morton wrote:
> On Sun, 22 Mar 2009 15:58:46 +0200 Boaz Harrosh <bharrosh@xxxxxxxxxxx> wrote:
> 
>> OK Now we start to read and write from osd-objects. We try to
>> collect at most contiguous pages as possible in a single write/read.
>> The first page index is the object's offset.
>>
>> TODO:
>>    In 64-bit a single bio can carry at most 128 pages.
>>    Add support of chaining multiple bios
>>
>>
>> ...
>>
>> +static int write_exec(struct page_collect *pcol)
>> +{
>> +	struct exofs_i_info *oi = exofs_i(pcol->inode);
>> +	struct osd_obj_id obj = {pcol->sbi->s_pid,
>> +					pcol->inode->i_ino + EXOFS_OBJ_OFF};
>> +	struct osd_request *or = NULL;
>> +	struct page_collect *pcol_copy = NULL;
>> +	loff_t i_start = pcol->pg_first << PAGE_CACHE_SHIFT;
> 
> bug.  On 32-bit this shift will overflow prior to getting promoted to
> 64-bit.  Do:
> 
> 	loff_t i_start = (loff_t)pcol->pg_first << PAGE_CACHE_SHIFT;
> 

In that case I might make pcol->pg_first loff_t.

Why is inode->i_index not an loff_t then?
Page-index <=> byte-offset, is done all the time 12 bits does not
make a difference.

>> ...
>>
>> +static int writepage_strip(struct page *page,
>> +			   struct writeback_control *wbc_unused, void *data)
> 
> Some of these functions could do with some comments explaining why they exist.
> 
>> +	struct page_collect *pcol = data;
>> +	struct inode *inode = pcol->inode;
>> +	struct exofs_i_info *oi = exofs_i(inode);
>> +	loff_t i_size = i_size_read(inode);
>> +	pgoff_t end_index = i_size >> PAGE_CACHE_SHIFT;
>> +	size_t len;
>> +	int ret;
>> +
>>
>> ...
>>
> 

Thanks
Boaz
--
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