Commit 70902864 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] (1/5) beginning of getattr series.

	added new helpers - vfs_stat(), vfs_lstat() and vfs_fstat().
	fs/stat.c switched to use them.

Following patches will

	stat(2) variants in arch/* that used to copy inode fields manually
	switched to vfs_*stat() and partially cleaned up

	irix_...() switched from sys_new*stat() to vfs_*stat() and cleaned
	up.  Missing LFS check added.

	similar for solaris ones

	ditto for x86 compatibility ones on ia64.

We are almost ready to switch to ->getattr() - let filesystem decide what
values should go into ->st_... (e.g. for CODA life would become much
easier if it could just use ->i_size of caching file, for supermount
we want ->i_ino inherited from underlying fs, etc.)

Another thing that needs to be done is fixing the rest of LFS/uid size
fsckups in architecture-specific variants of stat() - I've fixed several,
but quite a few are still there.
parent 4b64f8f0
This diff is collapsed.
...@@ -1475,6 +1475,10 @@ extern struct inode_operations page_symlink_inode_operations; ...@@ -1475,6 +1475,10 @@ extern struct inode_operations page_symlink_inode_operations;
extern int vfs_readdir(struct file *, filldir_t, void *); extern int vfs_readdir(struct file *, filldir_t, void *);
extern int dcache_readdir(struct file *, void *, filldir_t); extern int dcache_readdir(struct file *, void *, filldir_t);
extern int vfs_stat(char *, struct kstat *);
extern int vfs_lstat(char *, struct kstat *);
extern int vfs_fstat(unsigned int, struct kstat *);
extern struct file_system_type *get_fs_type(const char *name); extern struct file_system_type *get_fs_type(const char *name);
extern struct super_block *get_super(kdev_t); extern struct super_block *get_super(kdev_t);
extern void drop_super(struct super_block *sb); extern void drop_super(struct super_block *sb);
......
...@@ -52,6 +52,25 @@ ...@@ -52,6 +52,25 @@
#define S_IRUGO (S_IRUSR|S_IRGRP|S_IROTH) #define S_IRUGO (S_IRUSR|S_IRGRP|S_IROTH)
#define S_IWUGO (S_IWUSR|S_IWGRP|S_IWOTH) #define S_IWUGO (S_IWUSR|S_IWGRP|S_IWOTH)
#define S_IXUGO (S_IXUSR|S_IXGRP|S_IXOTH) #define S_IXUGO (S_IXUSR|S_IXGRP|S_IXOTH)
#include <linux/types.h>
struct kstat {
unsigned long ino;
dev_t dev;
umode_t mode;
nlink_t nlink;
uid_t uid;
gid_t gid;
dev_t rdev;
loff_t size;
time_t atime;
time_t mtime;
time_t ctime;
unsigned long blksize;
unsigned long blocks;
};
#endif #endif
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment