summaryrefslogtreecommitdiffstats
path: root/include/linux/fs.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r--include/linux/fs.h46
1 files changed, 29 insertions, 17 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index c2bb6e835..617a11a41 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -10,7 +10,6 @@
#include <linux/limits.h>
#include <linux/wait.h>
#include <linux/types.h>
-#include <linux/dirent.h>
#include <linux/vfs.h>
#include <linux/net.h>
@@ -63,12 +62,12 @@ extern unsigned long name_cache_init(unsigned long start, unsigned long end);
/*
* These are the fs-independent mount-flags: up to 16 flags are supported
*/
-#define MS_RDONLY 1 /* mount read-only */
-#define MS_NOSUID 2 /* ignore suid and sgid bits */
-#define MS_NODEV 4 /* disallow access to device special files */
-#define MS_NOEXEC 8 /* disallow program execution */
-#define MS_SYNC 16 /* writes are synced at once */
-#define MS_REMOUNT 32 /* alter flags of a mounted FS */
+#define MS_RDONLY 1 /* mount read-only */
+#define MS_NOSUID 2 /* ignore suid and sgid bits */
+#define MS_NODEV 4 /* disallow access to device special files */
+#define MS_NOEXEC 8 /* disallow program execution */
+#define MS_SYNCHRONOUS 16 /* writes are synced at once */
+#define MS_REMOUNT 32 /* alter flags of a mounted FS */
#define S_APPEND 256 /* append-only file */
#define S_IMMUTABLE 512 /* immutable file */
@@ -96,7 +95,7 @@ extern unsigned long name_cache_init(unsigned long start, unsigned long end);
#define IS_NOSUID(inode) ((inode)->i_flags & MS_NOSUID)
#define IS_NODEV(inode) ((inode)->i_flags & MS_NODEV)
#define IS_NOEXEC(inode) ((inode)->i_flags & MS_NOEXEC)
-#define IS_SYNC(inode) ((inode)->i_flags & MS_SYNC)
+#define IS_SYNC(inode) ((inode)->i_flags & MS_SYNCHRONOUS)
#define IS_APPEND(inode) ((inode)->i_flags & S_APPEND)
#define IS_IMMUTABLE(inode) ((inode)->i_flags & S_IMMUTABLE)
@@ -225,13 +224,13 @@ struct inode {
struct inode * i_hash_next, * i_hash_prev;
struct inode * i_bound_to, * i_bound_by;
struct inode * i_mount;
- struct socket * i_socket;
unsigned short i_count;
unsigned short i_wcount;
unsigned short i_flags;
unsigned char i_lock;
unsigned char i_dirt;
unsigned char i_pipe;
+ unsigned char i_sock;
unsigned char i_seek;
unsigned char i_update;
union {
@@ -246,6 +245,7 @@ struct inode {
struct nfs_inode_info nfs_i;
struct xiafs_inode_info xiafs_i;
struct sysv_inode_info sysv_i;
+ struct socket socket_i;
void * generic_ip;
} u;
};
@@ -265,13 +265,15 @@ struct file {
};
struct file_lock {
- struct file_lock *fl_next; /* singly linked list */
- struct file_lock *fl_nextlink;
- struct task_struct *fl_owner; /* NULL if on free list, for sanity checks */
- unsigned int fl_fd; /* File descriptor for this lock */
+ struct file_lock *fl_next; /* singly linked list for this inode */
+ struct file_lock *fl_nextlink; /* doubly linked list of all locks */
+ struct file_lock *fl_prevlink; /* used to simplify lock removal */
+ struct file_lock *fl_block;
+ struct task_struct *fl_owner;
struct wait_queue *fl_wait;
+ struct file *fl_file;
+ char fl_flags;
char fl_type;
- char fl_whence;
off_t fl_start;
off_t fl_end;
};
@@ -301,6 +303,7 @@ struct super_block {
unsigned char s_lock;
unsigned char s_rd_only;
unsigned char s_dirt;
+ struct file_system_type *s_type;
struct super_operations *s_op;
unsigned long s_flags;
unsigned long s_magic;
@@ -322,11 +325,19 @@ struct super_block {
} u;
};
+/*
+ * This is the "filldir" function type, used by readdir() to let
+ * the kernel specify what kind of dirent layout it wants to have.
+ * This allows the kernel to read directories into kernel space or
+ * to have different dirent layouts depending on the binary type.
+ */
+typedef int (*filldir_t)(void *, char *, int, off_t, ino_t);
+
struct file_operations {
int (*lseek) (struct inode *, struct file *, off_t, int);
int (*read) (struct inode *, struct file *, char *, int);
int (*write) (struct inode *, struct file *, char *, int);
- int (*readdir) (struct inode *, struct file *, struct dirent *, int);
+ int (*readdir) (struct inode *, struct file *, void *, filldir_t);
int (*select) (struct inode *, struct file *, int, select_table *);
int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned long);
int (*mmap) (struct inode *, struct file *, struct vm_area_struct *);
@@ -364,7 +375,7 @@ struct super_operations {
void (*put_inode) (struct inode *);
void (*put_super) (struct super_block *);
void (*write_super) (struct super_block *);
- void (*statfs) (struct super_block *, struct statfs *);
+ void (*statfs) (struct super_block *, struct statfs *, int);
int (*remount_fs) (struct super_block *, int *, char *);
};
@@ -472,6 +483,7 @@ extern void put_write_access(struct inode * inode);
extern int open_namei(const char * pathname, int flag, int mode,
struct inode ** res_inode, struct inode * base);
extern int do_mknod(const char * filename, int mode, dev_t dev);
+extern int do_pipe(int *);
extern void iput(struct inode * inode);
extern struct inode * __iget(struct super_block * sb,int nr,int crsmnt);
extern struct inode * get_empty_inode(void);
@@ -482,7 +494,7 @@ extern struct file * get_empty_filp(void);
extern struct buffer_head * get_hash_table(dev_t dev, int block, int size);
extern struct buffer_head * getblk(dev_t dev, int block, int size);
extern void ll_rw_block(int rw, int nr, struct buffer_head * bh[]);
-extern void ll_rw_page(int rw, int dev, int nr, char * buffer);
+extern void ll_rw_page(int rw, int dev, unsigned long nr, char * buffer);
extern void ll_rw_swap_file(int rw, int dev, unsigned int *b, int nb, char *buffer);
extern int is_read_only(int dev);
extern void brelse(struct buffer_head * buf);