diff options
| author | Nicholas Bellinger <nab@linux-iscsi.org> | 2011-01-16 16:21:04 -0500 |
|---|---|---|
| committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2011-01-16 16:21:04 -0500 |
| commit | f652f6c5b7cfdf139f4155d78f397e99ae1c4acc (patch) | |
| tree | 71c6344688bf56ea6aaf18c586ab69ff4f077ade /include/linux/fs.h | |
| parent | 140e3008e7fe1526cbb12f8f07dbc273ac713b75 (diff) | |
| parent | c66ac9db8d4ad9994a02b3e933ea2ccc643e1fe5 (diff) | |
Merge branch 'master' of /pub/scm/linux/kernel/git/jejb/scsi-post-merge-2.6 into for-linus
Diffstat (limited to 'include/linux/fs.h')
| -rw-r--r-- | include/linux/fs.h | 70 |
1 files changed, 44 insertions, 26 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 34209283eab6..3984f2358d1f 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -382,7 +382,6 @@ struct inodes_stat_t { | |||
| 382 | #include <linux/path.h> | 382 | #include <linux/path.h> |
| 383 | #include <linux/stat.h> | 383 | #include <linux/stat.h> |
| 384 | #include <linux/cache.h> | 384 | #include <linux/cache.h> |
| 385 | #include <linux/kobject.h> | ||
| 386 | #include <linux/list.h> | 385 | #include <linux/list.h> |
| 387 | #include <linux/radix-tree.h> | 386 | #include <linux/radix-tree.h> |
| 388 | #include <linux/prio_tree.h> | 387 | #include <linux/prio_tree.h> |
| @@ -392,6 +391,7 @@ struct inodes_stat_t { | |||
| 392 | #include <linux/capability.h> | 391 | #include <linux/capability.h> |
| 393 | #include <linux/semaphore.h> | 392 | #include <linux/semaphore.h> |
| 394 | #include <linux/fiemap.h> | 393 | #include <linux/fiemap.h> |
| 394 | #include <linux/rculist_bl.h> | ||
| 395 | 395 | ||
| 396 | #include <asm/atomic.h> | 396 | #include <asm/atomic.h> |
| 397 | #include <asm/byteorder.h> | 397 | #include <asm/byteorder.h> |
| @@ -401,6 +401,7 @@ struct hd_geometry; | |||
| 401 | struct iovec; | 401 | struct iovec; |
| 402 | struct nameidata; | 402 | struct nameidata; |
| 403 | struct kiocb; | 403 | struct kiocb; |
| 404 | struct kobject; | ||
| 404 | struct pipe_inode_info; | 405 | struct pipe_inode_info; |
| 405 | struct poll_table_struct; | 406 | struct poll_table_struct; |
| 406 | struct kstatfs; | 407 | struct kstatfs; |
| @@ -734,16 +735,31 @@ struct posix_acl; | |||
| 734 | #define ACL_NOT_CACHED ((void *)(-1)) | 735 | #define ACL_NOT_CACHED ((void *)(-1)) |
| 735 | 736 | ||
| 736 | struct inode { | 737 | struct inode { |
| 738 | /* RCU path lookup touches following: */ | ||
| 739 | umode_t i_mode; | ||
| 740 | uid_t i_uid; | ||
| 741 | gid_t i_gid; | ||
| 742 | const struct inode_operations *i_op; | ||
| 743 | struct super_block *i_sb; | ||
| 744 | |||
| 745 | spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ | ||
| 746 | unsigned int i_flags; | ||
| 747 | struct mutex i_mutex; | ||
| 748 | |||
| 749 | unsigned long i_state; | ||
| 750 | unsigned long dirtied_when; /* jiffies of first dirtying */ | ||
| 751 | |||
| 737 | struct hlist_node i_hash; | 752 | struct hlist_node i_hash; |
| 738 | struct list_head i_wb_list; /* backing dev IO list */ | 753 | struct list_head i_wb_list; /* backing dev IO list */ |
| 739 | struct list_head i_lru; /* inode LRU list */ | 754 | struct list_head i_lru; /* inode LRU list */ |
| 740 | struct list_head i_sb_list; | 755 | struct list_head i_sb_list; |
| 741 | struct list_head i_dentry; | 756 | union { |
| 757 | struct list_head i_dentry; | ||
| 758 | struct rcu_head i_rcu; | ||
| 759 | }; | ||
| 742 | unsigned long i_ino; | 760 | unsigned long i_ino; |
| 743 | atomic_t i_count; | 761 | atomic_t i_count; |
| 744 | unsigned int i_nlink; | 762 | unsigned int i_nlink; |
| 745 | uid_t i_uid; | ||
| 746 | gid_t i_gid; | ||
| 747 | dev_t i_rdev; | 763 | dev_t i_rdev; |
| 748 | unsigned int i_blkbits; | 764 | unsigned int i_blkbits; |
| 749 | u64 i_version; | 765 | u64 i_version; |
| @@ -756,13 +772,8 @@ struct inode { | |||
| 756 | struct timespec i_ctime; | 772 | struct timespec i_ctime; |
| 757 | blkcnt_t i_blocks; | 773 | blkcnt_t i_blocks; |
| 758 | unsigned short i_bytes; | 774 | unsigned short i_bytes; |
| 759 | umode_t i_mode; | ||
| 760 | spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ | ||
| 761 | struct mutex i_mutex; | ||
| 762 | struct rw_semaphore i_alloc_sem; | 775 | struct rw_semaphore i_alloc_sem; |
| 763 | const struct inode_operations *i_op; | ||
| 764 | const struct file_operations *i_fop; /* former ->i_op->default_file_ops */ | 776 | const struct file_operations *i_fop; /* former ->i_op->default_file_ops */ |
| 765 | struct super_block *i_sb; | ||
| 766 | struct file_lock *i_flock; | 777 | struct file_lock *i_flock; |
| 767 | struct address_space *i_mapping; | 778 | struct address_space *i_mapping; |
| 768 | struct address_space i_data; | 779 | struct address_space i_data; |
| @@ -783,11 +794,6 @@ struct inode { | |||
| 783 | struct hlist_head i_fsnotify_marks; | 794 | struct hlist_head i_fsnotify_marks; |
| 784 | #endif | 795 | #endif |
| 785 | 796 | ||
| 786 | unsigned long i_state; | ||
| 787 | unsigned long dirtied_when; /* jiffies of first dirtying */ | ||
| 788 | |||
| 789 | unsigned int i_flags; | ||
| 790 | |||
| 791 | #ifdef CONFIG_IMA | 797 | #ifdef CONFIG_IMA |
| 792 | /* protected by i_lock */ | 798 | /* protected by i_lock */ |
| 793 | unsigned int i_readcount; /* struct files open RO */ | 799 | unsigned int i_readcount; /* struct files open RO */ |
| @@ -1373,13 +1379,13 @@ struct super_block { | |||
| 1373 | const struct xattr_handler **s_xattr; | 1379 | const struct xattr_handler **s_xattr; |
| 1374 | 1380 | ||
| 1375 | struct list_head s_inodes; /* all inodes */ | 1381 | struct list_head s_inodes; /* all inodes */ |
| 1376 | struct hlist_head s_anon; /* anonymous dentries for (nfs) exporting */ | 1382 | struct hlist_bl_head s_anon; /* anonymous dentries for (nfs) exporting */ |
| 1377 | #ifdef CONFIG_SMP | 1383 | #ifdef CONFIG_SMP |
| 1378 | struct list_head __percpu *s_files; | 1384 | struct list_head __percpu *s_files; |
| 1379 | #else | 1385 | #else |
| 1380 | struct list_head s_files; | 1386 | struct list_head s_files; |
| 1381 | #endif | 1387 | #endif |
| 1382 | /* s_dentry_lru and s_nr_dentry_unused are protected by dcache_lock */ | 1388 | /* s_dentry_lru, s_nr_dentry_unused protected by dcache.c lru locks */ |
| 1383 | struct list_head s_dentry_lru; /* unused dentry lru */ | 1389 | struct list_head s_dentry_lru; /* unused dentry lru */ |
| 1384 | int s_nr_dentry_unused; /* # of dentry on lru */ | 1390 | int s_nr_dentry_unused; /* # of dentry on lru */ |
| 1385 | 1391 | ||
| @@ -1418,6 +1424,7 @@ struct super_block { | |||
| 1418 | * generic_show_options() | 1424 | * generic_show_options() |
| 1419 | */ | 1425 | */ |
| 1420 | char __rcu *s_options; | 1426 | char __rcu *s_options; |
| 1427 | const struct dentry_operations *s_d_op; /* default d_op for dentries */ | ||
| 1421 | }; | 1428 | }; |
| 1422 | 1429 | ||
| 1423 | extern struct timespec current_fs_time(struct super_block *sb); | 1430 | extern struct timespec current_fs_time(struct super_block *sb); |
| @@ -1546,9 +1553,18 @@ struct file_operations { | |||
| 1546 | int (*setlease)(struct file *, long, struct file_lock **); | 1553 | int (*setlease)(struct file *, long, struct file_lock **); |
| 1547 | }; | 1554 | }; |
| 1548 | 1555 | ||
| 1556 | #define IPERM_FLAG_RCU 0x0001 | ||
| 1557 | |||
| 1549 | struct inode_operations { | 1558 | struct inode_operations { |
| 1550 | int (*create) (struct inode *,struct dentry *,int, struct nameidata *); | ||
| 1551 | struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *); | 1559 | struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *); |
| 1560 | void * (*follow_link) (struct dentry *, struct nameidata *); | ||
| 1561 | int (*permission) (struct inode *, int, unsigned int); | ||
| 1562 | int (*check_acl)(struct inode *, int, unsigned int); | ||
| 1563 | |||
| 1564 | int (*readlink) (struct dentry *, char __user *,int); | ||
| 1565 | void (*put_link) (struct dentry *, struct nameidata *, void *); | ||
| 1566 | |||
| 1567 | int (*create) (struct inode *,struct dentry *,int, struct nameidata *); | ||
| 1552 | int (*link) (struct dentry *,struct inode *,struct dentry *); | 1568 | int (*link) (struct dentry *,struct inode *,struct dentry *); |
| 1553 | int (*unlink) (struct inode *,struct dentry *); | 1569 | int (*unlink) (struct inode *,struct dentry *); |
| 1554 | int (*symlink) (struct inode *,struct dentry *,const char *); | 1570 | int (*symlink) (struct inode *,struct dentry *,const char *); |
| @@ -1557,12 +1573,7 @@ struct inode_operations { | |||
| 1557 | int (*mknod) (struct inode *,struct dentry *,int,dev_t); | 1573 | int (*mknod) (struct inode *,struct dentry *,int,dev_t); |
| 1558 | int (*rename) (struct inode *, struct dentry *, | 1574 | int (*rename) (struct inode *, struct dentry *, |
| 1559 | struct inode *, struct dentry *); | 1575 | struct inode *, struct dentry *); |
| 1560 | int (*readlink) (struct dentry *, char __user *,int); | ||
| 1561 | void * (*follow_link) (struct dentry *, struct nameidata *); | ||
| 1562 | void (*put_link) (struct dentry *, struct nameidata *, void *); | ||
| 1563 | void (*truncate) (struct inode *); | 1576 | void (*truncate) (struct inode *); |
| 1564 | int (*permission) (struct inode *, int); | ||
| 1565 | int (*check_acl)(struct inode *, int); | ||
| 1566 | int (*setattr) (struct dentry *, struct iattr *); | 1577 | int (*setattr) (struct dentry *, struct iattr *); |
| 1567 | int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *); | 1578 | int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *); |
| 1568 | int (*setxattr) (struct dentry *, const char *,const void *,size_t,int); | 1579 | int (*setxattr) (struct dentry *, const char *,const void *,size_t,int); |
| @@ -1574,7 +1585,7 @@ struct inode_operations { | |||
| 1574 | loff_t len); | 1585 | loff_t len); |
| 1575 | int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, | 1586 | int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, |
| 1576 | u64 len); | 1587 | u64 len); |
| 1577 | }; | 1588 | } ____cacheline_aligned; |
| 1578 | 1589 | ||
| 1579 | struct seq_file; | 1590 | struct seq_file; |
| 1580 | 1591 | ||
| @@ -1825,7 +1836,9 @@ struct super_block *sget(struct file_system_type *type, | |||
| 1825 | int (*set)(struct super_block *,void *), | 1836 | int (*set)(struct super_block *,void *), |
| 1826 | void *data); | 1837 | void *data); |
| 1827 | extern struct dentry *mount_pseudo(struct file_system_type *, char *, | 1838 | extern struct dentry *mount_pseudo(struct file_system_type *, char *, |
| 1828 | const struct super_operations *ops, unsigned long); | 1839 | const struct super_operations *ops, |
| 1840 | const struct dentry_operations *dops, | ||
| 1841 | unsigned long); | ||
| 1829 | extern void simple_set_mnt(struct vfsmount *mnt, struct super_block *sb); | 1842 | extern void simple_set_mnt(struct vfsmount *mnt, struct super_block *sb); |
| 1830 | 1843 | ||
| 1831 | static inline void sb_mark_dirty(struct super_block *sb) | 1844 | static inline void sb_mark_dirty(struct super_block *sb) |
| @@ -2160,8 +2173,8 @@ extern sector_t bmap(struct inode *, sector_t); | |||
| 2160 | #endif | 2173 | #endif |
| 2161 | extern int notify_change(struct dentry *, struct iattr *); | 2174 | extern int notify_change(struct dentry *, struct iattr *); |
| 2162 | extern int inode_permission(struct inode *, int); | 2175 | extern int inode_permission(struct inode *, int); |
| 2163 | extern int generic_permission(struct inode *, int, | 2176 | extern int generic_permission(struct inode *, int, unsigned int, |
| 2164 | int (*check_acl)(struct inode *, int)); | 2177 | int (*check_acl)(struct inode *, int, unsigned int)); |
| 2165 | 2178 | ||
| 2166 | static inline bool execute_ok(struct inode *inode) | 2179 | static inline bool execute_ok(struct inode *inode) |
| 2167 | { | 2180 | { |
| @@ -2232,6 +2245,7 @@ extern void iget_failed(struct inode *); | |||
| 2232 | extern void end_writeback(struct inode *); | 2245 | extern void end_writeback(struct inode *); |
| 2233 | extern void __destroy_inode(struct inode *); | 2246 | extern void __destroy_inode(struct inode *); |
| 2234 | extern struct inode *new_inode(struct super_block *); | 2247 | extern struct inode *new_inode(struct super_block *); |
| 2248 | extern void free_inode_nonrcu(struct inode *inode); | ||
| 2235 | extern int should_remove_suid(struct dentry *); | 2249 | extern int should_remove_suid(struct dentry *); |
| 2236 | extern int file_remove_suid(struct file *); | 2250 | extern int file_remove_suid(struct file *); |
| 2237 | 2251 | ||
| @@ -2448,6 +2462,10 @@ static inline ino_t parent_ino(struct dentry *dentry) | |||
| 2448 | { | 2462 | { |
| 2449 | ino_t res; | 2463 | ino_t res; |
| 2450 | 2464 | ||
| 2465 | /* | ||
| 2466 | * Don't strictly need d_lock here? If the parent ino could change | ||
| 2467 | * then surely we'd have a deeper race in the caller? | ||
| 2468 | */ | ||
| 2451 | spin_lock(&dentry->d_lock); | 2469 | spin_lock(&dentry->d_lock); |
| 2452 | res = dentry->d_parent->d_inode->i_ino; | 2470 | res = dentry->d_parent->d_inode->i_ino; |
| 2453 | spin_unlock(&dentry->d_lock); | 2471 | spin_unlock(&dentry->d_lock); |
