fs.h (2f718ffc16c43a435d12919c75dbfad518abd056) fs.h (afddba49d18f346e5cc2938b6ed7c512db18ca68)
1#ifndef _LINUX_FS_H
2#define _LINUX_FS_H
3
4/*
5 * This file has definitions for some important file table
6 * structures etc.
7 */
8

--- 380 unchanged lines hidden (view full) ---

389 * given page.
390 */
391
392enum positive_aop_returns {
393 AOP_WRITEPAGE_ACTIVATE = 0x80000,
394 AOP_TRUNCATED_PAGE = 0x80001,
395};
396
1#ifndef _LINUX_FS_H
2#define _LINUX_FS_H
3
4/*
5 * This file has definitions for some important file table
6 * structures etc.
7 */
8

--- 380 unchanged lines hidden (view full) ---

389 * given page.
390 */
391
392enum positive_aop_returns {
393 AOP_WRITEPAGE_ACTIVATE = 0x80000,
394 AOP_TRUNCATED_PAGE = 0x80001,
395};
396
397#define AOP_FLAG_UNINTERRUPTIBLE 0x0001 /* will not do a short write */
398
397/*
398 * oh the beauties of C type declarations.
399 */
400struct page;
401struct address_space;
402struct writeback_control;
403
404struct iov_iter {
405 const struct iovec *iov;
406 unsigned long nr_segs;
407 size_t iov_offset;
408 size_t count;
409};
410
411size_t iov_iter_copy_from_user_atomic(struct page *page,
412 struct iov_iter *i, unsigned long offset, size_t bytes);
413size_t iov_iter_copy_from_user(struct page *page,
414 struct iov_iter *i, unsigned long offset, size_t bytes);
415void iov_iter_advance(struct iov_iter *i, size_t bytes);
399/*
400 * oh the beauties of C type declarations.
401 */
402struct page;
403struct address_space;
404struct writeback_control;
405
406struct iov_iter {
407 const struct iovec *iov;
408 unsigned long nr_segs;
409 size_t iov_offset;
410 size_t count;
411};
412
413size_t iov_iter_copy_from_user_atomic(struct page *page,
414 struct iov_iter *i, unsigned long offset, size_t bytes);
415size_t iov_iter_copy_from_user(struct page *page,
416 struct iov_iter *i, unsigned long offset, size_t bytes);
417void iov_iter_advance(struct iov_iter *i, size_t bytes);
416int iov_iter_fault_in_readable(struct iov_iter *i);
418int iov_iter_fault_in_readable(struct iov_iter *i, size_t bytes);
417size_t iov_iter_single_seg_count(struct iov_iter *i);
418
419static inline void iov_iter_init(struct iov_iter *i,
420 const struct iovec *iov, unsigned long nr_segs,
421 size_t count, size_t written)
422{
423 i->iov = iov;
424 i->nr_segs = nr_segs;

--- 24 unchanged lines hidden (view full) ---

449 struct list_head *pages, unsigned nr_pages);
450
451 /*
452 * ext3 requires that a successful prepare_write() call be followed
453 * by a commit_write() call - they must be balanced
454 */
455 int (*prepare_write)(struct file *, struct page *, unsigned, unsigned);
456 int (*commit_write)(struct file *, struct page *, unsigned, unsigned);
419size_t iov_iter_single_seg_count(struct iov_iter *i);
420
421static inline void iov_iter_init(struct iov_iter *i,
422 const struct iovec *iov, unsigned long nr_segs,
423 size_t count, size_t written)
424{
425 i->iov = iov;
426 i->nr_segs = nr_segs;

--- 24 unchanged lines hidden (view full) ---

451 struct list_head *pages, unsigned nr_pages);
452
453 /*
454 * ext3 requires that a successful prepare_write() call be followed
455 * by a commit_write() call - they must be balanced
456 */
457 int (*prepare_write)(struct file *, struct page *, unsigned, unsigned);
458 int (*commit_write)(struct file *, struct page *, unsigned, unsigned);
459
460 int (*write_begin)(struct file *, struct address_space *mapping,
461 loff_t pos, unsigned len, unsigned flags,
462 struct page **pagep, void **fsdata);
463 int (*write_end)(struct file *, struct address_space *mapping,
464 loff_t pos, unsigned len, unsigned copied,
465 struct page *page, void *fsdata);
466
457 /* Unfortunately this kludge is needed for FIBMAP. Don't use it */
458 sector_t (*bmap)(struct address_space *, sector_t);
459 void (*invalidatepage) (struct page *, unsigned long);
460 int (*releasepage) (struct page *, gfp_t);
461 ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov,
462 loff_t offset, unsigned long nr_segs);
463 struct page* (*get_xip_page)(struct address_space *, sector_t,
464 int);
465 /* migrate the contents of a page to the specified target */
466 int (*migratepage) (struct address_space *,
467 struct page *, struct page *);
468 int (*launder_page) (struct page *);
469};
470
467 /* Unfortunately this kludge is needed for FIBMAP. Don't use it */
468 sector_t (*bmap)(struct address_space *, sector_t);
469 void (*invalidatepage) (struct page *, unsigned long);
470 int (*releasepage) (struct page *, gfp_t);
471 ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov,
472 loff_t offset, unsigned long nr_segs);
473 struct page* (*get_xip_page)(struct address_space *, sector_t,
474 int);
475 /* migrate the contents of a page to the specified target */
476 int (*migratepage) (struct address_space *,
477 struct page *, struct page *);
478 int (*launder_page) (struct page *);
479};
480
481/*
482 * pagecache_write_begin/pagecache_write_end must be used by general code
483 * to write into the pagecache.
484 */
485int pagecache_write_begin(struct file *, struct address_space *mapping,
486 loff_t pos, unsigned len, unsigned flags,
487 struct page **pagep, void **fsdata);
488
489int pagecache_write_end(struct file *, struct address_space *mapping,
490 loff_t pos, unsigned len, unsigned copied,
491 struct page *page, void *fsdata);
492
471struct backing_dev_info;
472struct address_space {
473 struct inode *host; /* owner: inode, block_device */
474 struct radix_tree_root page_tree; /* radix tree of all pages */
475 rwlock_t tree_lock; /* and rwlock protecting it */
476 unsigned int i_mmap_writable;/* count VM_SHARED mappings */
477 struct prio_tree_root i_mmap; /* tree of private and shared mappings */
478 struct list_head i_mmap_nonlinear;/*list VM_NONLINEAR mappings */

--- 1382 unchanged lines hidden (view full) ---

1861extern int simple_rename(struct inode *, struct dentry *, struct inode *, struct dentry *);
1862extern int simple_sync_file(struct file *, struct dentry *, int);
1863extern int simple_empty(struct dentry *);
1864extern int simple_readpage(struct file *file, struct page *page);
1865extern int simple_prepare_write(struct file *file, struct page *page,
1866 unsigned offset, unsigned to);
1867extern int simple_commit_write(struct file *file, struct page *page,
1868 unsigned offset, unsigned to);
493struct backing_dev_info;
494struct address_space {
495 struct inode *host; /* owner: inode, block_device */
496 struct radix_tree_root page_tree; /* radix tree of all pages */
497 rwlock_t tree_lock; /* and rwlock protecting it */
498 unsigned int i_mmap_writable;/* count VM_SHARED mappings */
499 struct prio_tree_root i_mmap; /* tree of private and shared mappings */
500 struct list_head i_mmap_nonlinear;/*list VM_NONLINEAR mappings */

--- 1382 unchanged lines hidden (view full) ---

1883extern int simple_rename(struct inode *, struct dentry *, struct inode *, struct dentry *);
1884extern int simple_sync_file(struct file *, struct dentry *, int);
1885extern int simple_empty(struct dentry *);
1886extern int simple_readpage(struct file *file, struct page *page);
1887extern int simple_prepare_write(struct file *file, struct page *page,
1888 unsigned offset, unsigned to);
1889extern int simple_commit_write(struct file *file, struct page *page,
1890 unsigned offset, unsigned to);
1891extern int simple_write_begin(struct file *file, struct address_space *mapping,
1892 loff_t pos, unsigned len, unsigned flags,
1893 struct page **pagep, void **fsdata);
1894extern int simple_write_end(struct file *file, struct address_space *mapping,
1895 loff_t pos, unsigned len, unsigned copied,
1896 struct page *page, void *fsdata);
1869
1870extern struct dentry *simple_lookup(struct inode *, struct dentry *, struct nameidata *);
1871extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *);
1872extern const struct file_operations simple_dir_operations;
1873extern const struct inode_operations simple_dir_inode_operations;
1874struct tree_descr { char *name; const struct file_operations *ops; int mode; };
1875struct dentry *d_alloc_name(struct dentry *, const char *);
1876extern int simple_fill_super(struct super_block *, int, struct tree_descr *);

--- 135 unchanged lines hidden ---
1897
1898extern struct dentry *simple_lookup(struct inode *, struct dentry *, struct nameidata *);
1899extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *);
1900extern const struct file_operations simple_dir_operations;
1901extern const struct inode_operations simple_dir_inode_operations;
1902struct tree_descr { char *name; const struct file_operations *ops; int mode; };
1903struct dentry *d_alloc_name(struct dentry *, const char *);
1904extern int simple_fill_super(struct super_block *, int, struct tree_descr *);

--- 135 unchanged lines hidden ---