On May 24, 2013, at 9:40 PM, Ryusuke Konishi wrote:
[snip]
>>
>> +
>> +/**
>> + * nilfs_palloc_count_max_entries - count max number of entries that can be
>> + * described by descriptor blocks count
>> + * @inode: inode of metadata file using this allocator
>> + * @nused: current number of used entries
>> + * @nmaxp: max number of entries [out]
>> + */
>> +int nilfs_palloc_count_max_entries(struct inode *inode, u64 nused, u64
>> *nmaxp)
>> +{
>> + unsigned long desc_blocks = 0;
>> + u64 entries_per_desc_block, nmax;
>> + int err;
>> +
>> + err = nilfs_palloc_count_desc_blocks(inode, &desc_blocks);
>> + if (unlikely(err))
>> + return err;
>> +
>> + entries_per_desc_block = (u64)nilfs_palloc_entries_per_group(inode) *
>> + nilfs_palloc_groups_per_desc_block(inode);
>> + nmax = entries_per_desc_block * desc_blocks;
>> +
>> + if (nused == nmax &&
>> + nilfs_palloc_mdt_file_can_grow(inode, desc_blocks)) {
>> + nmax += entries_per_desc_block;
>
>> + ++desc_blocks;
>
> This increment operation seems no longer needed.
>
> There may be a check tool which catches this and warns it as a minor
> fault.
>
>
> By the way, indent location of your patch looks odd in spots.
> Doesn't your editor adjust indentation automatically?
>
> For instance, the following return statement is indented with too many
> tabs.
>
Ooops. Sorry. It simply my mistake during patch reworking. Of course, I'll
correct it.
>> + if (unlikely(err))
>> + return err;
>
Ditto. It needs to be corrected too.
>
> In the following lines, the indent location of the second argument is
> not aligned to the first argument.
>
>> +static inline bool nilfs_palloc_mdt_file_can_grow(struct inode *inode,
>> + unsigned long desc_blocks)
>
> This patch has similar more examples:
>
>> + err = nilfs_ifile_count_free_inodes(root->ifile,
>> + &nmaxinodes, &nfreeinodes);
>
> I can let two latter cases pass, but please care also about indent
> positions if possible.
>
I'll align it too.
Thank you for remarks. I'll prepare the new version of the patch with these
minor corrections.
Thanks,
Vyacheslav Dubeyko.
--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html