diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-24 11:32:11 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-24 11:32:11 -0400 |
commit | 6c5daf012c9155aafd2c7973e4278766c30dfad0 (patch) | |
tree | 33959d7b36d03e1610615641a2940cb2de5e8603 /include/linux | |
parent | 6d39b27f0ac7e805ae3bd9efa51d7da04bec0360 (diff) | |
parent | c08d3b0e33edce28e9cfa7b64f7fe5bdeeb29248 (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:
truncate: use new helpers
truncate: new helpers
fs: fix overflow in sys_mount() for in-kernel calls
fs: Make unload_nls() NULL pointer safe
freeze_bdev: grab active reference to frozen superblocks
freeze_bdev: kill bd_mount_sem
exofs: remove BKL from super operations
fs/romfs: correct error-handling code
vfs: seq_file: add helpers for data filling
vfs: remove redundant position check in do_sendfile
vfs: change sb->s_maxbytes to a loff_t
vfs: explicitly cast s_maxbytes in fiemap_check_ranges
libfs: return error code on failed attr set
seq_file: return a negative error code when seq_path_root() fails.
vfs: optimize touch_time() too
vfs: optimization for touch_atime()
vfs: split generic_forget_inode() so that hugetlbfs does not have to copy it
fs/inode.c: add dev-id and inode number for debugging in init_special_inode()
libfs: make simple_read_from_buffer conventional
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/fs.h | 8 | ||||
-rw-r--r-- | include/linux/mm.h | 5 | ||||
-rw-r--r-- | include/linux/seq_file.h | 38 |
3 files changed, 46 insertions, 5 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 78e95b8b66d4..2adaa2529f18 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -641,7 +641,6 @@ struct block_device { | |||
641 | struct super_block * bd_super; | 641 | struct super_block * bd_super; |
642 | int bd_openers; | 642 | int bd_openers; |
643 | struct mutex bd_mutex; /* open/close mutex */ | 643 | struct mutex bd_mutex; /* open/close mutex */ |
644 | struct semaphore bd_mount_sem; | ||
645 | struct list_head bd_inodes; | 644 | struct list_head bd_inodes; |
646 | void * bd_holder; | 645 | void * bd_holder; |
647 | int bd_holders; | 646 | int bd_holders; |
@@ -1316,7 +1315,7 @@ struct super_block { | |||
1316 | unsigned long s_blocksize; | 1315 | unsigned long s_blocksize; |
1317 | unsigned char s_blocksize_bits; | 1316 | unsigned char s_blocksize_bits; |
1318 | unsigned char s_dirt; | 1317 | unsigned char s_dirt; |
1319 | unsigned long long s_maxbytes; /* Max file size */ | 1318 | loff_t s_maxbytes; /* Max file size */ |
1320 | struct file_system_type *s_type; | 1319 | struct file_system_type *s_type; |
1321 | const struct super_operations *s_op; | 1320 | const struct super_operations *s_op; |
1322 | const struct dquot_operations *dq_op; | 1321 | const struct dquot_operations *dq_op; |
@@ -2157,6 +2156,7 @@ extern ino_t iunique(struct super_block *, ino_t); | |||
2157 | extern int inode_needs_sync(struct inode *inode); | 2156 | extern int inode_needs_sync(struct inode *inode); |
2158 | extern void generic_delete_inode(struct inode *inode); | 2157 | extern void generic_delete_inode(struct inode *inode); |
2159 | extern void generic_drop_inode(struct inode *inode); | 2158 | extern void generic_drop_inode(struct inode *inode); |
2159 | extern int generic_detach_inode(struct inode *inode); | ||
2160 | 2160 | ||
2161 | extern struct inode *ilookup5_nowait(struct super_block *sb, | 2161 | extern struct inode *ilookup5_nowait(struct super_block *sb, |
2162 | unsigned long hashval, int (*test)(struct inode *, void *), | 2162 | unsigned long hashval, int (*test)(struct inode *, void *), |
@@ -2335,6 +2335,7 @@ extern void get_filesystem(struct file_system_type *fs); | |||
2335 | extern void put_filesystem(struct file_system_type *fs); | 2335 | extern void put_filesystem(struct file_system_type *fs); |
2336 | extern struct file_system_type *get_fs_type(const char *name); | 2336 | extern struct file_system_type *get_fs_type(const char *name); |
2337 | extern struct super_block *get_super(struct block_device *); | 2337 | extern struct super_block *get_super(struct block_device *); |
2338 | extern struct super_block *get_active_super(struct block_device *bdev); | ||
2338 | extern struct super_block *user_get_super(dev_t); | 2339 | extern struct super_block *user_get_super(dev_t); |
2339 | extern void drop_super(struct super_block *sb); | 2340 | extern void drop_super(struct super_block *sb); |
2340 | 2341 | ||
@@ -2382,7 +2383,8 @@ extern int buffer_migrate_page(struct address_space *, | |||
2382 | #define buffer_migrate_page NULL | 2383 | #define buffer_migrate_page NULL |
2383 | #endif | 2384 | #endif |
2384 | 2385 | ||
2385 | extern int inode_change_ok(struct inode *, struct iattr *); | 2386 | extern int inode_change_ok(const struct inode *, struct iattr *); |
2387 | extern int inode_newsize_ok(const struct inode *, loff_t offset); | ||
2386 | extern int __must_check inode_setattr(struct inode *, struct iattr *); | 2388 | extern int __must_check inode_setattr(struct inode *, struct iattr *); |
2387 | 2389 | ||
2388 | extern void file_update_time(struct file *file); | 2390 | extern void file_update_time(struct file *file); |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 6953a5a53e44..df08551cb0ad 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -792,8 +792,9 @@ static inline void unmap_shared_mapping_range(struct address_space *mapping, | |||
792 | unmap_mapping_range(mapping, holebegin, holelen, 0); | 792 | unmap_mapping_range(mapping, holebegin, holelen, 0); |
793 | } | 793 | } |
794 | 794 | ||
795 | extern int vmtruncate(struct inode * inode, loff_t offset); | 795 | extern void truncate_pagecache(struct inode *inode, loff_t old, loff_t new); |
796 | extern int vmtruncate_range(struct inode * inode, loff_t offset, loff_t end); | 796 | extern int vmtruncate(struct inode *inode, loff_t offset); |
797 | extern int vmtruncate_range(struct inode *inode, loff_t offset, loff_t end); | ||
797 | 798 | ||
798 | int truncate_inode_page(struct address_space *mapping, struct page *page); | 799 | int truncate_inode_page(struct address_space *mapping, struct page *page); |
799 | int generic_error_remove_page(struct address_space *mapping, struct page *page); | 800 | int generic_error_remove_page(struct address_space *mapping, struct page *page); |
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h index 0c6a86b79596..8366d8f12e53 100644 --- a/include/linux/seq_file.h +++ b/include/linux/seq_file.h | |||
@@ -35,6 +35,44 @@ struct seq_operations { | |||
35 | 35 | ||
36 | #define SEQ_SKIP 1 | 36 | #define SEQ_SKIP 1 |
37 | 37 | ||
38 | /** | ||
39 | * seq_get_buf - get buffer to write arbitrary data to | ||
40 | * @m: the seq_file handle | ||
41 | * @bufp: the beginning of the buffer is stored here | ||
42 | * | ||
43 | * Return the number of bytes available in the buffer, or zero if | ||
44 | * there's no space. | ||
45 | */ | ||
46 | static inline size_t seq_get_buf(struct seq_file *m, char **bufp) | ||
47 | { | ||
48 | BUG_ON(m->count > m->size); | ||
49 | if (m->count < m->size) | ||
50 | *bufp = m->buf + m->count; | ||
51 | else | ||
52 | *bufp = NULL; | ||
53 | |||
54 | return m->size - m->count; | ||
55 | } | ||
56 | |||
57 | /** | ||
58 | * seq_commit - commit data to the buffer | ||
59 | * @m: the seq_file handle | ||
60 | * @num: the number of bytes to commit | ||
61 | * | ||
62 | * Commit @num bytes of data written to a buffer previously acquired | ||
63 | * by seq_buf_get. To signal an error condition, or that the data | ||
64 | * didn't fit in the available space, pass a negative @num value. | ||
65 | */ | ||
66 | static inline void seq_commit(struct seq_file *m, int num) | ||
67 | { | ||
68 | if (num < 0) { | ||
69 | m->count = m->size; | ||
70 | } else { | ||
71 | BUG_ON(m->count + num > m->size); | ||
72 | m->count += num; | ||
73 | } | ||
74 | } | ||
75 | |||
38 | char *mangle_path(char *s, char *p, char *esc); | 76 | char *mangle_path(char *s, char *p, char *esc); |
39 | int seq_open(struct file *, const struct seq_operations *); | 77 | int seq_open(struct file *, const struct seq_operations *); |
40 | ssize_t seq_read(struct file *, char __user *, size_t, loff_t *); | 78 | ssize_t seq_read(struct file *, char __user *, size_t, loff_t *); |