[Pvfs2-cvs] commit by mtmoore in pvfs2/src/kernel/linux-2.6: acl.c
dcache.c namei.c pvfs2-kernel.h
CVS commit program
cvs at parl.clemson.edu
Wed May 25 16:55:16 EDT 2011
Update of /projects/cvsroot/pvfs2/src/kernel/linux-2.6
In directory parlweb1:/tmp/cvs-serv31632/src/kernel/linux-2.6
Modified Files:
Tag: Orange-Branch
acl.c dcache.c namei.c pvfs2-kernel.h
Log Message:
update configure checks and kernel code for 2.6.38
Index: acl.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/kernel/linux-2.6/acl.c,v
diff -p -u -r1.27.8.3 -r1.27.8.4
--- acl.c 3 Feb 2011 18:20:35 -0000 1.27.8.3
+++ acl.c 25 May 2011 20:55:15 -0000 1.27.8.4
@@ -711,7 +711,11 @@ out:
return error;
}
-static int pvfs2_check_acl(struct inode *inode, int mask)
+static int pvfs2_check_acl(struct inode *inode, int mask
+#ifdef HAVE_THREE_PARAM_ACL_CHECK
+ , unsigned int flags
+#endif /* HAVE_THREE_PARAM_ACL_CHECK */
+ )
{
struct posix_acl *acl = NULL;
@@ -742,8 +746,13 @@ static int pvfs2_check_acl(struct inode
#ifdef HAVE_TWO_PARAM_PERMISSION
int pvfs2_permission(struct inode *inode, int mask)
#else
-int pvfs2_permission(struct inode *inode, int mask, struct nameidata *nd)
-#endif
+int pvfs2_permission(struct inode *inode, int mask,
+#ifdef HAVE_THREE_PARAM_PERMISSION_WITH_FLAG
+unsigned int flags)
+#else
+struct nameidata *nd)
+#endif /* HAVE_THREE_PARAM_PERMISSION_WITH_FLAG */
+#endif /* HAVE_TWO_PARAM_PERMISSION */
{
#ifdef HAVE_CURRENT_FSUID
int fsuid = current_fsuid();
@@ -754,7 +763,11 @@ int pvfs2_permission(struct inode *inode
#ifdef HAVE_GENERIC_PERMISSION
int ret;
- ret = generic_permission(inode, mask, pvfs2_check_acl);
+ ret = generic_permission(inode, mask,
+#ifdef HAVE_FOUR_PARAM_GENERIC_PERMISSION
+ 0,
+#endif /* HAVE_FOUR_PARAM_GENERIC_PERMISSION */
+ pvfs2_check_acl);
if (ret != 0)
{
gossip_debug(GOSSIP_ACL_DEBUG, "pvfs2_permission failed: inode: %llu mask = %o"
Index: dcache.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/kernel/linux-2.6/dcache.c,v
diff -p -u -r1.42.14.4 -r1.42.14.5
--- dcache.c 4 Feb 2011 16:22:43 -0000 1.42.14.4
+++ dcache.c 25 May 2011 20:55:15 -0000 1.42.14.5
@@ -151,7 +151,12 @@ invalid_exit:
return 0;
}
-static int pvfs2_d_delete (struct dentry * dentry)
+static int pvfs2_d_delete (
+#ifdef HAVE_D_DELETE_CONST
+const
+#endif /* HAVE_D_DELETE_CONST */
+struct dentry * dentry
+)
{
gossip_debug(GOSSIP_DCACHE_DEBUG,
"%s: called on dentry %p.\n", __func__, dentry);
@@ -207,8 +212,15 @@ static int pvfs2_d_revalidate(
link_path_walk to pass our error up
*/
static int pvfs2_d_hash(
+#ifdef HAVE_THREE_PARAM_D_HASH
+ const struct dentry *parent,
+ const struct inode *inode,
+ struct qstr *hash
+#else
struct dentry *parent,
- struct qstr *hash)
+ struct qstr *hash
+#endif /* HAVE_THREE_PARAM_D_HASH */
+ )
{
/* gossip_debug(GOSSIP_DCACHE_DEBUG, "pvfs2: pvfs2_d_hash called " */
/* "(name: %s | len: %d | hash: %d)\n", */
@@ -216,6 +228,32 @@ static int pvfs2_d_hash(
return 0;
}
+#ifdef HAVE_SEVEN_PARAM_D_COMPARE
+static int pvfs2_d_compare(
+ const struct dentry *parent,
+ const struct inode * pinode,
+ const struct dentry *dentry,
+ const struct inode *inode,
+ unsigned int len,
+ const char *str,
+ const struct qstr *name)
+{
+ int i = 0;
+ gossip_debug(GOSSIP_DCACHE_DEBUG, "pvfs2_d_compare: "
+ "called on parent %p\n (name1: %s| name2: %s)\n",
+ parent, str, name->name);
+
+ if( len != name->len )
+ return 1;
+
+ for( i=0; i < len; i++ )
+ {
+ if( str[i] != name->name[i] )
+ return 1;
+ }
+ return 0;
+}
+#else
static int pvfs2_d_compare(
struct dentry *parent,
struct qstr *d_name,
@@ -229,6 +267,8 @@ static int pvfs2_d_compare(
(d_name->hash == name->hash) &&
(memcmp(d_name->name, name->name, d_name->len) == 0));
}
+#endif /* HAVE_SEVEN_PARAM_D_COMPARE */
+
/** PVFS2 implementation of VFS dentry operations */
struct dentry_operations pvfs2_dentry_operations =
@@ -246,6 +286,7 @@ struct dentry_operations pvfs2_dentry_op
*/
static void __attribute__ ((unused)) print_dentry(struct dentry *entry, int ret)
{
+ unsigned int local_count = 0;
if(!entry)
{
printk("--- dentry %p: no entry, ret: %d\n", entry, ret);
@@ -264,9 +305,17 @@ static void __attribute__ ((unused)) pri
return;
}
+#ifdef HAVE_DENTRY_D_COUNT_ATOMIC
+ local_count = atomic_read(&entry->d_count);
+#else
+ spin_lock(&entry->d_lock);
+ local_count = entry->d_count;
+ spin_unlock(&entry->d_lock);
+#endif /* HAVE_DENTRY_D_COUNT_ATOMIC */
+
printk("--- dentry %p: d_count: %d, name: %s, parent: %p, parent name: %s, ret: %d\n",
entry,
- atomic_read(&entry->d_count),
+ local_count,
entry->d_name.name,
entry->d_parent,
entry->d_parent->d_name.name,
Index: namei.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/kernel/linux-2.6/namei.c,v
diff -p -u -r1.84.12.3 -r1.84.12.4
--- namei.c 30 Apr 2010 20:00:53 -0000 1.84.12.3
+++ namei.c 25 May 2011 20:55:15 -0000 1.84.12.4
@@ -394,15 +394,24 @@ static int pvfs2_rename(
struct dentry *new_dentry)
{
int ret = -EINVAL, are_directories = 0;
+ unsigned int local_count = 0;
pvfs2_inode_t *pvfs2_old_parent_inode = PVFS2_I(old_dir);
pvfs2_inode_t *pvfs2_new_parent_inode = PVFS2_I(new_dir);
pvfs2_kernel_op_t *new_op = NULL;
struct super_block *sb = NULL;
+
+#ifdef HAVE_DENTRY_D_COUNT_ATOMIC
+ local_count = atomic_read(&new_dentry->d_count);
+#else
+ spin_lock( &new_dentry->d_lock );
+ local_count = new_dentry->d_count;
+ spin_unlock( &new_dentry->d_lock );
+#endif /* HAVE_DENTRY_D_COUNT_ATOMIC */
gossip_debug(GOSSIP_NAME_DEBUG, "pvfs2_rename: called (%s/%s => %s/%s) ct=%d\n",
old_dentry->d_parent->d_name.name, old_dentry->d_name.name,
new_dentry->d_parent->d_name.name, new_dentry->d_name.name,
- atomic_read(&new_dentry->d_count));
+ local_count);
are_directories = S_ISDIR(old_dentry->d_inode->i_mode);
#if 0
Index: pvfs2-kernel.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/kernel/linux-2.6/pvfs2-kernel.h,v
diff -p -u -r1.157.8.4 -r1.157.8.5
--- pvfs2-kernel.h 3 Feb 2011 18:20:36 -0000 1.157.8.4
+++ pvfs2-kernel.h 25 May 2011 20:55:16 -0000 1.157.8.5
@@ -865,8 +865,12 @@ struct inode *pvfs2_iget_common(
#if defined(PVFS2_LINUX_KERNEL_2_4) || defined(HAVE_TWO_PARAM_PERMISSION)
int pvfs2_permission(struct inode *, int);
#else
-int pvfs2_permission(struct inode *inode,
- int mask, struct nameidata *nd);
+int pvfs2_permission(struct inode *, int mask,
+#ifdef HAVE_THREE_PARAM_PERMISSION_WITH_FLAG
+ unsigned int flags);
+#else
+ struct nameidata *nd);
+#endif /* HAVE_THREE_PARAM_PERMISSION_WITH_FLAG */
#endif
/*****************************
More information about the Pvfs2-cvs
mailing list