Fwd: [Milkymist-devel] [PATCH] imfs: give a default value to st_blksize

Joel Sherrill joel.sherrill at OARcorp.com
Fri Jun 3 16:33:38 UTC 2011


That is wrong. There is a variable produced by confdefs which is the block size. It can vary.  Not device dependent for imfs but definitely not always 1K

--joel

Ralf Corsepius <ralf.corsepius at rtems.org> wrote:

>On 06/01/2011 05:19 PM, Sebastien Bourdeauducq wrote:
>> -------- Forwarded Message --------
>> From: Xiangfu Liu<xiangfu at sharism.cc>
>> Reply-to: "Milkymist One, Milkymist SoC and Flickernoise developers'
>> list"<devel at lists.milkymist.org>
>> To: devel at lists.milkymist.org
>> Subject: [Milkymist-devel] [PATCH] imfs: give a default value to
>> st_blksize
>> Date: Tue, 31 May 2011 22:55:02 +0800
>>
>> ---
>>   cpukit/libfs/src/imfs/imfs_stat.c |    7 +++++++
>>   1 files changed, 7 insertions(+), 0 deletions(-)
>>
>> Hi Sebastien
>>    this patch fix https://github.com/milkymist/bugs/issues/17.
>>
>>
>> diff --git a/cpukit/libfs/src/imfs/imfs_stat.c b/cpukit/libfs/src/imfs/imfs_stat.c
>> index fa9a5c2..eb6e62e 100644
>> --- a/cpukit/libfs/src/imfs/imfs_stat.c
>> +++ b/cpukit/libfs/src/imfs/imfs_stat.c
>> @@ -77,5 +77,12 @@ int IMFS_stat(
>>     buf->st_mtime = the_jnode->stat_mtime;
>>     buf->st_ctime = the_jnode->stat_ctime;
>>
>> +  /*
>> +   * Give a default value to st_blksize, when 'mv' file from imfs to other fs
>> +   * st_blksize == 0 will cause problem, like: there is malloc in 'mv' base on
>> +   * st_blksize
>> +   */
>> +  buf->st_blksize = 1024;
>> +
>>     return 0;
>>   }
>
>This patch can't be correct. The blksize is a device's feature and 
>therefore needs to queried from the device.
>
>Unfortunately, I am not sufficiently familiar with the imfs to provide a 
>better proposal.
>
>Ralf
>
>_______________________________________________
>rtems-users mailing list
>rtems-users at rtems.org
>http://www.rtems.org/mailman/listinfo/rtems-users




More information about the users mailing list