diff options
author | Christoph Hellwig <hch@lst.de> | 2009-12-17 08:25:01 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2009-12-17 11:03:25 -0500 |
commit | eaff8079d4f1016a12e34ab323737314f24127dd (patch) | |
tree | a3d9e00320c6195e55811d5247a521f99341a411 /include/linux/fs.h | |
parent | 7a0ad10c367ab57c899d340372f37880cbe6ab52 (diff) |
kill I_LOCK
After I_SYNC was split from I_LOCK the leftover is always used together with
I_NEW and thus superflous.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 77a975089d9a..cca191933ff6 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -1587,7 +1587,7 @@ struct super_operations { | |||
1587 | * 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 |
1588 | * various stages of removing an inode. | 1588 | * various stages of removing an inode. |
1589 | * | 1589 | * |
1590 | * 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. |
1591 | * | 1591 | * |
1592 | * 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 |
1593 | * fdatasync(). i_atime is the usual cause. | 1593 | * fdatasync(). i_atime is the usual cause. |
@@ -1596,8 +1596,14 @@ struct super_operations { | |||
1596 | * don't have to write inode on fdatasync() when only | 1596 | * don't have to write inode on fdatasync() when only |
1597 | * mtime has changed in it. | 1597 | * mtime has changed in it. |
1598 | * 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. |
1599 | * 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. |
1600 | * 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. | ||
1601 | * 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 |
1602 | * 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 |
1603 | * cleared. | 1609 | * cleared. |
@@ -1611,20 +1617,11 @@ struct super_operations { | |||
1611 | * prohibited for many purposes. iget() must wait for | 1617 | * prohibited for many purposes. iget() must wait for |
1612 | * the inode to be completely released, then create it | 1618 | * the inode to be completely released, then create it |
1613 | * anew. Other functions will just ignore such inodes, | 1619 | * anew. Other functions will just ignore such inodes, |
1614 | * if appropriate. I_LOCK is used for waiting. | 1620 | * if appropriate. I_NEW is used for waiting. |
1615 | * | 1621 | * |
1616 | * I_LOCK Serves as both a mutex and completion notification. | 1622 | * I_SYNC Synchonized write of dirty inode data. The bits is |
1617 | * New inodes set I_LOCK. If two processes both create | 1623 | * set during data writeback, and cleared with a wakeup |
1618 | * the same inode, one of them will release its inode and | 1624 | * on the bit address once it is done. |
1619 | * wait for I_LOCK to be released before returning. | ||
1620 | * Inodes in I_WILL_FREE, I_FREEING or I_CLEAR state can | ||
1621 | * also cause waiting on I_LOCK, without I_LOCK actually | ||
1622 | * being set. find_inode() uses this to prevent returning | ||
1623 | * nearly-dead inodes. | ||
1624 | * I_SYNC Similar to I_LOCK, but limited in scope to writeback | ||
1625 | * of inode dirty data. Having a separate lock for this | ||
1626 | * purpose reduces latency and prevents some filesystem- | ||
1627 | * specific deadlocks. | ||
1628 | * | 1625 | * |
1629 | * 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? |
1630 | * 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 |
@@ -1633,13 +1630,12 @@ struct super_operations { | |||
1633 | #define I_DIRTY_SYNC 1 | 1630 | #define I_DIRTY_SYNC 1 |
1634 | #define I_DIRTY_DATASYNC 2 | 1631 | #define I_DIRTY_DATASYNC 2 |
1635 | #define I_DIRTY_PAGES 4 | 1632 | #define I_DIRTY_PAGES 4 |
1636 | #define I_NEW 8 | 1633 | #define __I_NEW 3 |
1634 | #define I_NEW (1 << __I_NEW) | ||
1637 | #define I_WILL_FREE 16 | 1635 | #define I_WILL_FREE 16 |
1638 | #define I_FREEING 32 | 1636 | #define I_FREEING 32 |
1639 | #define I_CLEAR 64 | 1637 | #define I_CLEAR 64 |
1640 | #define __I_LOCK 7 | 1638 | #define __I_SYNC 7 |
1641 | #define I_LOCK (1 << __I_LOCK) | ||
1642 | #define __I_SYNC 8 | ||
1643 | #define I_SYNC (1 << __I_SYNC) | 1639 | #define I_SYNC (1 << __I_SYNC) |
1644 | 1640 | ||
1645 | #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) |