Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e2cb86d7 authored by Daniel Rosenberg's avatar Daniel Rosenberg
Browse files

ANDROID: sdcardfs: Get the blocksize from the lower fs



This changes sdcardfs to be more in line with the
getattr in wrapfs, which calls the lower fs's getattr
to get the block size

Signed-off-by: default avatarDaniel Rosenberg <drosen@google.com>
Bug: 34723223
Change-Id: I1c9e16604ba580a8cdefa17f02dcc489d7351aed
parent 3fa77a42
Loading
Loading
Loading
Loading
+9 −12
Original line number Diff line number Diff line
@@ -865,9 +865,7 @@ static int sdcardfs_fillattr(struct vfsmount *mnt, struct inode *inode, struct k
static int sdcardfs_getattr(struct vfsmount *mnt, struct dentry *dentry,
		 struct kstat *stat)
{
	struct dentry *lower_dentry;
	struct inode *inode;
	struct inode *lower_inode;
	struct kstat lower_stat;
	struct path lower_path;
	struct dentry *parent;
	int err;
@@ -882,16 +880,15 @@ static int sdcardfs_getattr(struct vfsmount *mnt, struct dentry *dentry,
	}
	dput(parent);

	inode = d_inode(dentry);

	sdcardfs_get_lower_path(dentry, &lower_path);
	lower_dentry = lower_path.dentry;
	lower_inode = sdcardfs_lower_inode(inode);

	sdcardfs_copy_and_fix_attrs(inode, lower_inode);
	fsstack_copy_inode_size(inode, lower_inode);

	err = sdcardfs_fillattr(mnt, inode, stat);
	err = vfs_getattr(&lower_path, &lower_stat);
	if (err)
		goto out;
	sdcardfs_copy_and_fix_attrs(d_inode(dentry),
			      d_inode(lower_path.dentry));
	err = sdcardfs_fillattr(mnt, d_inode(dentry), stat);
	stat->blocks = lower_stat.blocks;
out:
	sdcardfs_put_lower_path(dentry, &lower_path);
	return err;
}