diff options
Diffstat (limited to 'fs/logfs/readwrite.c')
-rw-r--r-- | fs/logfs/readwrite.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/fs/logfs/readwrite.c b/fs/logfs/readwrite.c index 7a23b3e7c0a7..bff40253dfb2 100644 --- a/fs/logfs/readwrite.c +++ b/fs/logfs/readwrite.c | |||
@@ -18,6 +18,7 @@ | |||
18 | */ | 18 | */ |
19 | #include "logfs.h" | 19 | #include "logfs.h" |
20 | #include <linux/sched.h> | 20 | #include <linux/sched.h> |
21 | #include <linux/slab.h> | ||
21 | 22 | ||
22 | static u64 adjust_bix(u64 bix, level_t level) | 23 | static u64 adjust_bix(u64 bix, level_t level) |
23 | { | 24 | { |
@@ -1594,7 +1595,6 @@ int logfs_delete(struct inode *inode, pgoff_t index, | |||
1594 | return ret; | 1595 | return ret; |
1595 | } | 1596 | } |
1596 | 1597 | ||
1597 | /* Rewrite cannot mark the inode dirty but has to write it immediatly. */ | ||
1598 | int logfs_rewrite_block(struct inode *inode, u64 bix, u64 ofs, | 1598 | int logfs_rewrite_block(struct inode *inode, u64 bix, u64 ofs, |
1599 | gc_level_t gc_level, long flags) | 1599 | gc_level_t gc_level, long flags) |
1600 | { | 1600 | { |
@@ -1611,6 +1611,18 @@ int logfs_rewrite_block(struct inode *inode, u64 bix, u64 ofs, | |||
1611 | if (level != 0) | 1611 | if (level != 0) |
1612 | alloc_indirect_block(inode, page, 0); | 1612 | alloc_indirect_block(inode, page, 0); |
1613 | err = logfs_write_buf(inode, page, flags); | 1613 | err = logfs_write_buf(inode, page, flags); |
1614 | if (!err && shrink_level(gc_level) == 0) { | ||
1615 | /* Rewrite cannot mark the inode dirty but has to | ||
1616 | * write it immediatly. | ||
1617 | * Q: Can't we just create an alias for the inode | ||
1618 | * instead? And if not, why not? | ||
1619 | */ | ||
1620 | if (inode->i_ino == LOGFS_INO_MASTER) | ||
1621 | logfs_write_anchor(inode->i_sb); | ||
1622 | else { | ||
1623 | err = __logfs_write_inode(inode, flags); | ||
1624 | } | ||
1625 | } | ||
1614 | } | 1626 | } |
1615 | logfs_put_write_page(page); | 1627 | logfs_put_write_page(page); |
1616 | return err; | 1628 | return err; |