On Tue, 19 May 2009, Yakoob, M. Kazi M. wrote:
> Hi
>
>
> I have read the highlighted code. But I don't understand some part of code.
> Like highlighted one
>
>
> 1. struct disk_stats
> 2. *sdi = st_disk[curr],
> 3. @@ *sdj;
>
>
Hi Yakoob:
The code should read as
struct disk_stats *sdi = st_disk[curr];
struct disk_stats *sdj;
where disk_stats is declared at line 415 in "sa.h" file
struct disk_stats {
unsigned long long rd_sect __attribute__ ((aligned (16)));
unsigned long long wr_sect __attribute__ ((aligned (16)));
unsigned long rd_ticks __attribute__ ((aligned (16)));
unsigned long wr_ticks __attribute__ ((aligned (8)));
unsigned long tot_ticks __attribute__ ((aligned (8)));
unsigned long rq_ticks __attribute__ ((aligned (8)));
unsigned long nr_ios __attribute__ ((aligned (8)));
unsigned int major __attribute__ ((aligned (8)));
unsigned int minor __attribute__ ((packed));
};
The __attribute__ is not ANSI and perhaps the gcc compiler
extension. There should be a better way.
Please ignore the '@@' as that was the highlighting code, it has
nothing to do with actual code.
thanks
Saifi.