Re: [PATCH 29/30] microblaze_mmu_v1: stat.h MMU update

Michal Simek
2009-04-27T11:43:56Z

Christoph Hellwig wrote:
> On Mon, Apr 27, 2009 at 12:35:51PM +0200, Michal Simek wrote:
>> types and I would like to know about more info.
>> For example
>> If make sense long long type for st_blocks. IMHO unsigned will be better.
>> And I would like to create new stat64 structure where is not a fault for both noMMU/MMU version.
>> In noMMU implementation is st_blocks unsigned long. Is it OK? or unsigned long long is better?
>
> You want unsigned long long for it. Take a look at e.g. the xtensa
> stat.h and just reuse that one. We should probaly create an
> asm-generic/stat.h that new architectures can simply use..
>
> Given that microblaze only got merged in the 2.6.30 window I would
> suggest fixing up the nommu variant.

ok. Let's do it.
Here are stats structures from xtensa.

Arnd: Is it ok for asm-generic?

Thanks,
Michal

#ifndef _XTENSA_STAT_H
#define _XTENSA_STAT_H

#define STAT_HAVE_NSEC 1

struct stat {
unsigned long st_dev;
unsigned long st_ino;
unsigned int st_mode;
unsigned int st_nlink;
unsigned int st_uid;
unsigned int st_gid;
unsigned long st_rdev;
long st_size;
unsigned long st_blksize;
unsigned long st_blocks;
unsigned long st_atime;
unsigned long st_atime_nsec;
unsigned long st_mtime;
unsigned long st_mtime_nsec;
unsigned long st_ctime;
unsigned long st_ctime_nsec;
unsigned long __unused4;
unsigned long __unused5;
};

struct stat64 {
unsigned long long st_dev; /* Device */
unsigned long long st_ino; /* File serial number */
unsigned int st_mode; /* File mode. */
unsigned int st_nlink; /* Link count. */
unsigned int st_uid; /* User ID of the file's owner. */
unsigned int st_gid; /* Group ID of the file's group. */
unsigned long long st_rdev; /* Device number, if device. */
long long st_size; /* Size of file, in bytes. */
unsigned long st_blksize; /* Optimal block size for I/O. */
unsigned long __unused2;
unsigned long long st_blocks; /* Number 512-byte blocks allocated. */
unsigned long st_atime; /* Time of last access. */
unsigned long st_atime_nsec;
unsigned long st_mtime; /* Time of last modification. */
unsigned long st_mtime_nsec;
unsigned long st_ctime; /* Time of last status change. */
unsigned long st_ctime_nsec;
unsigned long __unused4;
unsigned long __unused5;
};

--
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854