fs: Give dentry to inode_change_ok() instead of inode

inode_change_ok() will be resposible for clearing capabilities and IMA
extended attributes and as such will need dentry. Give it as an argument
to inode_change_ok() instead of an inode. Also rename inode_change_ok()
to setattr_prepare() to better relect that it does also some
modifications in addition to checks.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jan Kara <jack@suse.cz>
This commit is contained in:
Jan Kara
2016-05-26 16:55:18 +02:00
bovenliggende 6249033076
commit 31051c85b5
51 gewijzigde bestanden met toevoegingen van 67 en 68 verwijderingen

Bestand weergeven

@@ -547,9 +547,7 @@ xfs_vn_change_ok(
struct dentry *dentry,
struct iattr *iattr)
{
struct inode *inode = d_inode(dentry);
struct xfs_inode *ip = XFS_I(inode);
struct xfs_mount *mp = ip->i_mount;
struct xfs_mount *mp = XFS_I(d_inode(dentry))->i_mount;
if (mp->m_flags & XFS_MOUNT_RDONLY)
return -EROFS;
@@ -557,14 +555,14 @@ xfs_vn_change_ok(
if (XFS_FORCED_SHUTDOWN(mp))
return -EIO;
return inode_change_ok(inode, iattr);
return setattr_prepare(dentry, iattr);
}
/*
* Set non-size attributes of an inode.
*
* Caution: The caller of this function is responsible for calling
* inode_change_ok() or otherwise verifying the change is fine.
* setattr_prepare() or otherwise verifying the change is fine.
*/
int
xfs_setattr_nonsize(
@@ -772,7 +770,7 @@ xfs_vn_setattr_nonsize(
* Truncate file. Must have write permission and not be a directory.
*
* Caution: The caller of this function is responsible for calling
* inode_change_ok() or otherwise verifying the change is fine.
* setattr_prepare() or otherwise verifying the change is fine.
*/
int
xfs_setattr_size(