aboutsummaryrefslogtreecommitdiffstats
path: root/fs/9p/vfs_inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/9p/vfs_inode.c')
-rw-r--r--fs/9p/vfs_inode.c49
1 files changed, 46 insertions, 3 deletions
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index afcb8d889382..a90324f4546a 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -977,6 +977,49 @@ static int v9fs_vfs_setattr(struct dentry *dentry, struct iattr *iattr)
977} 977}
978 978
979/** 979/**
980 * v9fs_vfs_setattr_dotl - set file metadata
981 * @dentry: file whose metadata to set
982 * @iattr: metadata assignment structure
983 *
984 */
985
986static int v9fs_vfs_setattr_dotl(struct dentry *dentry, struct iattr *iattr)
987{
988 int retval;
989 struct v9fs_session_info *v9ses;
990 struct p9_fid *fid;
991 struct p9_iattr_dotl p9attr;
992
993 P9_DPRINTK(P9_DEBUG_VFS, "\n");
994
995 retval = inode_change_ok(dentry->d_inode, iattr);
996 if (retval)
997 return retval;
998
999 p9attr.valid = iattr->ia_valid;
1000 p9attr.mode = iattr->ia_mode;
1001 p9attr.uid = iattr->ia_uid;
1002 p9attr.gid = iattr->ia_gid;
1003 p9attr.size = iattr->ia_size;
1004 p9attr.atime_sec = iattr->ia_atime.tv_sec;
1005 p9attr.atime_nsec = iattr->ia_atime.tv_nsec;
1006 p9attr.mtime_sec = iattr->ia_mtime.tv_sec;
1007 p9attr.mtime_nsec = iattr->ia_mtime.tv_nsec;
1008
1009 retval = -EPERM;
1010 v9ses = v9fs_inode2v9ses(dentry->d_inode);
1011 fid = v9fs_fid_lookup(dentry);
1012 if (IS_ERR(fid))
1013 return PTR_ERR(fid);
1014
1015 retval = p9_client_setattr(fid, &p9attr);
1016 if (retval >= 0)
1017 retval = inode_setattr(dentry->d_inode, iattr);
1018
1019 return retval;
1020}
1021
1022/**
980 * v9fs_stat2inode - populate an inode structure with mistat info 1023 * v9fs_stat2inode - populate an inode structure with mistat info
981 * @stat: Plan 9 metadata (mistat) structure 1024 * @stat: Plan 9 metadata (mistat) structure
982 * @inode: inode to populate 1025 * @inode: inode to populate
@@ -1400,7 +1443,7 @@ static const struct inode_operations v9fs_dir_inode_operations_dotl = {
1400 .mknod = v9fs_vfs_mknod, 1443 .mknod = v9fs_vfs_mknod,
1401 .rename = v9fs_vfs_rename, 1444 .rename = v9fs_vfs_rename,
1402 .getattr = v9fs_vfs_getattr_dotl, 1445 .getattr = v9fs_vfs_getattr_dotl,
1403 .setattr = v9fs_vfs_setattr, 1446 .setattr = v9fs_vfs_setattr_dotl,
1404}; 1447};
1405 1448
1406static const struct inode_operations v9fs_dir_inode_operations = { 1449static const struct inode_operations v9fs_dir_inode_operations = {
@@ -1422,7 +1465,7 @@ static const struct inode_operations v9fs_file_inode_operations = {
1422 1465
1423static const struct inode_operations v9fs_file_inode_operations_dotl = { 1466static const struct inode_operations v9fs_file_inode_operations_dotl = {
1424 .getattr = v9fs_vfs_getattr_dotl, 1467 .getattr = v9fs_vfs_getattr_dotl,
1425 .setattr = v9fs_vfs_setattr, 1468 .setattr = v9fs_vfs_setattr_dotl,
1426}; 1469};
1427 1470
1428static const struct inode_operations v9fs_symlink_inode_operations = { 1471static const struct inode_operations v9fs_symlink_inode_operations = {
@@ -1438,5 +1481,5 @@ static const struct inode_operations v9fs_symlink_inode_operations_dotl = {
1438 .follow_link = v9fs_vfs_follow_link, 1481 .follow_link = v9fs_vfs_follow_link,
1439 .put_link = v9fs_vfs_put_link, 1482 .put_link = v9fs_vfs_put_link,
1440 .getattr = v9fs_vfs_getattr_dotl, 1483 .getattr = v9fs_vfs_getattr_dotl,
1441 .setattr = v9fs_vfs_setattr, 1484 .setattr = v9fs_vfs_setattr_dotl,
1442}; 1485};