summaryrefslogtreecommitdiff
path: root/fs/9p
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2011-12-18 23:03:13 +0530
committerEric Van Hensbergen <ericvh@gmail.com>2012-01-06 10:26:07 -0600
commitf766619db2be059cd0dbba8a36176fe01a29d588 (patch)
tree5c2f824bec85ef3515c801c4e68b94155d6b22b2 /fs/9p
parentb6054793069bf08fcf220fff5fb33735d5493594 (diff)
fs/9p: iattr_valid flags are kernel internal flags map them to 9p values.
Kernel internal values can change, add protocol values for these constant and use them. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'fs/9p')
-rw-r--r--fs/9p/vfs_inode_dotl.c42
1 files changed, 41 insertions, 1 deletions
diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c
index 73488fb69d38..7ca7171273d1 100644
--- a/fs/9p/vfs_inode_dotl.c
+++ b/fs/9p/vfs_inode_dotl.c
@@ -522,6 +522,46 @@ v9fs_vfs_getattr_dotl(struct vfsmount *mnt, struct dentry *dentry,
return 0;
}
+/*
+ * Attribute flags.
+ */
+#define P9_ATTR_MODE (1 << 0)
+#define P9_ATTR_UID (1 << 1)
+#define P9_ATTR_GID (1 << 2)
+#define P9_ATTR_SIZE (1 << 3)
+#define P9_ATTR_ATIME (1 << 4)
+#define P9_ATTR_MTIME (1 << 5)
+#define P9_ATTR_CTIME (1 << 6)
+#define P9_ATTR_ATIME_SET (1 << 7)
+#define P9_ATTR_MTIME_SET (1 << 8)
+
+struct dotl_iattr_map {
+ int iattr_valid;
+ int p9_iattr_valid;
+};
+
+static int v9fs_mapped_iattr_valid(int iattr_valid)
+{
+ int i;
+ int p9_iattr_valid = 0;
+ struct dotl_iattr_map dotl_iattr_map[] = {
+ { ATTR_MODE, P9_ATTR_MODE },
+ { ATTR_UID, P9_ATTR_UID },
+ { ATTR_GID, P9_ATTR_GID },
+ { ATTR_SIZE, P9_ATTR_SIZE },
+ { ATTR_ATIME, P9_ATTR_ATIME },
+ { ATTR_MTIME, P9_ATTR_MTIME },
+ { ATTR_CTIME, P9_ATTR_CTIME },
+ { ATTR_ATIME_SET, P9_ATTR_ATIME_SET },
+ { ATTR_MTIME_SET, P9_ATTR_MTIME_SET },
+ };
+ for (i = 0; i < ARRAY_SIZE(dotl_iattr_map); i++) {
+ if (iattr_valid & dotl_iattr_map[i].iattr_valid)
+ p9_iattr_valid |= dotl_iattr_map[i].p9_iattr_valid;
+ }
+ return p9_iattr_valid;
+}
+
/**
* v9fs_vfs_setattr_dotl - set file metadata
* @dentry: file whose metadata to set
@@ -542,7 +582,7 @@ int v9fs_vfs_setattr_dotl(struct dentry *dentry, struct iattr *iattr)
if (retval)
return retval;
- p9attr.valid = iattr->ia_valid;
+ p9attr.valid = v9fs_mapped_iattr_valid(iattr->ia_valid);
p9attr.mode = iattr->ia_mode;
p9attr.uid = iattr->ia_uid;
p9attr.gid = iattr->ia_gid;
on> Unnamed repository; edit this file to name it for gitweb.root
summaryrefslogtreecommitdiff
AgeCommit message (Expand)AuthorFilesLines
46 hoursupdate translations for masterHEADmasterChristian Lohmaier1294-141398/+167167
3 daysupdate translations for master/25-2Christian Lohmaier1507-32112/+23436
11 daysupdate translations for master/25-2Christian Lohmaier1000-65153/+77033
2024-12-04update translations for master/25.2.0 Beta1libreoffice-25-2-branch-pointChristian Lohmaier206-944/+3313
2024-12-03update translations for master/25.2Christian Lohmaier793-89515/+94170
2024-12-03Updated Slovenian translationMartin Srebotnjak43-2188/+2389
2024-12-01update translations for master / 25.2Christian Lohmaier2023-147733/+144174
2024-11-22add translation files for Santali (Ol-Chiki) (sat-Olck)Christian Lohmaier158-0/+284480
2024-11-22update translations for master/25.2.0 alpha1Christian Lohmaier1216-130450/+143164
2024-11-21Updated Slovenian translationMartin Srebotnjak64-13501/+19617
2024-11-19update translations for master / 25.2 alpha1Christian Lohmaier1934-72263/+100204
2024-11-05update translations for masterChristian Lohmaier2013-339716/+413548
2024-10-25update translations for masterChristian Lohmaier248-8678/+9001
2024-10-23add Tagalog (tl) translationsChristian Lohmaier220-0/+789621
2024-10-23update translations for masterChristian Lohmaier1725-190947/+231197
2024-10-04update translations for masterChristian Lohmaier2839-243555/+298302
2024-09-17update translations for masterChristian Lohmaier