aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/fs.h
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-03-29 17:18:49 -0500
committerJeff Garzik <jeff@garzik.org>2006-03-29 17:18:49 -0500
commite02a4cabfcb9a999b74a2e2e6f13ffcb7ff2d606 (patch)
tree2f3db60be4c57eca2a4c3ab3f3122dcf1ec0c624 /include/linux/fs.h
parent600511e86babe3727264a0883a3a264f6fb6caf5 (diff)
parentf3cab8a0b1a772dc8b055b7affa567a366627c9e (diff)
Merge branch 'master'
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r--include/linux/fs.h73
1 files changed, 41 insertions, 32 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 215696a0f1..408fe89498 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -65,6 +65,11 @@ extern int dir_notify_enable;
65#define FMODE_PREAD 8 65#define FMODE_PREAD 8
66#define FMODE_PWRITE FMODE_PREAD /* These go hand in hand */ 66#define FMODE_PWRITE FMODE_PREAD /* These go hand in hand */
67 67
68/* File is being opened for execution. Primary users of this flag are
69 distributed filesystems that can use it to achieve correct ETXTBUSY
70 behavior for cross-node execution/opening_for_writing of files */
71#define FMODE_EXEC 16
72
68#define RW_MASK 1 73#define RW_MASK 1
69#define RWA_MASK 2 74#define RWA_MASK 2
70#define READ 0 75#define READ 0
@@ -247,9 +252,6 @@ extern void __init files_init(unsigned long);
247struct buffer_head; 252struct buffer_head;
248typedef int (get_block_t)(struct inode *inode, sector_t iblock, 253typedef int (get_block_t)(struct inode *inode, sector_t iblock,
249 struct buffer_head *bh_result, int create); 254 struct buffer_head *bh_result, int create);
250typedef int (get_blocks_t)(struct inode *inode, sector_t iblock,
251 unsigned long max_blocks,
252 struct buffer_head *bh_result, int create);
253typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset, 255typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset,
254 ssize_t bytes, void *private); 256 ssize_t bytes, void *private);
255 257
@@ -345,7 +347,7 @@ struct writeback_control;
345struct address_space_operations { 347struct address_space_operations {
346 int (*writepage)(struct page *page, struct writeback_control *wbc); 348 int (*writepage)(struct page *page, struct writeback_control *wbc);
347 int (*readpage)(struct file *, struct page *); 349 int (*readpage)(struct file *, struct page *);
348 int (*sync_page)(struct page *); 350 void (*sync_page)(struct page *);
349 351
350 /* Write back some dirty pages from this mapping. */ 352 /* Write back some dirty pages from this mapping. */
351 int (*writepages)(struct address_space *, struct writeback_control *); 353 int (*writepages)(struct address_space *, struct writeback_control *);
@@ -364,7 +366,7 @@ struct address_space_operations {
364 int (*commit_write)(struct file *, struct page *, unsigned, unsigned); 366 int (*commit_write)(struct file *, struct page *, unsigned, unsigned);
365 /* Unfortunately this kludge is needed for FIBMAP. Don't use it */ 367 /* Unfortunately this kludge is needed for FIBMAP. Don't use it */
366 sector_t (*bmap)(struct address_space *, sector_t); 368 sector_t (*bmap)(struct address_space *, sector_t);
367 int (*invalidatepage) (struct page *, unsigned long); 369 void (*invalidatepage) (struct page *, unsigned long);
368 int (*releasepage) (struct page *, gfp_t); 370 int (*releasepage) (struct page *, gfp_t);
369 ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov, 371 ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov,
370 loff_t offset, unsigned long nr_segs); 372 loff_t offset, unsigned long nr_segs);
@@ -408,6 +410,9 @@ struct block_device {
408 struct list_head bd_inodes; 410 struct list_head bd_inodes;
409 void * bd_holder; 411 void * bd_holder;
410 int bd_holders; 412 int bd_holders;
413#ifdef CONFIG_SYSFS
414 struct list_head bd_holder_list;
415#endif
411 struct block_device * bd_contains; 416 struct block_device * bd_contains;
412 unsigned bd_block_size; 417 unsigned bd_block_size;
413 struct hd_struct * bd_part; 418 struct hd_struct * bd_part;
@@ -485,13 +490,13 @@ struct inode {
485 unsigned int i_blkbits; 490 unsigned int i_blkbits;
486 unsigned long i_blksize; 491 unsigned long i_blksize;
487 unsigned long i_version; 492 unsigned long i_version;
488 unsigned long i_blocks; 493 blkcnt_t i_blocks;
489 unsigned short i_bytes; 494 unsigned short i_bytes;
490 spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ 495 spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */
491 struct mutex i_mutex; 496 struct mutex i_mutex;
492 struct rw_semaphore i_alloc_sem; 497 struct rw_semaphore i_alloc_sem;
493 struct inode_operations *i_op; 498 struct inode_operations *i_op;
494 struct file_operations *i_fop; /* former ->i_op->default_file_ops */ 499 const struct file_operations *i_fop; /* former ->i_op->default_file_ops */
495 struct super_block *i_sb; 500 struct super_block *i_sb;
496 struct file_lock *i_flock; 501 struct file_lock *i_flock;
497 struct address_space *i_mapping; 502 struct address_space *i_mapping;
@@ -631,7 +636,7 @@ struct file {
631 } f_u; 636 } f_u;
632 struct dentry *f_dentry; 637 struct dentry *f_dentry;
633 struct vfsmount *f_vfsmnt; 638 struct vfsmount *f_vfsmnt;
634 struct file_operations *f_op; 639 const struct file_operations *f_op;
635 atomic_t f_count; 640 atomic_t f_count;
636 unsigned int f_flags; 641 unsigned int f_flags;
637 mode_t f_mode; 642 mode_t f_mode;
@@ -673,7 +678,6 @@ extern spinlock_t files_lock;
673#define FL_POSIX 1 678#define FL_POSIX 1
674#define FL_FLOCK 2 679#define FL_FLOCK 2
675#define FL_ACCESS 8 /* not trying to lock, just looking */ 680#define FL_ACCESS 8 /* not trying to lock, just looking */
676#define FL_LOCKD 16 /* lock held by rpc.lockd */
677#define FL_LEASE 32 /* lease held on this file */ 681#define FL_LEASE 32 /* lease held on this file */
678#define FL_SLEEP 128 /* A blocking lock */ 682#define FL_SLEEP 128 /* A blocking lock */
679 683
@@ -737,8 +741,6 @@ struct file_lock {
737#define OFFT_OFFSET_MAX INT_LIMIT(off_t) 741#define OFFT_OFFSET_MAX INT_LIMIT(off_t)
738#endif 742#endif
739 743
740extern struct list_head file_lock_list;
741
742#include <linux/fcntl.h> 744#include <linux/fcntl.h>
743 745
744extern int fcntl_getlk(struct file *, struct flock __user *); 746extern int fcntl_getlk(struct file *, struct flock __user *);
@@ -760,10 +762,10 @@ extern void locks_init_lock(struct file_lock *);
760extern void locks_copy_lock(struct file_lock *, struct file_lock *); 762extern void locks_copy_lock(struct file_lock *, struct file_lock *);
761extern void locks_remove_posix(struct file *, fl_owner_t); 763extern void locks_remove_posix(struct file *, fl_owner_t);
762extern void locks_remove_flock(struct file *); 764extern void locks_remove_flock(struct file *);
763extern struct file_lock *posix_test_lock(struct file *, struct file_lock *); 765extern int posix_test_lock(struct file *, struct file_lock *, struct file_lock *);
766extern int posix_lock_file_conf(struct file *, struct file_lock *, struct file_lock *);
764extern int posix_lock_file(struct file *, struct file_lock *); 767extern int posix_lock_file(struct file *, struct file_lock *);
765extern int posix_lock_file_wait(struct file *, struct file_lock *); 768extern int posix_lock_file_wait(struct file *, struct file_lock *);
766extern void posix_block_lock(struct file_lock *, struct file_lock *);
767extern int posix_unblock_lock(struct file *, struct file_lock *); 769extern int posix_unblock_lock(struct file *, struct file_lock *);
768extern int posix_locks_deadlock(struct file_lock *, struct file_lock *); 770extern int posix_locks_deadlock(struct file_lock *, struct file_lock *);
769extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl); 771extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl);
@@ -1092,6 +1094,7 @@ struct super_operations {
1092 void (*umount_begin) (struct super_block *); 1094 void (*umount_begin) (struct super_block *);
1093 1095
1094 int (*show_options)(struct seq_file *, struct vfsmount *); 1096 int (*show_options)(struct seq_file *, struct vfsmount *);
1097 int (*show_stats)(struct seq_file *, struct vfsmount *);
1095 1098
1096 ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t); 1099 ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t);
1097 ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t); 1100 ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t);
@@ -1387,11 +1390,11 @@ extern void bd_set_size(struct block_device *, loff_t size);
1387extern void bd_forget(struct inode *inode); 1390extern void bd_forget(struct inode *inode);
1388extern void bdput(struct block_device *); 1391extern void bdput(struct block_device *);
1389extern struct block_device *open_by_devnum(dev_t, unsigned); 1392extern struct block_device *open_by_devnum(dev_t, unsigned);
1390extern struct file_operations def_blk_fops; 1393extern const struct file_operations def_blk_fops;
1391extern struct address_space_operations def_blk_aops; 1394extern struct address_space_operations def_blk_aops;
1392extern struct file_operations def_chr_fops; 1395extern const struct file_operations def_chr_fops;
1393extern struct file_operations bad_sock_fops; 1396extern const struct file_operations bad_sock_fops;
1394extern struct file_operations def_fifo_fops; 1397extern const struct file_operations def_fifo_fops;
1395extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long); 1398extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long);
1396extern int blkdev_ioctl(struct inode *, struct file *, unsigned, unsigned long); 1399extern int blkdev_ioctl(struct inode *, struct file *, unsigned, unsigned long);
1397extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); 1400extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long);
@@ -1399,12 +1402,19 @@ extern int blkdev_get(struct block_device *, mode_t, unsigned);
1399extern int blkdev_put(struct block_device *); 1402extern int blkdev_put(struct block_device *);
1400extern int bd_claim(struct block_device *, void *); 1403extern int bd_claim(struct block_device *, void *);
1401extern void bd_release(struct block_device *); 1404extern void bd_release(struct block_device *);
1405#ifdef CONFIG_SYSFS
1406extern int bd_claim_by_disk(struct block_device *, void *, struct gendisk *);
1407extern void bd_release_from_disk(struct block_device *, struct gendisk *);
1408#else
1409#define bd_claim_by_disk(bdev, holder, disk) bd_claim(bdev, holder)
1410#define bd_release_from_disk(bdev, disk) bd_release(bdev)
1411#endif
1402 1412
1403/* fs/char_dev.c */ 1413/* fs/char_dev.c */
1404extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, const char *); 1414extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, const char *);
1405extern int register_chrdev_region(dev_t, unsigned, const char *); 1415extern int register_chrdev_region(dev_t, unsigned, const char *);
1406extern int register_chrdev(unsigned int, const char *, 1416extern int register_chrdev(unsigned int, const char *,
1407 struct file_operations *); 1417 const struct file_operations *);
1408extern int unregister_chrdev(unsigned int, const char *); 1418extern int unregister_chrdev(unsigned int, const char *);
1409extern void unregister_chrdev_region(dev_t, unsigned); 1419extern void unregister_chrdev_region(dev_t, unsigned);
1410extern int chrdev_open(struct inode *, struct file *); 1420extern int chrdev_open(struct inode *, struct file *);
@@ -1434,9 +1444,9 @@ extern void init_special_inode(struct inode *, umode_t, dev_t);
1434extern void make_bad_inode(struct inode *); 1444extern void make_bad_inode(struct inode *);
1435extern int is_bad_inode(struct inode *); 1445extern int is_bad_inode(struct inode *);
1436 1446
1437extern struct file_operations read_fifo_fops; 1447extern const struct file_operations read_fifo_fops;
1438extern struct file_operations write_fifo_fops; 1448extern const struct file_operations write_fifo_fops;
1439extern struct file_operations rdwr_fifo_fops; 1449extern const struct file_operations rdwr_fifo_fops;
1440 1450
1441extern int fs_may_remount_ro(struct super_block *); 1451extern int fs_may_remount_ro(struct super_block *);
1442 1452
@@ -1558,7 +1568,6 @@ extern void destroy_inode(struct inode *);
1558extern struct inode *new_inode(struct super_block *); 1568extern struct inode *new_in