extern void ext2_evict_inode(struct inode *);
 extern int ext2_get_block(struct inode *, sector_t, struct buffer_head *, int);
 extern int ext2_setattr (struct dentry *, struct iattr *);
+extern int ext2_getattr (const struct path *, struct kstat *, u32, unsigned int);
 extern void ext2_set_inode_flags(struct inode *inode);
 extern int ext2_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
                       u64 start, u64 len);
 
 #ifdef CONFIG_EXT2_FS_XATTR
        .listxattr      = ext2_listxattr,
 #endif
+       .getattr        = ext2_getattr,
        .setattr        = ext2_setattr,
        .get_acl        = ext2_get_acl,
        .set_acl        = ext2_set_acl,
 
        return __ext2_write_inode(inode, wbc->sync_mode == WB_SYNC_ALL);
 }
 
+int ext2_getattr(const struct path *path, struct kstat *stat,
+               u32 request_mask, unsigned int query_falgs)
+{
+       struct inode *inode = d_inode(path->dentry);
+       struct ext2_inode_info *ei = EXT2_I(inode);
+       unsigned int flags;
+
+       flags = ei->i_flags & EXT2_FL_USER_VISIBLE;
+       if (flags & EXT2_APPEND_FL)
+               stat->attributes |= STATX_ATTR_APPEND;
+       if (flags & EXT2_COMPR_FL)
+               stat->attributes |= STATX_ATTR_COMPRESSED;
+       if (flags & EXT2_IMMUTABLE_FL)
+               stat->attributes |= STATX_ATTR_IMMUTABLE;
+       if (flags & EXT2_NODUMP_FL)
+               stat->attributes |= STATX_ATTR_NODUMP;
+       stat->attributes_mask |= (STATX_ATTR_APPEND |
+                       STATX_ATTR_COMPRESSED |
+                       STATX_ATTR_ENCRYPTED |
+                       STATX_ATTR_IMMUTABLE |
+                       STATX_ATTR_NODUMP);
+
+       generic_fillattr(inode, stat);
+       return 0;
+}
+
 int ext2_setattr(struct dentry *dentry, struct iattr *iattr)
 {
        struct inode *inode = d_inode(dentry);
 
 #ifdef CONFIG_EXT2_FS_XATTR
        .listxattr      = ext2_listxattr,
 #endif
+       .getattr        = ext2_getattr,
        .setattr        = ext2_setattr,
        .get_acl        = ext2_get_acl,
        .set_acl        = ext2_set_acl,
 #ifdef CONFIG_EXT2_FS_XATTR
        .listxattr      = ext2_listxattr,
 #endif
+       .getattr        = ext2_getattr,
        .setattr        = ext2_setattr,
        .get_acl        = ext2_get_acl,
        .set_acl        = ext2_set_acl,
 
 
 const struct inode_operations ext2_symlink_inode_operations = {
        .get_link       = page_get_link,
+       .getattr        = ext2_getattr,
        .setattr        = ext2_setattr,
 #ifdef CONFIG_EXT2_FS_XATTR
        .listxattr      = ext2_listxattr,
  
 const struct inode_operations ext2_fast_symlink_inode_operations = {
        .get_link       = simple_get_link,
+       .getattr        = ext2_getattr,
        .setattr        = ext2_setattr,
 #ifdef CONFIG_EXT2_FS_XATTR
        .listxattr      = ext2_listxattr,