[PATCH] UBUNTU: Fix AUFS compilation in vfsub.c

Michael Haas laga+ml at laga.ath.cx
Mon Sep 22 22:35:03 UTC 2008


From: root <root at moar.(none)>

Parts of this patch taken from Julian Andres Klodes' 01_vserver_apparmor.dpatch (aufs package 0+20080719-4), other parts taken from the AUFS version in the Ubuntu kernel.

Signed-off-by: Michael Haas <laga at laga.ath.cx>
---
 ubuntu/aufs/vfsub.c |   38 ++++++++++++++++++++++++++++++++++++--
 1 files changed, 36 insertions(+), 2 deletions(-)

diff --git a/ubuntu/aufs/vfsub.c b/ubuntu/aufs/vfsub.c
index 6902d7e..796ef2d 100644
--- a/ubuntu/aufs/vfsub.c
+++ b/ubuntu/aufs/vfsub.c
@@ -141,7 +141,7 @@ int do_vfsub_symlink(struct inode *dir, struct dentry *dentry,
 		  dir->i_ino, AuDLNPair(dentry), symname, mode);
 	IMustLock(dir);
 
-	err = vfs_symlink(VfsubSymlinkArgs);
+	err = vfs_symlink(dir, dentry, NULL, symname);
 	if (!err) {
 		/* dir inode is locked */
 		au_update_fuse_h_inode(NULL, dentry->d_parent); /*ignore*/
@@ -158,7 +158,13 @@ int do_vfsub_mknod(struct inode *dir, struct dentry *dentry, int mode,
 	LKTRTrace("i%lu, %.*s, 0x%x\n", dir->i_ino, AuDLNPair(dentry), mode);
 	IMustLock(dir);
 
+	#ifdef CONFIG_VSERVER
+	err = vfs_mknod(dir, dentry, mode, dev, NULL);
+	#elif defined(CONFIG_SECURITY_APPARMOR)
+	err = vfs_mknod(dir, dentry, NULL, mode, dev);
+	#else
 	err = vfs_mknod(dir, dentry, mode, dev);
+	#endif
 	if (!err) {
 		/* dir inode is locked */
 		au_update_fuse_h_inode(NULL, dentry->d_parent); /*ignore*/
@@ -177,7 +183,14 @@ int do_vfsub_link(struct dentry *src_dentry, struct inode *dir,
 	IMustLock(dir);
 
 	lockdep_off();
+	#ifdef CONFIG_VSERVER
+	err = vfs_link(src_dentry, dir, dentry, NULL);
+	#elif defined(CONFIG_SECURITY_APPARMOR)
+	err = vfs_link(src_dentry, NULL, dir, dentry, NULL);
+	#else
 	err = vfs_link(src_dentry, dir, dentry);
+	#endif
+
 	lockdep_on();
 	if (!err) {
 		LKTRTrace("src_i %p, dst_i %p\n",
@@ -203,7 +216,11 @@ int do_vfsub_rename(struct inode *src_dir, struct dentry *src_dentry,
 	IMustLock(src_dir);
 
 	lockdep_off();
+	#ifdef CONFIG_SECURITY_APPARMOR
+	err = vfs_rename(src_dir, src_dentry, NULL, dir, dentry, NULL);
+	#else
 	err = vfs_rename(src_dir, src_dentry, dir, dentry);
+	#endif
 	lockdep_on();
 	if (!err) {
 		/* dir inode is locked */
@@ -221,7 +238,14 @@ int do_vfsub_mkdir(struct inode *dir, struct dentry *dentry, int mode)
 	LKTRTrace("i%lu, %.*s, 0x%x\n", dir->i_ino, AuDLNPair(dentry), mode);
 	IMustLock(dir);
 
+	#ifdef CONFIG_VSERVER
+	err = vfs_mkdir(dir, dentry, mode, NULL);
+	#elif defined(CONFIG_SECURITY_APPARMOR)
+	err = vfs_mkdir(dir, dentry, NULL, mode);
+	#else
 	err = vfs_mkdir(dir, dentry, mode);
+	#endif
+
 	if (!err) {
 		/* dir inode is locked */
 		au_update_fuse_h_inode(NULL, dentry->d_parent); /*ignore*/
@@ -238,7 +262,12 @@ int do_vfsub_rmdir(struct inode *dir, struct dentry *dentry)
 	IMustLock(dir);
 
 	lockdep_off();
+	#if defined(CONFIG_VSERVER) || defined(CONFIG_SECURITY_APPARMOR)
+	err = vfs_rmdir(dir, dentry, NULL);
+	#else
 	err = vfs_rmdir(dir, dentry);
+	#endif
+
 	lockdep_on();
 	/* dir inode is locked */
 	if (!err)
@@ -255,7 +284,12 @@ int do_vfsub_unlink(struct inode *dir, struct dentry *dentry)
 
 	/* vfs_unlink() locks inode */
 	lockdep_off();
+	#if defined(CONFIG_VSERVER) || defined(CONFIG_SECURITY_APPARMOR)
+	err = vfs_unlink(dir, dentry, NULL);
+	#else
 	err = vfs_unlink(dir, dentry);
+	#endif
+
 	lockdep_on();
 	/* dir inode is locked */
 	if (!err)
@@ -493,7 +527,7 @@ static void call_notify_change(void *args)
 	if (!IS_IMMUTABLE(h_inode) && !IS_APPEND(h_inode)) {
 		vfsub_ignore(a->vargs);
 		lockdep_off();
-		*a->errp = notify_change(a->h_dentry, a->ia);
+		*a->errp = notify_change(a->h_dentry, NULL, a->ia);
 		lockdep_on();
 		if (!*a->errp)
 			au_update_fuse_h_inode(NULL, a->h_dentry); /*ignore*/
-- 
1.5.6.3





More information about the kernel-team mailing list