diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-17 11:31:01 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-17 11:31:01 -0500 |
commit | b8a7f3cd7e8212e5c572178ff3b5a514861036a5 (patch) | |
tree | f88fd0fc83a466a6d5781f90e7ed76cb2fa0f5d7 /include | |
parent | a377d181e65241344dd95aa4a42c477477be03f1 (diff) | |
parent | eaff8079d4f1016a12e34ab323737314f24127dd (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
* 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
kill I_LOCK
fold do_sync_file_range into sys_sync_file_range
fix up O_SYNC comments
VFS/fsstack: handle 32-bit smp + preempt + large files in fsstack_copy_inode_size
fsstack/ecryptfs: remove unused get_nlinks param to fsstack_copy_attr_all
vfs: remove extraneous NULL d_inode check from do_filp_open
fs: no games with DCACHE_UNHASHED
fs: anon_inodes implement dname
dio: fix use-after-free
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-generic/fcntl.h | 2 | ||||
-rw-r--r-- | include/linux/fs.h | 40 | ||||
-rw-r--r-- | include/linux/fs_stack.h | 6 | ||||
-rw-r--r-- | include/linux/writeback.h | 3 |
4 files changed, 20 insertions, 31 deletions
diff --git a/include/asm-generic/fcntl.h b/include/asm-generic/fcntl.h index 681ddf3e844c..fcd268ce0674 100644 --- a/include/asm-generic/fcntl.h +++ b/include/asm-generic/fcntl.h | |||
@@ -51,7 +51,7 @@ | |||
51 | #endif | 51 | #endif |
52 | 52 | ||
53 | /* | 53 | /* |
54 | * Before Linux 2.6.32 only O_DSYNC semantics were implemented, but using | 54 | * Before Linux 2.6.33 only O_DSYNC semantics were implemented, but using |
55 | * the O_SYNC flag. We continue to use the existing numerical value | 55 | * the O_SYNC flag. We continue to use the existing numerical value |
56 | * for O_DSYNC semantics now, but using the correct symbolic name for it. | 56 | * for O_DSYNC semantics now, but using the correct symbolic name for it. |
57 | * This new value is used to request true Posix O_SYNC semantics. It is | 57 | * This new value is used to request true Posix O_SYNC semantics. It is |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 66bc0a54b284..cca191933ff6 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -1095,10 +1095,6 @@ struct file_lock { | |||
1095 | 1095 | ||
1096 | extern void send_sigio(struct fown_struct *fown, int fd, int band); | 1096 | extern void send_sigio(struct fown_struct *fown, int fd, int band); |
1097 | 1097 | ||
1098 | /* fs/sync.c */ | ||
1099 | extern int do_sync_mapping_range(struct address_space *mapping, loff_t offset, | ||
1100 | loff_t endbyte, unsigned int flags); | ||
1101 | |||
1102 | #ifdef CONFIG_FILE_LOCKING | 1098 | #ifdef CONFIG_FILE_LOCKING |
1103 | extern int fcntl_getlk(struct file *, struct flock __user *); | 1099 | extern int fcntl_getlk(struct file *, struct flock __user *); |
1104 | extern int fcntl_setlk(unsigned int, struct file *, unsigned int, | 1100 | extern int fcntl_setlk(unsigned int, struct file *, unsigned int, |
@@ -1591,7 +1587,7 @@ struct super_operations { | |||
1591 | * until that flag is cleared. I_WILL_FREE, I_FREEING and I_CLEAR are set at | 1587 | * until that flag is cleared. I_WILL_FREE, I_FREEING and I_CLEAR are set at |
1592 | * various stages of removing an inode. | 1588 | * various stages of removing an inode. |
1593 | * | 1589 | * |
1594 | * Two bits are used for locking and completion notification, I_LOCK and I_SYNC. | 1590 | * Two bits are used for locking and completion notification, I_NEW and I_SYNC. |
1595 | * | 1591 | * |
1596 | * I_DIRTY_SYNC Inode is dirty, but doesn't have to be written on | 1592 | * I_DIRTY_SYNC Inode is dirty, but doesn't have to be written on |
1597 | * fdatasync(). i_atime is the usual cause. | 1593 | * fdatasync(). i_atime is the usual cause. |
@@ -1600,8 +1596,14 @@ struct super_operations { | |||
1600 | * don't have to write inode on fdatasync() when only | 1596 | * don't have to write inode on fdatasync() when only |
1601 | * mtime has changed in it. | 1597 | * mtime has changed in it. |
1602 | * I_DIRTY_PAGES Inode has dirty pages. Inode itself may be clean. | 1598 | * I_DIRTY_PAGES Inode has dirty pages. Inode itself may be clean. |
1603 | * I_NEW get_new_inode() sets i_state to I_LOCK|I_NEW. Both | 1599 | * I_NEW Serves as both a mutex and completion notification. |
1604 | * are cleared by unlock_new_inode(), called from iget(). | 1600 | * New inodes set I_NEW. If two processes both create |
1601 | * the same inode, one of them will release its inode and | ||
1602 | * wait for I_NEW to be released before returning. | ||
1603 | * Inodes in I_WILL_FREE, I_FREEING or I_CLEAR state can | ||
1604 | * also cause waiting on I_NEW, without I_NEW actually | ||
1605 | * being set. find_inode() uses this to prevent returning | ||
1606 | * nearly-dead inodes. | ||
1605 | * I_WILL_FREE Must be set when calling write_inode_now() if i_count | 1607 | * I_WILL_FREE Must be set when calling write_inode_now() if i_count |
1606 | * is zero. I_FREEING must be set when I_WILL_FREE is | 1608 | * is zero. I_FREEING must be set when I_WILL_FREE is |
1607 | * cleared. | 1609 | * cleared. |
@@ -1615,20 +1617,11 @@ struct super_operations { | |||
1615 | * prohibited for many purposes. iget() must wait for | 1617 | * prohibited for many purposes. iget() must wait for |
1616 | * the inode to be completely released, then create it | 1618 | * the inode to be completely released, then create it |
1617 | * anew. Other functions will just ignore such inodes, | 1619 | * anew. Other functions will just ignore such inodes, |
1618 | * if appropriate. I_LOCK is used for waiting. | 1620 | * if appropriate. I_NEW is used for waiting. |
1619 | * | 1621 | * |
1620 | * I_LOCK Serves as both a mutex and completion notification. | 1622 | * I_SYNC Synchonized write of dirty inode data. The bits is |
1621 | * New inodes set I_LOCK. If two processes both create | 1623 | * set during data writeback, and cleared with a wakeup |
1622 | * the same inode, one of them will release its inode and | 1624 | * on the bit address once it is done. |
1623 | * wait for I_LOCK to be released before returning. | ||
1624 | * Inodes in I_WILL_FREE, I_FREEING or I_CLEAR state can | ||
1625 | * also cause waiting on I_LOCK, without I_LOCK actually | ||
1626 | * being set. find_inode() uses this to prevent returning | ||
1627 | * nearly-dead inodes. | ||
1628 | * I_SYNC Similar to I_LOCK, but limited in scope to writeback | ||
1629 | * of inode dirty data. Having a separate lock for this | ||
1630 | * purpose reduces latency and prevents some filesystem- | ||
1631 | * specific deadlocks. | ||
1632 | * | 1625 | * |
1633 | * Q: What is the difference between I_WILL_FREE and I_FREEING? | 1626 | * Q: What is the difference between I_WILL_FREE and I_FREEING? |
1634 | * Q: igrab() only checks on (I_FREEING|I_WILL_FREE). Should it also check on | 1627 | * Q: igrab() only checks on (I_FREEING|I_WILL_FREE). Should it also check on |
@@ -1637,13 +1630,12 @@ struct super_operations { | |||
1637 | #define I_DIRTY_SYNC 1 | 1630 | #define I_DIRTY_SYNC 1 |
1638 | #define I_DIRTY_DATASYNC 2 | 1631 | #define I_DIRTY_DATASYNC 2 |
1639 | #define I_DIRTY_PAGES 4 | 1632 | #define I_DIRTY_PAGES 4 |
1640 | #define I_NEW 8 | 1633 | #define __I_NEW 3 |
1634 | #define I_NEW (1 << __I_NEW) | ||
1641 | #define I_WILL_FREE 16 | 1635 | #define I_WILL_FREE 16 |
1642 | #define I_FREEING 32 | 1636 | #define I_FREEING 32 |
1643 | #define I_CLEAR 64 | 1637 | #define I_CLEAR 64 |
1644 | #define __I_LOCK 7 | 1638 | #define __I_SYNC 7 |
1645 | #define I_LOCK (1 << __I_LOCK) | ||
1646 | #define __I_SYNC 8 | ||
1647 | #define I_SYNC (1 << __I_SYNC) | 1639 | #define I_SYNC (1 << __I_SYNC) |
1648 | 1640 | ||
1649 | #define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES) | 1641 | #define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES) |
diff --git a/include/linux/fs_stack.h b/include/linux/fs_stack.h index bb516ceeefc9..da317c7163ab 100644 --- a/include/linux/fs_stack.h +++ b/include/linux/fs_stack.h | |||
@@ -8,10 +8,8 @@ | |||
8 | #include <linux/fs.h> | 8 | #include <linux/fs.h> |
9 | 9 | ||
10 | /* externs for fs/stack.c */ | 10 | /* externs for fs/stack.c */ |
11 | extern void fsstack_copy_attr_all(struct inode *dest, const struct inode *src, | 11 | extern void fsstack_copy_attr_all(struct inode *dest, const struct inode *src); |
12 | int (*get_nlinks)(struct inode *)); | 12 | extern void fsstack_copy_inode_size(struct inode *dst, struct inode *src); |
13 | |||
14 | extern void fsstack_copy_inode_size(struct inode *dst, const struct inode *src); | ||
15 | 13 | ||
16 | /* inlines */ | 14 | /* inlines */ |
17 | static inline void fsstack_copy_attr_atime(struct inode *dest, | 15 | static inline void fsstack_copy_attr_atime(struct inode *dest, |
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index 705f01fe413a..c18c008f4bbf 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
@@ -79,8 +79,7 @@ void wakeup_flusher_threads(long nr_pages); | |||
79 | static inline void wait_on_inode(struct inode *inode) | 79 | static inline void wait_on_inode(struct inode *inode) |
80 | { | 80 | { |
81 | might_sleep(); | 81 | might_sleep(); |
82 | wait_on_bit(&inode->i_state, __I_LOCK, inode_wait, | 82 | wait_on_bit(&inode->i_state, __I_NEW, inode_wait, TASK_UNINTERRUPTIBLE); |
83 | TASK_UNINTERRUPTIBLE); | ||
84 | } | 83 | } |
85 | static inline void inode_sync_wait(struct inode *inode) | 84 | static inline void inode_sync_wait(struct inode *inode) |
86 | { | 85 | { |