diff options
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 40 |
1 files changed, 16 insertions, 24 deletions
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) |