inode.c (552c69b36ebd966186573b9c7a286b390935cce1) inode.c (2f221d6f7b881d95de1f356a3097d755ab1e47d4)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * linux/fs/ufs/inode.c
4 *
5 * Copyright (C) 1998
6 * Daniel Pirkl <daniel.pirkl@email.cz>
7 * Charles University, Faculty of Mathematics and Physics
8 *

--- 1203 unchanged lines hidden (view full) ---

1212}
1213
1214int ufs_setattr(struct dentry *dentry, struct iattr *attr)
1215{
1216 struct inode *inode = d_inode(dentry);
1217 unsigned int ia_valid = attr->ia_valid;
1218 int error;
1219
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * linux/fs/ufs/inode.c
4 *
5 * Copyright (C) 1998
6 * Daniel Pirkl <daniel.pirkl@email.cz>
7 * Charles University, Faculty of Mathematics and Physics
8 *

--- 1203 unchanged lines hidden (view full) ---

1212}
1213
1214int ufs_setattr(struct dentry *dentry, struct iattr *attr)
1215{
1216 struct inode *inode = d_inode(dentry);
1217 unsigned int ia_valid = attr->ia_valid;
1218 int error;
1219
1220 error = setattr_prepare(dentry, attr);
1220 error = setattr_prepare(&init_user_ns, dentry, attr);
1221 if (error)
1222 return error;
1223
1224 if (ia_valid & ATTR_SIZE && attr->ia_size != inode->i_size) {
1225 error = ufs_truncate(inode, attr->ia_size);
1226 if (error)
1227 return error;
1228 }
1229
1221 if (error)
1222 return error;
1223
1224 if (ia_valid & ATTR_SIZE && attr->ia_size != inode->i_size) {
1225 error = ufs_truncate(inode, attr->ia_size);
1226 if (error)
1227 return error;
1228 }
1229
1230 setattr_copy(inode, attr);
1230 setattr_copy(&init_user_ns, inode, attr);
1231 mark_inode_dirty(inode);
1232 return 0;
1233}
1234
1235const struct inode_operations ufs_file_inode_operations = {
1236 .setattr = ufs_setattr,
1237};
1231 mark_inode_dirty(inode);
1232 return 0;
1233}
1234
1235const struct inode_operations ufs_file_inode_operations = {
1236 .setattr = ufs_setattr,
1237};