aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/fs.h8
-rw-r--r--include/linux/mm.h5
-rw-r--r--include/linux/seq_file.h38
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);
2157extern int inode_needs_sync(struct inode *inode); 2156extern int inode_needs_sync(struct inode *inode);
2158extern void generic_delete_inode(struct inode *inode); 2157extern void generic_delete_inode(struct inode *inode);
2159extern void generic_drop_inode(struct inode *inode); 2158extern void generic_drop_inode(struct inode *inode);
2159extern int generic_detach_inode(struct inode *inode);
2160 2160
2161extern struct inode *ilookup5_nowait(struct super_block *sb, 2161extern 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);
2335extern void put_filesystem(struct file_system_type *fs); 2335extern void put_filesystem(struct file_system_type *fs);
2336extern struct file_system_type *get_fs_type(const char *name); 2336extern struct file_system_type *get_fs_type(const char *name);
2337extern struct super_block *get_super(struct block_device *); 2337extern struct super_block *get_super(struct block_device *);
2338extern struct super_block *get_active_super(struct block_device *bdev);
2338extern struct super_block *user_get_super(dev_t); 2339extern struct super_block *user_get_super(dev_t);
2339extern void drop_super(struct super_block *sb); 2340extern 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
2385extern int inode_change_ok(struct inode *, struct iattr *); 2386extern int inode_change_ok(const struct inode *, struct iattr *);
2387extern int inode_newsize_ok(const struct inode *, loff_t offset);
2386extern int __must_check inode_setattr(struct inode *, struct iattr *); 2388extern int __must_check inode_setattr(struct inode *, struct iattr *);
2387 2389
2388extern void file_update_time(struct file *file); 2390extern 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
795extern int vmtruncate(struct inode * inode, loff_t offset); 795extern void truncate_pagecache(struct inode *inode, loff_t old, loff_t new);
796extern int vmtruncate_range(struct inode * inode, loff_t offset, loff_t end); 796extern int vmtruncate(struct inode *inode, loff_t offset);
797extern int vmtruncate_range(struct inode *inode, loff_t offset, loff_t end);
797 798
798int truncate_inode_page(struct address_space *mapping, struct page *page); 799int truncate_inode_page(struct address_space *mapping, struct page *page);
799int generic_error_remove_page(struct address_space *mapping, struct page *page); 800int 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 */
46static 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 */
66static 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
38char *mangle_path(char *s, char *p, char *esc); 76char *mangle_path(char *s, char *p, char *esc);
39int seq_open(struct file *, const struct seq_operations *); 77int seq_open(struct file *, const struct seq_operations *);
40ssize_t seq_read(struct file *, char __user *, size_t, loff_t *); 78ssize_t seq_read(struct file *, char __user *, size_t, loff_t *);