aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/fs.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-02-17 11:38:30 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-02-17 11:38:30 -0500
commitc397f8fa4379040bada53256c848e62c8b060392 (patch)
tree8101efb5c0c3b0a73e5e65f3474843c0914cc4d0 /include/linux/fs.h
parent796e1c55717e9a6ff5c81b12289ffa1ffd919b6f (diff)
parentaaaf5fbf56f16c81a653713cc333b18ad6e25ea9 (diff)
Merge branch 'akpm' (patches from Andrew)
Merge fifth set of updates from Andrew Morton: - A few things which were awaiting merges from linux-next: - rtc - ocfs2 - misc others - Willy's "dax" feature: direct fs access to memory (mainly NV-DIMMs) which isn't backed by pageframes. * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (37 commits) rtc: add driver for DS1685 family of real time clocks MAINTAINERS: add entry for Maxim PMICs on Samsung boards lib/Kconfig: use bool instead of boolean powerpc: drop _PAGE_FILE and pte_file()-related helpers ocfs2: set append dio as a ro compat feature ocfs2: wait for orphan recovery first once append O_DIRECT write crash ocfs2: complete the rest request through buffer io ocfs2: do not fallback to buffer I/O write if appending ocfs2: allocate blocks in ocfs2_direct_IO_get_blocks ocfs2: implement ocfs2_direct_IO_write ocfs2: add orphan recovery types in ocfs2_recover_orphans ocfs2: add functions to add and remove inode in orphan dir ocfs2: prepare some interfaces used in append direct io MAINTAINERS: fix spelling mistake & remove trailing WS dax: does not work correctly with virtual aliasing caches brd: rename XIP to DAX ext4: add DAX functionality dax: add dax_zero_page_range ext2: get rid of most mentions of XIP in ext2 ext2: remove ext2_aops_xip ...
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r--include/linux/fs.h34
1 files changed, 19 insertions, 15 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index e49f10cc8a73..ed5a0900b94d 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -51,6 +51,7 @@ struct swap_info_struct;
51struct seq_file; 51struct seq_file;
52struct workqueue_struct; 52struct workqueue_struct;
53struct iov_iter; 53struct iov_iter;
54struct vm_fault;
54 55
55extern void __init inode_init(void); 56extern void __init inode_init(void);
56extern void __init inode_init_early(void); 57extern void __init inode_init_early(void);
@@ -361,8 +362,6 @@ struct address_space_operations {
361 int (*releasepage) (struct page *, gfp_t); 362 int (*releasepage) (struct page *, gfp_t);
362 void (*freepage)(struct page *); 363 void (*freepage)(struct page *);
363 ssize_t (*direct_IO)(int, struct kiocb *, struct iov_iter *iter, loff_t offset); 364 ssize_t (*direct_IO)(int, struct kiocb *, struct iov_iter *iter, loff_t offset);
364 int (*get_xip_mem)(struct address_space *, pgoff_t, int,
365 void **, unsigned long *);
366 /* 365 /*
367 * migrate the contents of a page to the specified target. If 366 * migrate the contents of a page to the specified target. If
368 * migrate_mode is MIGRATE_ASYNC, it must not block. 367 * migrate_mode is MIGRATE_ASYNC, it must not block.
@@ -1677,6 +1676,11 @@ struct super_operations {
1677#define S_IMA 1024 /* Inode has an associated IMA struct */ 1676#define S_IMA 1024 /* Inode has an associated IMA struct */
1678#define S_AUTOMOUNT 2048 /* Automount/referral quasi-directory */ 1677#define S_AUTOMOUNT 2048 /* Automount/referral quasi-directory */
1679#define S_NOSEC 4096 /* no suid or xattr security attributes */ 1678#define S_NOSEC 4096 /* no suid or xattr security attributes */
1679#ifdef CONFIG_FS_DAX
1680#define S_DAX 8192 /* Direct Access, avoiding the page cache */
1681#else
1682#define S_DAX 0 /* Make all the DAX code disappear */
1683#endif
1680 1684
1681/* 1685/*
1682 * Note that nosuid etc flags are inode-specific: setting some file-system 1686 * Note that nosuid etc flags are inode-specific: setting some file-system
@@ -1714,6 +1718,7 @@ struct super_operations {
1714#define IS_IMA(inode) ((inode)->i_flags & S_IMA) 1718#define IS_IMA(inode) ((inode)->i_flags & S_IMA)
1715#define IS_AUTOMOUNT(inode) ((inode)->i_flags & S_AUTOMOUNT) 1719#define IS_AUTOMOUNT(inode) ((inode)->i_flags & S_AUTOMOUNT)
1716#define IS_NOSEC(inode) ((inode)->i_flags & S_NOSEC) 1720#define IS_NOSEC(inode) ((inode)->i_flags & S_NOSEC)
1721#define IS_DAX(inode) ((inode)->i_flags & S_DAX)
1717 1722
1718#define IS_WHITEOUT(inode) (S_ISCHR(inode->i_mode) && \ 1723#define IS_WHITEOUT(inode) (S_ISCHR(inode->i_mode) && \
1719 (inode)->i_rdev == WHITEOUT_DEV) 1724 (inode)->i_rdev == WHITEOUT_DEV)
@@ -2581,19 +2586,13 @@ extern loff_t fixed_size_llseek(struct file *file, loff_t offset,
2581extern int generic_file_open(struct inode * inode, struct file * filp); 2586extern int generic_file_open(struct inode * inode, struct file * filp);
2582extern int nonseekable_open(struct inode * inode, struct file * filp); 2587extern int nonseekable_open(struct inode * inode, struct file * filp);
2583 2588
2584#ifdef CONFIG_FS_XIP 2589ssize_t dax_do_io(int rw, struct kiocb *, struct inode *, struct iov_iter *,
2585extern ssize_t xip_file_read(struct file *filp, char __user *buf, size_t len, 2590 loff_t, get_block_t, dio_iodone_t, int flags);
2586 loff_t *ppos); 2591int dax_clear_blocks(struct inode *, sector_t block, long size);
2587extern int xip_file_mmap(struct file * file, struct vm_area_struct * vma); 2592int dax_zero_page_range(struct inode *, loff_t from, unsigned len, get_block_t);
2588extern ssize_t xip_file_write(struct file *filp, const char __user *buf, 2593int dax_truncate_page(struct inode *, loff_t from, get_block_t);
2589 size_t len, loff_t *ppos); 2594int dax_fault(struct vm_area_struct *, struct vm_fault *, get_block_t);
2590extern int xip_truncate_page(struct address_space *mapping, loff_t from); 2595#define dax_mkwrite(vma, vmf, gb) dax_fault(vma, vmf, gb)
2591#else
2592static inline int xip_truncate_page(struct address_space *mapping, loff_t from)
2593{
2594 return 0;
2595}
2596#endif
2597 2596
2598#ifdef CONFIG_BLOCK 2597#ifdef CONFIG_BLOCK
2599typedef void (dio_submit_t)(int rw, struct bio *bio, struct inode *inode, 2598typedef void (dio_submit_t)(int rw, struct bio *bio, struct inode *inode,
@@ -2750,6 +2749,11 @@ extern int generic_show_options(struct seq_file *m, struct dentry *root);
2750extern void save_mount_options(struct super_block *sb, char *options); 2749extern void save_mount_options(struct super_block *sb, char *options);
2751extern void replace_mount_options(struct super_block *sb, char *options); 2750extern void replace_mount_options(struct super_block *sb, char *options);
2752 2751
2752static inline bool io_is_direct(struct file *filp)
2753{
2754 return (filp->f_flags & O_DIRECT) || IS_DAX(file_inode(filp));
2755}
2756
2753static inline ino_t parent_ino(struct dentry *dentry) 2757static inline ino_t parent_ino(struct dentry *dentry)
2754{ 2758{
2755 ino_t res; 2759 ino_t res;