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.h88
1 files changed, 27 insertions, 61 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 2fe6e3f900ba..1410e5330c8d 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -120,6 +120,7 @@ extern int dir_notify_enable;
120#define MS_PRIVATE (1<<18) /* change to private */ 120#define MS_PRIVATE (1<<18) /* change to private */
121#define MS_SLAVE (1<<19) /* change to slave */ 121#define MS_SLAVE (1<<19) /* change to slave */
122#define MS_SHARED (1<<20) /* change to shared */ 122#define MS_SHARED (1<<20) /* change to shared */
123#define MS_RELATIME (1<<21) /* Update atime relative to mtime/ctime. */
123#define MS_ACTIVE (1<<30) 124#define MS_ACTIVE (1<<30)
124#define MS_NOUSER (1<<31) 125#define MS_NOUSER (1<<31)
125 126
@@ -269,6 +270,7 @@ extern int dir_notify_enable;
269#include <linux/types.h> 270#include <linux/types.h>
270#include <linux/kdev_t.h> 271#include <linux/kdev_t.h>
271#include <linux/dcache.h> 272#include <linux/dcache.h>
273#include <linux/namei.h>
272#include <linux/stat.h> 274#include <linux/stat.h>
273#include <linux/cache.h> 275#include <linux/cache.h>
274#include <linux/kobject.h> 276#include <linux/kobject.h>
@@ -276,7 +278,7 @@ extern int dir_notify_enable;
276#include <linux/radix-tree.h> 278#include <linux/radix-tree.h>
277#include <linux/prio_tree.h> 279#include <linux/prio_tree.h>
278#include <linux/init.h> 280#include <linux/init.h>
279#include <linux/sched.h> 281#include <linux/pid.h>
280#include <linux/mutex.h> 282#include <linux/mutex.h>
281 283
282#include <asm/atomic.h> 284#include <asm/atomic.h>
@@ -424,6 +426,7 @@ struct address_space_operations {
424 /* migrate the contents of a page to the specified target */ 426 /* migrate the contents of a page to the specified target */
425 int (*migratepage) (struct address_space *, 427 int (*migratepage) (struct address_space *,
426 struct page *, struct page *); 428 struct page *, struct page *);
429 int (*launder_page) (struct page *);
427}; 430};
428 431
429struct backing_dev_info; 432struct backing_dev_info;
@@ -456,7 +459,7 @@ struct block_device {
456 struct inode * bd_inode; /* will die */ 459 struct inode * bd_inode; /* will die */
457 int bd_openers; 460 int bd_openers;
458 struct mutex bd_mutex; /* open/close mutex */ 461 struct mutex bd_mutex; /* open/close mutex */
459 struct mutex bd_mount_mutex; /* mount mutex */ 462 struct semaphore bd_mount_sem;
460 struct list_head bd_inodes; 463 struct list_head bd_inodes;
461 void * bd_holder; 464 void * bd_holder;
462 int bd_holders; 465 int bd_holders;
@@ -482,21 +485,6 @@ struct block_device {
482}; 485};
483 486
484/* 487/*
485 * bdev->bd_mutex nesting subclasses for the lock validator:
486 *
487 * 0: normal
488 * 1: 'whole'
489 * 2: 'partition'
490 */
491enum bdev_bd_mutex_lock_class
492{
493 BD_MUTEX_NORMAL,
494 BD_MUTEX_WHOLE,
495 BD_MUTEX_PARTITION
496};
497
498
499/*
500 * Radix-tree tags, for tagging dirty and writeback pages within the pagecache 488 * Radix-tree tags, for tagging dirty and writeback pages within the pagecache
501 * radix trees 489 * radix trees
502 */ 490 */
@@ -543,19 +531,22 @@ struct inode {
543 struct list_head i_dentry; 531 struct list_head i_dentry;
544 unsigned long i_ino; 532 unsigned long i_ino;
545 atomic_t i_count; 533 atomic_t i_count;
546 umode_t i_mode;
547 unsigned int i_nlink; 534 unsigned int i_nlink;
548 uid_t i_uid; 535 uid_t i_uid;
549 gid_t i_gid; 536 gid_t i_gid;
550 dev_t i_rdev; 537 dev_t i_rdev;
538 unsigned long i_version;
551 loff_t i_size; 539 loff_t i_size;
540#ifdef __NEED_I_SIZE_ORDERED
541 seqcount_t i_size_seqcount;
542#endif
552 struct timespec i_atime; 543 struct timespec i_atime;
553 struct timespec i_mtime; 544 struct timespec i_mtime;
554 struct timespec i_ctime; 545 struct timespec i_ctime;
555 unsigned int i_blkbits; 546 unsigned int i_blkbits;
556 unsigned long i_version;
557 blkcnt_t i_blocks; 547 blkcnt_t i_blocks;
558 unsigned short i_bytes; 548 unsigned short i_bytes;
549 umode_t i_mode;
559 spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ 550 spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */
560 struct mutex i_mutex; 551 struct mutex i_mutex;
561 struct rw_semaphore i_alloc_sem; 552 struct rw_semaphore i_alloc_sem;
@@ -598,9 +589,6 @@ struct inode {
598 void *i_security; 589 void *i_security;
599#endif 590#endif
600 void *i_private; /* fs or device private pointer */ 591 void *i_private; /* fs or device private pointer */
601#ifdef __NEED_I_SIZE_ORDERED
602 seqcount_t i_size_seqcount;
603#endif
604}; 592};
605 593
606/* 594/*
@@ -636,7 +624,7 @@ extern void inode_double_unlock(struct inode *inode1, struct inode *inode2);
636 * cmpxchg8b without the need of the lock prefix). For SMP compiles 624 * cmpxchg8b without the need of the lock prefix). For SMP compiles
637 * and 64bit archs it makes no difference if preempt is enabled or not. 625 * and 64bit archs it makes no difference if preempt is enabled or not.
638 */ 626 */
639static inline loff_t i_size_read(struct inode *inode) 627static inline loff_t i_size_read(const struct inode *inode)
640{ 628{
641#if BITS_PER_LONG==32 && defined(CONFIG_SMP) 629#if BITS_PER_LONG==32 && defined(CONFIG_SMP)
642 loff_t i_size; 630 loff_t i_size;
@@ -679,12 +667,12 @@ static inline void i_size_write(struct inode *inode, loff_t i_size)
679#endif 667#endif
680} 668}
681 669
682static inline unsigned iminor(struct inode *inode) 670static inline unsigned iminor(const struct inode *inode)
683{ 671{
684 return MINOR(inode->i_rdev); 672 return MINOR(inode->i_rdev);
685} 673}
686 674
687static inline unsigned imajor(struct inode *inode) 675static inline unsigned imajor(const struct inode *inode)
688{ 676{
689 return MAJOR(inode->i_rdev); 677 return MAJOR(inode->i_rdev);
690} 678}
@@ -726,8 +714,9 @@ struct file {
726 struct list_head fu_list; 714 struct list_head fu_list;
727 struct rcu_head fu_rcuhead; 715 struct rcu_head fu_rcuhead;
728 } f_u; 716 } f_u;
729 struct dentry *f_dentry; 717 struct path f_path;
730 struct vfsmount *f_vfsmnt; 718#define f_dentry f_path.dentry
719#define f_vfsmnt f_path.mnt
731 const struct file_operations *f_op; 720 const struct file_operations *f_op;
732 atomic_t f_count; 721 atomic_t f_count;
733 unsigned int f_flags; 722 unsigned int f_flags;
@@ -977,36 +966,13 @@ enum {
977#define vfs_check_frozen(sb, level) \ 966#define vfs_check_frozen(sb, level) \
978 wait_event((sb)->s_wait_unfrozen, ((sb)->s_frozen < (level))) 967 wait_event((sb)->s_wait_unfrozen, ((sb)->s_frozen < (level)))
979 968
980static inline void get_fs_excl(void) 969#define get_fs_excl() atomic_inc(&current->fs_excl)
981{ 970#define put_fs_excl() atomic_dec(&current->fs_excl)
982 atomic_inc(&current->fs_excl); 971#define has_fs_excl() atomic_read(&current->fs_excl)
983}
984
985static inline void put_fs_excl(void)
986{
987 atomic_dec(&current->fs_excl);
988}
989
990static inline int has_fs_excl(void)
991{
992 return atomic_read(&current->fs_excl);
993}
994 972
995 973/* not quite ready to be deprecated, but... */
996/* 974extern void lock_super(struct super_block *);
997 * Superblock locking. 975extern void unlock_super(struct super_block *);
998 */
999static inline void lock_super(struct super_block * sb)
1000{
1001 get_fs_excl();
1002 mutex_lock(&sb->s_lock);
1003}
1004
1005static inline void unlock_super(struct super_block * sb)
1006{
1007 put_fs_excl();
1008 mutex_unlock(&sb->s_lock);
1009}
1010 976
1011/* 977/*
1012 * VFS helper functions.. 978 * VFS helper functions..
@@ -1262,7 +1228,7 @@ extern void touch_atime(struct vfsmount *mnt, struct dentry *dentry);
1262static inline void file_accessed(struct file *file) 1228static inline void file_accessed(struct file *file)
1263{ 1229{
1264 if (!(file->f_flags & O_NOATIME)) 1230 if (!(file->f_flags & O_NOATIME))
1265 touch_atime(file->f_vfsmnt, file->f_dentry); 1231 touch_atime(file->f_path.mnt, file->f_path.dentry);
1266} 1232}
1267 1233
1268int sync_inode(struct inode *inode, struct writeback_control *wbc); 1234int sync_inode(struct inode *inode, struct writeback_control *wbc);
@@ -1504,7 +1470,9 @@ extern char * getname(const char __user *);
1504extern void __init vfs_caches_init_early(void); 1470extern void __init vfs_caches_init_early(void);
1505extern void __init vfs_caches_init(unsigned long); 1471extern void __init vfs_caches_init(unsigned long);
1506 1472
1507#define __getname() kmem_cache_alloc(names_cachep, SLAB_KERNEL) 1473extern struct kmem_cache *names_cachep;
1474
1475#define __getname() kmem_cache_alloc(names_cachep, GFP_KERNEL)
1508#define __putname(name) kmem_cache_free(names_cachep, (void *)(name)) 1476#define __putname(name) kmem_cache_free(names_cachep, (void *)(name))
1509#ifndef CONFIG_AUDITSYSCALL 1477#ifndef CONFIG_AUDITSYSCALL
1510#define putname(name) __putname(name) 1478#define putname(name) __putname(name)
@@ -1520,7 +1488,6 @@ extern void bd_set_size(struct block_device *, loff_t size);
1520extern void bd_forget(struct inode *inode); 1488extern void bd_forget(struct inode *inode);
1521extern void bdput(struct block_device *); 1489extern void bdput(struct block_device *);
1522extern struct block_device *open_by_devnum(dev_t, unsigned); 1490extern struct block_device *open_by_devnum(dev_t, unsigned);
1523extern struct block_device *open_partition_by_devnum(dev_t, unsigned);
1524extern const struct address_space_operations def_blk_aops; 1491extern const struct address_space_operations def_blk_aops;
1525#else 1492#else
1526static inline void bd_forget(struct inode *inode) {} 1493static inline void bd_forget(struct inode *inode) {}
@@ -1538,7 +1505,6 @@ extern int blkdev_driver_ioctl(struct inode *inode, struct file *file,
1538extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); 1505extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long);
1539extern int blkdev_get(struct block_device *, mode_t, unsigned); 1506extern int blkdev_get(struct block_device *, mode_t, unsigned);
1540extern int blkdev_put(struct block_device *); 1507extern int blkdev_put(struct block_device *);
1541extern int blkdev_put_partition(struct block_device *);
1542extern int bd_claim(struct block_device *, void *); 1508extern int bd_claim(struct block_device *, void *);
1543extern void bd_release(struct block_device *); 1509extern void bd_release(struct block_device *);
1544#ifdef CONFIG_SYSFS 1510#ifdef CONFIG_SYSFS
@@ -1653,7 +1619,7 @@ static inline void put_write_access(struct inode * inode)
1653static inline void allow_write_access(struct file *file) 1619static inline void allow_write_access(struct file *file)
1654{ 1620{
1655 if (file) 1621 if (file)
1656 atomic_inc(&file->f_dentry->d_inode->i_writecount); 1622 atomic_inc(&file->f_path.dentry->d_inode->i_writecount);
1657} 1623}
1658extern int do_pipe(int *); 1624extern int do_pipe(int *);
1659extern struct file *create_read_pipe(struct file *f); 1625extern struct file *create_read_pipe(struct file *f);