aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/fs.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-10-26 20:58:44 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-10-26 20:58:44 -0400
commit426e1f5cec4821945642230218876b0e89aafab1 (patch)
tree2728ace018d0698886989da586210ef1543a7098 /include/linux/fs.h
parent9e5fca251f44832cb996961048ea977f80faf6ea (diff)
parent63997e98a3be68d7cec806d22bf9b02b2e1daabb (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (52 commits) split invalidate_inodes() fs: skip I_FREEING inodes in writeback_sb_inodes fs: fold invalidate_list into invalidate_inodes fs: do not drop inode_lock in dispose_list fs: inode split IO and LRU lists fs: switch bdev inode bdi's correctly fs: fix buffer invalidation in invalidate_list fsnotify: use dget_parent smbfs: use dget_parent exportfs: use dget_parent fs: use RCU read side protection in d_validate fs: clean up dentry lru modification fs: split __shrink_dcache_sb fs: improve DCACHE_REFERENCED usage fs: use percpu counter for nr_dentry and nr_dentry_unused fs: simplify __d_free fs: take dcache_lock inside __d_path fs: do not assign default i_ino in new_inode fs: introduce a per-cpu last_ino allocator new helper: ihold() ...
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r--include/linux/fs.h39
1 files changed, 27 insertions, 12 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 4658777b41c..240eb1d4f87 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -92,6 +92,9 @@ struct inodes_stat_t {
92/* Expect random access pattern */ 92/* Expect random access pattern */
93#define FMODE_RANDOM ((__force fmode_t)0x1000) 93#define FMODE_RANDOM ((__force fmode_t)0x1000)
94 94
95/* File is huge (eg. /dev/kmem): treat loff_t as unsigned */
96#define FMODE_UNSIGNED_OFFSET ((__force fmode_t)0x2000)
97
95/* File was opened by fanotify and shouldn't generate fanotify events */ 98/* File was opened by fanotify and shouldn't generate fanotify events */
96#define FMODE_NONOTIFY ((__force fmode_t)0x1000000) 99#define FMODE_NONOTIFY ((__force fmode_t)0x1000000)
97 100
@@ -722,7 +725,8 @@ struct posix_acl;
722 725
723struct inode { 726struct inode {
724 struct hlist_node i_hash; 727 struct hlist_node i_hash;
725 struct list_head i_list; /* backing dev IO list */ 728 struct list_head i_wb_list; /* backing dev IO list */
729 struct list_head i_lru; /* inode LRU list */
726 struct list_head i_sb_list; 730 struct list_head i_sb_list;
727 struct list_head i_dentry; 731 struct list_head i_dentry;
728 unsigned long i_ino; 732 unsigned long i_ino;
@@ -789,6 +793,11 @@ struct inode {
789 void *i_private; /* fs or device private pointer */ 793 void *i_private; /* fs or device private pointer */
790}; 794};
791 795
796static inline int inode_unhashed(struct inode *inode)
797{
798 return hlist_unhashed(&inode->i_hash);
799}
800
792/* 801/*
793 * inode->i_mutex nesting subclasses for the lock validator: 802 * inode->i_mutex nesting subclasses for the lock validator:
794 * 803 *
@@ -1639,16 +1648,17 @@ struct super_operations {
1639 * 1648 *
1640 * Q: What is the difference between I_WILL_FREE and I_FREEING? 1649 * Q: What is the difference between I_WILL_FREE and I_FREEING?
1641 */ 1650 */
1642#define I_DIRTY_SYNC 1 1651#define I_DIRTY_SYNC (1 << 0)
1643#define I_DIRTY_DATASYNC 2 1652#define I_DIRTY_DATASYNC (1 << 1)
1644#define I_DIRTY_PAGES 4 1653#define I_DIRTY_PAGES (1 << 2)
1645#define __I_NEW 3 1654#define __I_NEW 3
1646#define I_NEW (1 << __I_NEW) 1655#define I_NEW (1 << __I_NEW)
1647#define I_WILL_FREE 16 1656#define I_WILL_FREE (1 << 4)
1648#define I_FREEING 32 1657#define I_FREEING (1 << 5)
1649#define I_CLEAR 64 1658#define I_CLEAR (1 << 6)
1650#define __I_SYNC 7 1659#define __I_SYNC 7
1651#define I_SYNC (1 << __I_SYNC) 1660#define I_SYNC (1 << __I_SYNC)
1661#define I_REFERENCED (1 << 8)
1652 1662
1653#define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES) 1663#define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES)
1654 1664
@@ -1740,6 +1750,7 @@ static inline void file_accessed(struct file *file)
1740} 1750}
1741 1751
1742int sync_inode(struct inode *inode, struct writeback_control *wbc); 1752int sync_inode(struct inode *inode, struct writeback_control *wbc);
1753int sync_inode_metadata(struct inode *inode, int wait);
1743 1754
1744struct file_system_type { 1755struct file_system_type {
1745 const char *name; 1756 const char *name;
@@ -2084,7 +2095,6 @@ extern int check_disk_change(struct block_device *);
2084extern int __invalidate_device(struct block_device *); 2095extern int __invalidate_device(struct block_device *);
2085extern int invalidate_partition(struct gendisk *, int); 2096extern int invalidate_partition(struct gendisk *, int);
2086#endif 2097#endif
2087extern int invalidate_inodes(struct super_block *);
2088unsigned long invalidate_mapping_pages(struct address_space *mapping, 2098unsigned long invalidate_mapping_pages(struct address_space *mapping,
2089 pgoff_t start, pgoff_t end); 2099 pgoff_t start, pgoff_t end);
2090 2100
@@ -2168,7 +2178,7 @@ extern loff_t vfs_llseek(struct file *file, loff_t offset, int origin);
2168 2178
2169extern int inode_init_always(struct super_block *, struct inode *); 2179extern int inode_init_always(struct super_block *, struct inode *);
2170extern void inode_init_once(struct inode *); 2180extern void inode_init_once(struct inode *);
2171extern void inode_add_to_lists(struct super_block *, struct inode *); 2181extern void ihold(struct inode * inode);
2172extern void iput(struct inode *); 2182extern void iput(struct inode *);
2173extern struct inode * igrab(struct inode *); 2183extern struct inode * igrab(struct inode *);
2174extern ino_t iunique(struct super_block *, ino_t); 2184extern ino_t iunique(struct super_block *, ino_t);
@@ -2188,11 +2198,11 @@ extern struct inode * iget_locked(struct super_block *, unsigned long);
2188extern int insert_inode_locked4(struct inode *, unsigned long, int (*test)(struct inode *, void *), void *); 2198extern int insert_inode_locked4(struct inode *, unsigned long, int (*test)(struct inode *, void *), void *);
2189extern int insert_inode_locked(struct inode *); 2199extern int insert_inode_locked(struct inode *);
2190extern void unlock_new_inode(struct inode *); 2200extern void unlock_new_inode(struct inode *);
2201extern unsigned int get_next_ino(void);
2191 2202
2192extern void __iget(struct inode * inode); 2203extern void __iget(struct inode * inode);
2193extern void iget_failed(struct inode *); 2204extern void iget_failed(struct inode *);
2194extern void end_writeback(struct inode *); 2205extern void end_writeback(struct inode *);
2195extern void destroy_inode(struct inode *);
2196extern void __destroy_inode(struct inode *); 2206extern void __destroy_inode(struct inode *);
2197extern struct inode *new_inode(struct super_block *); 2207extern struct inode *new_inode(struct super_block *);
2198extern int should_remove_suid(struct dentry *); 2208extern int should_remove_suid(struct dentry *);
@@ -2200,9 +2210,11 @@ extern int file_remove_suid(struct file *);
2200 2210
2201extern void __insert_inode_hash(struct inode *, unsigned long hashval); 2211extern void __insert_inode_hash(struct inode *, unsigned long hashval);
2202extern void remove_inode_hash(struct inode *); 2212extern void remove_inode_hash(struct inode *);
2203static inline void insert_inode_hash(struct inode *inode) { 2213static inline void insert_inode_hash(struct inode *inode)
2214{
2204 __insert_inode_hash(inode, inode->i_ino); 2215 __insert_inode_hash(inode, inode->i_ino);
2205} 2216}
2217extern void inode_sb_list_add(struct inode *inode);
2206 2218
2207#ifdef CONFIG_BLOCK 2219#ifdef CONFIG_BLOCK
2208extern void submit_bio(int, struct bio *); 2220extern void submit_bio(int, struct bio *);
@@ -2485,7 +2497,10 @@ ssize_t simple_attr_write(struct file *file, const char __user *buf,
2485struct ctl_table; 2497struct ctl_table;
2486int proc_nr_files(struct ctl_table *table, int write, 2498int proc_nr_files(struct ctl_table *table, int write,
2487 void __user *buffer, size_t *lenp, loff_t *ppos); 2499 void __user *buffer, size_t *lenp, loff_t *ppos);
2488 2500int proc_nr_dentry(struct ctl_table *table, int write,
2501 void __user *buffer, size_t *lenp, loff_t *ppos);
2502int proc_nr_inodes(struct ctl_table *table, int write,
2503 void __user *buffer, size_t *lenp, loff_t *ppos);
2489int __init get_filesystem_list(char *buf); 2504int __init get_filesystem_list(char *buf);
2490 2505
2491#define ACC_MODE(x) ("\004\002\006\006"[(x)&O_ACCMODE]) 2506#define ACC_MODE(x) ("\004\002\006\006"[(x)&O_ACCMODE])