diff options
Diffstat (limited to 'fs/ext2/inode.c')
-rw-r--r-- | fs/ext2/inode.c | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c index e4bb9386c045..c27c27300d95 100644 --- a/fs/ext2/inode.c +++ b/fs/ext2/inode.c | |||
@@ -717,7 +717,7 @@ static int ext2_get_blocks(struct inode *inode, | |||
717 | /* the number of blocks need to allocate for [d,t]indirect blocks */ | 717 | /* the number of blocks need to allocate for [d,t]indirect blocks */ |
718 | indirect_blks = (chain + depth) - partial - 1; | 718 | indirect_blks = (chain + depth) - partial - 1; |
719 | /* | 719 | /* |
720 | * Next look up the indirect map to count the totoal number of | 720 | * Next look up the indirect map to count the total number of |
721 | * direct blocks to allocate for this branch. | 721 | * direct blocks to allocate for this branch. |
722 | */ | 722 | */ |
723 | count = ext2_blks_to_allocate(partial, indirect_blks, | 723 | count = ext2_blks_to_allocate(partial, indirect_blks, |
@@ -1239,6 +1239,7 @@ do_indirects: | |||
1239 | mark_inode_dirty(inode); | 1239 | mark_inode_dirty(inode); |
1240 | ext2_free_branches(inode, &nr, &nr+1, 1); | 1240 | ext2_free_branches(inode, &nr, &nr+1, 1); |
1241 | } | 1241 | } |
1242 | /* fall through */ | ||
1242 | case EXT2_IND_BLOCK: | 1243 | case EXT2_IND_BLOCK: |
1243 | nr = i_data[EXT2_DIND_BLOCK]; | 1244 | nr = i_data[EXT2_DIND_BLOCK]; |
1244 | if (nr) { | 1245 | if (nr) { |
@@ -1246,6 +1247,7 @@ do_indirects: | |||
1246 | mark_inode_dirty(inode); | 1247 | mark_inode_dirty(inode); |
1247 | ext2_free_branches(inode, &nr, &nr+1, 2); | 1248 | ext2_free_branches(inode, &nr, &nr+1, 2); |
1248 | } | 1249 | } |
1250 | /* fall through */ | ||
1249 | case EXT2_DIND_BLOCK: | 1251 | case EXT2_DIND_BLOCK: |
1250 | nr = i_data[EXT2_TIND_BLOCK]; | 1252 | nr = i_data[EXT2_TIND_BLOCK]; |
1251 | if (nr) { | 1253 | if (nr) { |
@@ -1635,6 +1637,32 @@ int ext2_write_inode(struct inode *inode, struct writeback_control *wbc) | |||
1635 | return __ext2_write_inode(inode, wbc->sync_mode == WB_SYNC_ALL); | 1637 | return __ext2_write_inode(inode, wbc->sync_mode == WB_SYNC_ALL); |
1636 | } | 1638 | } |
1637 | 1639 | ||
1640 | int ext2_getattr(const struct path *path, struct kstat *stat, | ||
1641 | u32 request_mask, unsigned int query_falgs) | ||
1642 | { | ||
1643 | struct inode *inode = d_inode(path->dentry); | ||
1644 | struct ext2_inode_info *ei = EXT2_I(inode); | ||
1645 | unsigned int flags; | ||
1646 | |||
1647 | flags = ei->i_flags & EXT2_FL_USER_VISIBLE; | ||
1648 | if (flags & EXT2_APPEND_FL) | ||
1649 | stat->attributes |= STATX_ATTR_APPEND; | ||
1650 | if (flags & EXT2_COMPR_FL) | ||
1651 | stat->attributes |= STATX_ATTR_COMPRESSED; | ||
1652 | if (flags & EXT2_IMMUTABLE_FL) | ||
1653 | stat->attributes |= STATX_ATTR_IMMUTABLE; | ||
1654 | if (flags & EXT2_NODUMP_FL) | ||
1655 | stat->attributes |= STATX_ATTR_NODUMP; | ||
1656 | stat->attributes_mask |= (STATX_ATTR_APPEND | | ||
1657 | STATX_ATTR_COMPRESSED | | ||
1658 | STATX_ATTR_ENCRYPTED | | ||
1659 | STATX_ATTR_IMMUTABLE | | ||
1660 | STATX_ATTR_NODUMP); | ||
1661 | |||
1662 | generic_fillattr(inode, stat); | ||
1663 | return 0; | ||
1664 | } | ||
1665 | |||
1638 | int ext2_setattr(struct dentry *dentry, struct iattr *iattr) | 1666 | int ext2_setattr(struct dentry *dentry, struct iattr *iattr) |
1639 | { | 1667 | { |
1640 | struct inode *inode = d_inode(dentry); | 1668 | struct inode *inode = d_inode(dentry); |