aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/fs.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r--include/linux/fs.h80
1 files changed, 46 insertions, 34 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index c6455dadb21b..8252b045e624 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -60,6 +60,8 @@ extern int dir_notify_enable;
60#define MAY_WRITE 2 60#define MAY_WRITE 2
61#define MAY_READ 4 61#define MAY_READ 4
62#define MAY_APPEND 8 62#define MAY_APPEND 8
63#define MAY_ACCESS 16
64#define MAY_OPEN 32
63 65
64#define FMODE_READ 1 66#define FMODE_READ 1
65#define FMODE_WRITE 2 67#define FMODE_WRITE 2
@@ -277,7 +279,7 @@ extern int dir_notify_enable;
277#include <linux/types.h> 279#include <linux/types.h>
278#include <linux/kdev_t.h> 280#include <linux/kdev_t.h>
279#include <linux/dcache.h> 281#include <linux/dcache.h>
280#include <linux/namei.h> 282#include <linux/path.h>
281#include <linux/stat.h> 283#include <linux/stat.h>
282#include <linux/cache.h> 284#include <linux/cache.h>
283#include <linux/kobject.h> 285#include <linux/kobject.h>
@@ -318,22 +320,23 @@ typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset,
318 * Attribute flags. These should be or-ed together to figure out what 320 * Attribute flags. These should be or-ed together to figure out what
319 * has been changed! 321 * has been changed!
320 */ 322 */
321#define ATTR_MODE 1 323#define ATTR_MODE (1 << 0)
322#define ATTR_UID 2 324#define ATTR_UID (1 << 1)
323#define ATTR_GID 4 325#define ATTR_GID (1 << 2)
324#define ATTR_SIZE 8 326#define ATTR_SIZE (1 << 3)
325#define ATTR_ATIME 16 327#define ATTR_ATIME (1 << 4)
326#define ATTR_MTIME 32 328#define ATTR_MTIME (1 << 5)
327#define ATTR_CTIME 64 329#define ATTR_CTIME (1 << 6)
328#define ATTR_ATIME_SET 128 330#define ATTR_ATIME_SET (1 << 7)
329#define ATTR_MTIME_SET 256 331#define ATTR_MTIME_SET (1 << 8)
330#define ATTR_FORCE 512 /* Not a change, but a change it */ 332#define ATTR_FORCE (1 << 9) /* Not a change, but a change it */
331#define ATTR_ATTR_FLAG 1024 333#define ATTR_ATTR_FLAG (1 << 10)
332#define ATTR_KILL_SUID 2048 334#define ATTR_KILL_SUID (1 << 11)
333#define ATTR_KILL_SGID 4096 335#define ATTR_KILL_SGID (1 << 12)
334#define ATTR_FILE 8192 336#define ATTR_FILE (1 << 13)
335#define ATTR_KILL_PRIV 16384 337#define ATTR_KILL_PRIV (1 << 14)
336#define ATTR_OPEN 32768 /* Truncating from open(O_TRUNC) */ 338#define ATTR_OPEN (1 << 15) /* Truncating from open(O_TRUNC) */
339#define ATTR_TIMES_SET (1 << 16)
337 340
338/* 341/*
339 * This is the Inode Attributes structure, used for notify_change(). It 342 * This is the Inode Attributes structure, used for notify_change(). It
@@ -499,7 +502,7 @@ struct backing_dev_info;
499struct address_space { 502struct address_space {
500 struct inode *host; /* owner: inode, block_device */ 503 struct inode *host; /* owner: inode, block_device */
501 struct radix_tree_root page_tree; /* radix tree of all pages */ 504 struct radix_tree_root page_tree; /* radix tree of all pages */
502 rwlock_t tree_lock; /* and rwlock protecting it */ 505 spinlock_t tree_lock; /* and lock protecting it */
503 unsigned int i_mmap_writable;/* count VM_SHARED mappings */ 506 unsigned int i_mmap_writable;/* count VM_SHARED mappings */
504 struct prio_tree_root i_mmap; /* tree of private and shared mappings */ 507 struct prio_tree_root i_mmap; /* tree of private and shared mappings */
505 struct list_head i_mmap_nonlinear;/*list VM_NONLINEAR mappings */ 508 struct list_head i_mmap_nonlinear;/*list VM_NONLINEAR mappings */
@@ -792,7 +795,7 @@ struct file {
792#define f_dentry f_path.dentry 795#define f_dentry f_path.dentry
793#define f_vfsmnt f_path.mnt 796#define f_vfsmnt f_path.mnt
794 const struct file_operations *f_op; 797 const struct file_operations *f_op;
795 atomic_t f_count; 798 atomic_long_t f_count;
796 unsigned int f_flags; 799 unsigned int f_flags;
797 mode_t f_mode; 800 mode_t f_mode;
798 loff_t f_pos; 801 loff_t f_pos;
@@ -821,8 +824,8 @@ extern spinlock_t files_lock;
821#define file_list_lock() spin_lock(&files_lock); 824#define file_list_lock() spin_lock(&files_lock);
822#define file_list_unlock() spin_unlock(&files_lock); 825#define file_list_unlock() spin_unlock(&files_lock);
823 826
824#define get_file(x) atomic_inc(&(x)->f_count) 827#define get_file(x) atomic_long_inc(&(x)->f_count)
825#define file_count(x) atomic_read(&(x)->f_count) 828#define file_count(x) atomic_long_read(&(x)->f_count)
826 829
827#ifdef CONFIG_DEBUG_WRITECOUNT 830#ifdef CONFIG_DEBUG_WRITECOUNT
828static inline void file_take_write(struct file *f) 831static inline void file_take_write(struct file *f)
@@ -886,6 +889,12 @@ static inline int file_check_writeable(struct file *filp)
886#define FL_SLEEP 128 /* A blocking lock */ 889#define FL_SLEEP 128 /* A blocking lock */
887 890
888/* 891/*
892 * Special return value from posix_lock_file() and vfs_lock_file() for
893 * asynchronous locking.
894 */
895#define FILE_LOCK_DEFERRED 1
896
897/*
889 * The POSIX file lock owner is determined by 898 * The POSIX file lock owner is determined by
890 * the "struct files_struct" in the thread group 899 * the "struct files_struct" in the thread group
891 * (or NULL for no owner - BSD locks). 900 * (or NULL for no owner - BSD locks).
@@ -918,12 +927,12 @@ struct file_lock {
918 struct list_head fl_link; /* doubly linked list of all locks */ 927 struct list_head fl_link; /* doubly linked list of all locks */
919 struct list_head fl_block; /* circular list of blocked processes */ 928 struct list_head fl_block; /* circular list of blocked processes */
920 fl_owner_t fl_owner; 929 fl_owner_t fl_owner;
930 unsigned char fl_flags;
931 unsigned char fl_type;
921 unsigned int fl_pid; 932 unsigned int fl_pid;
922 struct pid *fl_nspid; 933 struct pid *fl_nspid;
923 wait_queue_head_t fl_wait; 934 wait_queue_head_t fl_wait;
924 struct file *fl_file; 935 struct file *fl_file;
925 unsigned char fl_flags;
926 unsigned char fl_type;
927 loff_t fl_start; 936 loff_t fl_start;
928 loff_t fl_end; 937 loff_t fl_end;
929 938
@@ -1025,6 +1034,7 @@ extern int send_sigurg(struct fown_struct *fown);
1025extern struct list_head super_blocks; 1034extern struct list_head super_blocks;
1026extern spinlock_t sb_lock; 1035extern spinlock_t sb_lock;
1027 1036
1037#define sb_entry(list) list_entry((list), struct super_block, s_list)
1028#define S_BIAS (1<<30) 1038#define S_BIAS (1<<30)
1029struct super_block { 1039struct super_block {
1030 struct list_head s_list; /* Keep this first */ 1040 struct list_head s_list; /* Keep this first */
@@ -1058,6 +1068,9 @@ struct super_block {
1058 struct list_head s_more_io; /* parked for more writeback */ 1068 struct list_head s_more_io; /* parked for more writeback */
1059 struct hlist_head s_anon; /* anonymous dentries for (nfs) exporting */ 1069 struct hlist_head s_anon; /* anonymous dentries for (nfs) exporting */
1060 struct list_head s_files; 1070 struct list_head s_files;
1071 /* s_dentry_lru and s_nr_dentry_unused are protected by dcache_lock */
1072 struct list_head s_dentry_lru; /* unused dentry lru */
1073 int s_nr_dentry_unused; /* # of dentry on lru */
1061 1074
1062 struct block_device *s_bdev; 1075 struct block_device *s_bdev;
1063 struct mtd_info *s_mtd; 1076 struct mtd_info *s_mtd;
@@ -1126,7 +1139,7 @@ extern int vfs_permission(struct nameidata *, int);
1126extern int vfs_create(struct inode *, struct dentry *, int, struct nameidata *); 1139extern int vfs_create(struct inode *, struct dentry *, int, struct nameidata *);
1127extern int vfs_mkdir(struct inode *, struct dentry *, int); 1140extern int vfs_mkdir(struct inode *, struct dentry *, int);
1128extern int vfs_mknod(struct inode *, struct dentry *, int, dev_t); 1141extern int vfs_mknod(struct inode *, struct dentry *, int, dev_t);
1129extern int vfs_symlink(struct inode *, struct dentry *, const char *, int); 1142extern int vfs_symlink(struct inode *, struct dentry *, const char *);
1130extern int vfs_link(struct dentry *, struct inode *, struct dentry *); 1143extern int vfs_link(struct dentry *, struct inode *, struct dentry *);
1131extern int vfs_rmdir(struct inode *, struct dentry *); 1144extern int vfs_rmdir(struct inode *, struct dentry *);
1132extern int vfs_unlink(struct inode *, struct dentry *); 1145extern int vfs_unlink(struct inode *, struct dentry *);
@@ -1262,7 +1275,7 @@ struct inode_operations {
1262 void * (*follow_link) (struct dentry *, struct nameidata *); 1275 void * (*follow_link) (struct dentry *, struct nameidata *);
1263 void (*put_link) (struct dentry *, struct nameidata *, void *); 1276 void (*put_link) (struct dentry *, struct nameidata *, void *);
1264 void (*truncate) (struct inode *); 1277 void (*truncate) (struct inode *);
1265 int (*permission) (struct inode *, int, struct nameidata *); 1278 int (*permission) (struct inode *, int);
1266 int (*setattr) (struct dentry *, struct iattr *); 1279 int (*setattr) (struct dentry *, struct iattr *);
1267 int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *); 1280 int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *);
1268 int (*setxattr) (struct dentry *, const char *,const void *,size_t,int); 1281 int (*setxattr) (struct dentry *, const char *,const void *,size_t,int);
@@ -1686,9 +1699,9 @@ extern void init_special_inode(struct inode *, umode_t, dev_t);
1686extern void make_bad_inode(struct inode *); 1699extern void make_bad_inode(struct inode *);
1687extern int is_bad_inode(struct inode *); 1700extern int is_bad_inode(struct inode *);
1688 1701
1689extern const struct file_operations read_fifo_fops; 1702extern const struct file_operations read_pipefifo_fops;
1690extern const struct file_operations write_fifo_fops; 1703extern const struct file_operations write_pipefifo_fops;
1691extern const struct file_operations rdwr_fifo_fops; 1704extern const struct file_operations rdwr_pipefifo_fops;
1692 1705
1693extern int fs_may_remount_ro(struct super_block *); 1706extern int fs_may_remount_ro(struct super_block *);
1694 1707
@@ -1757,7 +1770,7 @@ extern int do_remount_sb(struct super_block *sb, int flags,
1757extern sector_t bmap(struct inode *, sector_t); 1770extern sector_t bmap(struct inode *, sector_t);
1758#endif 1771#endif
1759extern int notify_change(struct dentry *, struct iattr *); 1772extern int notify_change(struct dentry *, struct iattr *);
1760extern int permission(struct inode *, int, struct nameidata *); 1773extern int inode_permission(struct inode *, int);
1761extern int generic_permission(struct inode *, int, 1774extern int generic_permission(struct inode *, int,
1762 int (*check_acl)(struct inode *, int)); 1775 int (*check_acl)(struct inode *, int));
1763 1776
@@ -1773,8 +1786,9 @@ static inline void allow_write_access(struct file *file)
1773 atomic_inc(&file->f_path.dentry->d_inode->i_writecount); 1786 atomic_inc(&file->f_path.dentry->d_inode->i_writecount);
1774} 1787}
1775extern int do_pipe(int *); 1788extern int do_pipe(int *);
1776extern struct file *create_read_pipe(struct file *f); 1789extern int do_pipe_flags(int *, int);
1777extern struct file *create_write_pipe(void); 1790extern struct file *create_read_pipe(struct file *f, int flags);
1791extern struct file *create_write_pipe(int flags);
1778extern void free_write_pipe(struct file *); 1792extern void free_write_pipe(struct file *);
1779 1793
1780extern struct file *do_filp_open(int dfd, const char *pathname, 1794extern struct file *do_filp_open(int dfd, const char *pathname,
@@ -1820,7 +1834,7 @@ extern void clear_inode(struct inode *);
1820extern void destroy_inode(struct inode *); 1834extern void destroy_inode(struct inode *);
1821extern struct inode *new_inode(struct super_block *); 1835extern struct inode *new_inode(struct super_block *);
1822extern int should_remove_suid(struct dentry *); 1836extern int should_remove_suid(struct dentry *);
1823extern int remove_suid(struct dentry *); 1837extern int file_remove_suid(struct file *);
1824 1838
1825extern void __insert_inode_hash(struct inode *, unsigned long hashval); 1839extern void __insert_inode_hash(struct inode *, unsigned long hashval);
1826extern void remove_inode_hash(struct inode *); 1840extern void remove_inode_hash(struct inode *);
@@ -2006,8 +2020,6 @@ extern void simple_release_fs(struct vfsmount **mount, int *count);
2006 2020
2007extern ssize_t simple_read_from_buffer(void __user *to, size_t count, 2021extern ssize_t simple_read_from_buffer(void __user *to, size_t count,
2008 loff_t *ppos, const void *from, size_t available); 2022 loff_t *ppos, const void *from, size_t available);
2009extern ssize_t memory_read_from_buffer(void *to, size_t count, loff_t *ppos,
2010 const void *from, size_t available);
2011 2023
2012#ifdef CONFIG_MIGRATION 2024#ifdef CONFIG_MIGRATION
2013extern int buffer_migrate_page(struct address_space *, 2025extern int buffer_migrate_page(struct address_space *,