[Pvfs2-cvs] commit by mtmoore in pvfs2/src/kernel/linux-2.6: acl.c
CVS commit program
cvs at parl.clemson.edu
Tue Dec 21 10:37:09 EST 2010
Update of /projects/cvsroot/pvfs2/src/kernel/linux-2.6
In directory parlweb1:/tmp/cvs-serv5783/src/kernel/linux-2.6
Modified Files:
Tag: Orange-Branch
acl.c
Log Message:
xattr_handler member functions changed to the first argument being a struct dentry * instead of struct inode *. Each function also added an additional handler_flags function. maint/config/kernel.m4 updated with appropriate #defines. This version of kernel.m4 also include changes to detect a change in the ctl_table struct with other patches to follow
Index: acl.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/kernel/linux-2.6/acl.c,v
diff -p -u -r1.27.8.1 -r1.27.8.2
--- acl.c 14 Aug 2009 21:13:38 -0000 1.27.8.1
+++ acl.c 21 Dec 2010 15:37:09 -0000 1.27.8.2
@@ -380,8 +380,19 @@ out:
return error;
}
-static int pvfs2_xattr_get_acl_access(struct inode *inode,
- const char *name, void *buffer, size_t size)
+static int pvfs2_xattr_get_acl_access(
+#ifdef HAVE_XATTR_HANLDER_GET_FIVE_PARAM
+ struct dentry *dentry,
+#else
+ struct inode *inode,
+#endif /* HAVE_XATTR_HANLDER_GET_FIVE_PARAM */
+ const char *name,
+ void *buffer,
+ size_t size
+#ifdef HAVE_XATTR_HANLDER_GET_FIVE_PARAM
+ , int handler_flag
+#endif /* HAVE_XATTR_HANLDER_GET_FIVE_PARAM */
+ )
{
gossip_debug(GOSSIP_ACL_DEBUG, "pvfs2_xattr_get_acl_access %s\n", name);
if (strcmp(name, "") != 0)
@@ -389,11 +400,26 @@ static int pvfs2_xattr_get_acl_access(st
gossip_err("get_acl_access invalid name %s\n", name);
return -EINVAL;
}
+#ifdef HAVE_XATTR_HANLDER_GET_FIVE_PARAM
+ return pvfs2_xattr_get_acl(dentry->d_inode, ACL_TYPE_ACCESS, buffer, size);
+#else
return pvfs2_xattr_get_acl(inode, ACL_TYPE_ACCESS, buffer, size);
+#endif /* HAVE_XATTR_HANLDER_GET_FIVE_PARAM */
}
-static int pvfs2_xattr_get_acl_default(struct inode *inode,
- const char *name, void *buffer, size_t size)
+static int pvfs2_xattr_get_acl_default(
+#ifdef HAVE_XATTR_HANLDER_GET_FIVE_PARAM
+ struct dentry *dentry,
+#else
+ struct inode *inode,
+#endif /* HAVE_XATTR_HANLDER_GET_FIVE_PARAM */
+ const char *name,
+ void *buffer,
+ size_t size
+#ifdef HAVE_XATTR_HANLDER_GET_FIVE_PARAM
+ , int handler_flags
+#endif /* HAVE_XATTR_HANLDER_GET_FIVE_PARAM */
+ )
{
gossip_debug(GOSSIP_ACL_DEBUG, "pvfs2_xattr_get_acl_default %s\n", name);
if (strcmp(name, "") != 0)
@@ -401,11 +427,15 @@ static int pvfs2_xattr_get_acl_default(s
gossip_err("get_acl_default invalid name %s\n", name);
return -EINVAL;
}
+#ifdef HAVE_XATTR_HANLDER_GET_FIVE_PARAM
+ return pvfs2_xattr_get_acl(dentry->d_inode, ACL_TYPE_DEFAULT, buffer, size);
+#else
return pvfs2_xattr_get_acl(inode, ACL_TYPE_DEFAULT, buffer, size);
+#endif /* HAVE_XATTR_HANLDER_GET_FIVE_PARAM */
}
-static int
-pvfs2_xattr_set_acl(struct inode *inode, int type, const void *value,
+static int pvfs2_xattr_set_acl(
+struct inode *inode, int type, const void *value,
size_t size)
{
struct posix_acl *acl;
@@ -465,8 +495,20 @@ err:
return error;
}
-static int pvfs2_xattr_set_acl_access(struct inode *inode,
- const char *name, const void *buffer, size_t size, int flags)
+static int pvfs2_xattr_set_acl_access(
+#ifdef HAVE_XATTR_HANLDER_SET_SIX_PARAM
+ struct dentry *dentry,
+#else
+ struct inode *inode,
+#endif /* HAVE_XATTR_HANLDER_SET_SIX_PARAM */
+ const char *name,
+ const void *buffer,
+ size_t size,
+ int flags
+#ifdef HAVE_XATTR_HANLDER_SET_SIX_PARAM
+ , int handler_flags
+#endif /* HAVE_XATTR_HANLDER_SET_SIX_PARAM */
+ )
{
gossip_debug(GOSSIP_ACL_DEBUG, "pvfs2_xattr_set_acl_access: %s\n", name);
if (strcmp(name, "") != 0)
@@ -474,11 +516,27 @@ static int pvfs2_xattr_set_acl_access(st
gossip_err("set_acl_access invalid name %s\n", name);
return -EINVAL;
}
+#ifdef HAVE_XATTR_HANLDER_SET_SIX_PARAM
+ return pvfs2_xattr_set_acl(dentry->d_inode, ACL_TYPE_ACCESS, buffer, size);
+#else
return pvfs2_xattr_set_acl(inode, ACL_TYPE_ACCESS, buffer, size);
+#endif /* HAVE_XATTR_HANLDER_SET_SIX_PARAM */
}
-static int pvfs2_xattr_set_acl_default(struct inode *inode,
- const char *name, const void *buffer, size_t size, int flags)
+static int pvfs2_xattr_set_acl_default(
+#ifdef HAVE_XATTR_HANLDER_SET_SIX_PARAM
+ struct dentry *dentry,
+#else
+ struct inode *inode,
+#endif
+ const char *name,
+ const void *buffer,
+ size_t size,
+ int flags
+#ifdef HAVE_XATTR_HANLDER_SET_SIX_PARAM
+ , int handler_flags
+#endif /* #ifdef HAVE_XATTR_HANLDER_SET_SIX_PARAM */
+ )
{
gossip_debug(GOSSIP_ACL_DEBUG, "pvfs2_xattr_set_acl_default: %s\n", name);
if (strcmp(name, "") != 0)
@@ -486,7 +544,11 @@ static int pvfs2_xattr_set_acl_default(s
gossip_err("set_acl_default invalid name %s\n", name);
return -EINVAL;
}
+#ifdef HAVE_XATTR_HANLDER_SET_SIX_PARAM
+ return pvfs2_xattr_set_acl(dentry->d_inode, ACL_TYPE_DEFAULT, buffer, size);
+#else
return pvfs2_xattr_set_acl(inode, ACL_TYPE_DEFAULT, buffer, size);
+#endif
}
struct xattr_handler pvfs2_xattr_acl_access_handler = {
More information about the Pvfs2-cvs
mailing list