summaryrefslogtreecommitdiffstats
path: root/xlators/nfs/server/src/nfs3-helpers.c
diff options
context:
space:
mode:
authorshishir gowda <shishirng@gluster.com>2011-07-07 04:57:27 +0000
committerVijay Bellur <vijay@gluster.com>2011-07-07 05:45:13 -0700
commitd53b07fef8be65763b5b03ecd99ac36c86f3a277 (patch)
tree2a3ec3bdf897d02d25e0af6d680d5cbeb7760bc1 /xlators/nfs/server/src/nfs3-helpers.c
parentf935d0d25af51953919cc9a8732d0a545a5c3fbf (diff)
NFS access control list: Decode the NFS requests into mode format
Signed-off-by: shishir gowda <shishirng@gluster.com> Signed-off-by: Vijay Bellur <vijay@gluster.com> BUG: 3057 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=3057
Diffstat (limited to 'xlators/nfs/server/src/nfs3-helpers.c')
-rw-r--r--xlators/nfs/server/src/nfs3-helpers.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/xlators/nfs/server/src/nfs3-helpers.c b/xlators/nfs/server/src/nfs3-helpers.c
index caeff9261de..523fdaee9e3 100644
--- a/xlators/nfs/server/src/nfs3-helpers.c
+++ b/xlators/nfs/server/src/nfs3-helpers.c
@@ -586,7 +586,22 @@ nfs3_accessbits (int32_t accbits)
return accresult;
}
+uint32_t
+nfs3_request_to_accessbits (int32_t accbits)
+{
+ uint32_t acc_request = 0;
+
+ if (accbits & (ACCESS3_READ | ACCESS3_LOOKUP))
+ acc_request |= POSIX_READ;
+ if (accbits & (ACCESS3_MODIFY | ACCESS3_EXTEND))
+ acc_request |= POSIX_WRITE;
+
+ if (accbits & ACCESS3_EXECUTE)
+ acc_request |= POSIX_EXEC;
+
+ return acc_request;
+}
void
nfs3_fill_access3res (access3res *res, nfsstat3 status, int32_t accbits)
{