SOURCES: linux-2.6-unionfs-2.1.1.patch - unionfs-2.1.6_for_2.6.23-...

zbyniu zbyniu at pld-linux.org
Tue Oct 9 16:20:22 CEST 2007


Author: zbyniu                       Date: Tue Oct  9 14:20:22 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- unionfs-2.1.6_for_2.6.23-rc8.diff

---- Files affected:
SOURCES:
   linux-2.6-unionfs-2.1.1.patch (1.4 -> 1.5) 

---- Diffs:

================================================================
Index: SOURCES/linux-2.6-unionfs-2.1.1.patch
diff -u SOURCES/linux-2.6-unionfs-2.1.1.patch:1.4 SOURCES/linux-2.6-unionfs-2.1.1.patch:1.5
--- SOURCES/linux-2.6-unionfs-2.1.1.patch:1.4	Thu Sep 20 19:40:28 2007
+++ SOURCES/linux-2.6-unionfs-2.1.1.patch	Tue Oct  9 16:20:16 2007
@@ -1,8 +1,8 @@
 diff --git a/Documentation/filesystems/00-INDEX b/Documentation/filesystems/00-INDEX
-index 5717858..2ef035e 100644
+index 59db1bc..40816d4 100644
 --- a/Documentation/filesystems/00-INDEX
 +++ b/Documentation/filesystems/00-INDEX
-@@ -84,6 +84,8 @@ udf.txt
+@@ -86,6 +86,8 @@ udf.txt
  	- info and mount options for the UDF filesystem.
  ufs.txt
  	- info on the ufs filesystem.
@@ -386,10 +386,10 @@
 +
 +For more information, see <http://unionfs.filesystems.org/>.
 diff --git a/MAINTAINERS b/MAINTAINERS
-index df40a4e..161652b 100644
+index 9a91d9e..7e45e87 100644
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
-@@ -3593,6 +3593,15 @@ L:	linux-kernel at vger.kernel.org
+@@ -3740,6 +3740,15 @@ L:	linux-kernel at vger.kernel.org
  W:	http://www.kernel.dk
  S:	Maintained
  
@@ -405,21 +405,11 @@
  USB ACM DRIVER
  P:	Oliver Neukum
  M:	oliver at neukum.name
-diff --git a/drivers/mtd/mtdsuper.c b/drivers/mtd/mtdsuper.c
-index aca3319..e28f0fa 100644
---- a/drivers/mtd/mtdsuper.c
-+++ b/drivers/mtd/mtdsuper.c
-@@ -230,3 +230,5 @@ void kill_mtd_super(struct super_block *sb)
- }
- 
- EXPORT_SYMBOL_GPL(kill_mtd_super);
-+
-+MODULE_LICENSE("GPL");
 diff --git a/fs/Kconfig b/fs/Kconfig
-index 0fa0c11..e9380c7 100644
+index f9eed6d..9afb8df 100644
 --- a/fs/Kconfig
 +++ b/fs/Kconfig
-@@ -1030,6 +1030,47 @@ config CONFIGFS_FS
+@@ -1027,6 +1027,47 @@ config CONFIGFS_FS
  
  endmenu
  
@@ -467,7 +457,7 @@
  menu "Miscellaneous filesystems"
  
  config ADFS_FS
-@@ -1082,18 +1123,6 @@ config AFFS_FS
+@@ -1079,18 +1120,6 @@ config AFFS_FS
  	  To compile this file system support as a module, choose M here: the
  	  module will be called affs.  If unsure, say N.
  
@@ -496,7 +486,7 @@
  obj-$(CONFIG_GFS2_FS)           += gfs2/
 +obj-$(CONFIG_UNION_FS)		+= unionfs/
 diff --git a/fs/drop_caches.c b/fs/drop_caches.c
-index 03ea769..6a7aa05 100644
+index 59375ef..90410ac 100644
 --- a/fs/drop_caches.c
 +++ b/fs/drop_caches.c
 @@ -3,6 +3,7 @@
@@ -538,36 +528,10 @@
  out:
  	return rc;
 diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c
-index 9c6877c..fed495d 100644
+index 131954b..fc4c6cb 100644
 --- a/fs/ecryptfs/inode.c
 +++ b/fs/ecryptfs/inode.c
-@@ -280,7 +280,9 @@ static struct dentry *ecryptfs_lookup(struct inode *dir, struct dentry *dentry,
- 	int rc = 0;
- 	struct dentry *lower_dir_dentry;
- 	struct dentry *lower_dentry;
-+	struct dentry *dentry_save;
- 	struct vfsmount *lower_mnt;
-+	struct vfsmount *mnt_save;
- 	char *encoded_name;
- 	unsigned int encoded_namelen;
- 	struct ecryptfs_crypt_stat *crypt_stat = NULL;
-@@ -308,9 +310,13 @@ static struct dentry *ecryptfs_lookup(struct inode *dir, struct dentry *dentry,
- 	}
- 	ecryptfs_printk(KERN_DEBUG, "encoded_name = [%s]; encoded_namelen "
- 			"= [%d]\n", encoded_name, encoded_namelen);
--	lower_dentry = lookup_one_len(encoded_name, lower_dir_dentry,
--				      encoded_namelen - 1);
-+	dentry_save = nd->dentry;
-+	mnt_save = nd->mnt;
-+	lower_dentry = lookup_one_len_nd(encoded_name, lower_dir_dentry,
-+					 (encoded_namelen - 1), nd);
- 	kfree(encoded_name);
-+	nd->mnt = mnt_save;
-+	nd->dentry = dentry_save;
- 	if (IS_ERR(lower_dentry)) {
- 		ecryptfs_printk(KERN_ERR, "ERR from lower_dentry\n");
- 		rc = PTR_ERR(lower_dentry);
-@@ -597,9 +603,9 @@ ecryptfs_rename(struct inode *old_dir, struct dentry *old_dentry,
+@@ -601,9 +601,9 @@ ecryptfs_rename(struct inode *old_dir, struct dentry *old_dentry,
  			lower_new_dir_dentry->d_inode, lower_new_dentry);
  	if (rc)
  		goto out_lock;
@@ -579,7 +543,7 @@
  out_lock:
  	unlock_rename(lower_old_dir_dentry, lower_new_dir_dentry);
  	dput(lower_new_dentry->d_parent);
-@@ -957,7 +963,7 @@ static int ecryptfs_setattr(struct dentry *dentry, struct iattr *ia)
+@@ -961,7 +961,7 @@ static int ecryptfs_setattr(struct dentry *dentry, struct iattr *ia)
  	}
  	rc = notify_change(lower_dentry, ia);
  out:
@@ -589,7 +553,7 @@
  }
  
 diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c
-index 606128f..5f99404 100644
+index a984972..cb349a4 100644
 --- a/fs/ecryptfs/main.c
 +++ b/fs/ecryptfs/main.c
 @@ -151,7 +151,7 @@ int ecryptfs_interpose(struct dentry *lower_dentry, struct dentry *dentry,
@@ -602,48 +566,17 @@
  	 * other metadata */
  	fsstack_copy_inode_size(inode, lower_inode);
 diff --git a/fs/namei.c b/fs/namei.c
-index 5e2d98d..90d2a3a 100644
+index a83160a..b2b7c8e 100644
 --- a/fs/namei.c
 +++ b/fs/namei.c
-@@ -1124,6 +1124,10 @@ static int fastcall do_path_lookup(int dfd, const char *name,
- 		nd->mnt = mntget(fs->rootmnt);
- 		nd->dentry = dget(fs->root);
- 		read_unlock(&fs->lock);
-+	} else if (flags & LOOKUP_ONE) {
-+		/* nd->mnt and nd->dentry already set, just grab references */
-+		mntget(nd->mnt);
-+		dget(nd->dentry);
- 	} else if (dfd == AT_FDCWD) {
- 		read_lock(&fs->lock);
- 		nd->mnt = mntget(fs->pwdmnt);
-@@ -1325,7 +1329,8 @@ static inline int __lookup_one_len(const char *name, struct qstr *this, struct d
- 	return 0;
- }
- 
--struct dentry *lookup_one_len(const char *name, struct dentry *base, int len)
-+struct dentry *lookup_one_len_nd(const char *name, struct dentry *base, 
-+				 int len, struct nameidata *nd)
- {
- 	int err;
- 	struct qstr this;
-@@ -1333,7 +1338,7 @@ struct dentry *lookup_one_len(const char *name, struct dentry *base, int len)
- 	err = __lookup_one_len(name, &this, base, len);
- 	if (err)
- 		return ERR_PTR(err);
--	return __lookup_hash(&this, base, NULL);
-+	return __lookup_hash(&this, base, nd);
+@@ -374,6 +374,7 @@ void release_open_intent(struct nameidata *nd)
+ 	else
+ 		fput(nd->intent.open.file);
  }
++EXPORT_SYMBOL(release_open_intent);
  
- struct dentry *lookup_one_len_kern(const char *name, struct dentry *base, int len)
-@@ -2766,7 +2771,7 @@ EXPORT_SYMBOL(follow_up);
- EXPORT_SYMBOL(get_write_access); /* binfmt_aout */
- EXPORT_SYMBOL(getname);
- EXPORT_SYMBOL(lock_rename);
--EXPORT_SYMBOL(lookup_one_len);
-+EXPORT_SYMBOL(lookup_one_len_nd);
- EXPORT_SYMBOL(page_follow_link_light);
- EXPORT_SYMBOL(page_put_link);
- EXPORT_SYMBOL(page_readlink);
+ static inline struct dentry *
+ do_revalidate(struct dentry *dentry, struct nameidata *nd)
 diff --git a/fs/stack.c b/fs/stack.c
 index 67716f6..a548aac 100644
 --- a/fs/stack.c
@@ -703,11 +636,11 @@
  EXPORT_SYMBOL_GPL(fsstack_copy_attr_all);
 diff --git a/fs/unionfs/Makefile b/fs/unionfs/Makefile
 new file mode 100644
-index 0000000..73a6bea
+index 0000000..6c55790
 --- /dev/null
 +++ b/fs/unionfs/Makefile
-@@ -0,0 +1,13 @@
-+UNIONFS_VERSION="2.1.4 (for 2.6.22.6)"
+@@ -0,0 +1,17 @@
++UNIONFS_VERSION="2.1.6 (for 2.6.23-rc8)"
 +
 +EXTRA_CFLAGS += -DUNIONFS_VERSION=\"$(UNIONFS_VERSION)\"
 +
@@ -720,12 +653,16 @@
 +unionfs-$(CONFIG_UNION_FS_XATTR) += xattr.o
 +
 +unionfs-$(CONFIG_UNION_FS_DEBUG) += debug.o
++
++ifeq ($(CONFIG_UNION_FS_DEBUG),y)
++EXTRA_CFLAGS += -DDEBUG
++endif
 diff --git a/fs/unionfs/commonfops.c b/fs/unionfs/commonfops.c
 new file mode 100644
-index 0000000..e69ccf6
+index 0000000..7654bcb
 --- /dev/null
 +++ b/fs/unionfs/commonfops.c
-@@ -0,0 +1,835 @@
+@@ -0,0 +1,843 @@
 +/*
 + * Copyright (c) 2003-2007 Erez Zadok
 + * Copyright (c) 2003-2006 Charles P. Wright
@@ -787,8 +724,8 @@
 +		counter++;
 +		sprintf(suffix, "%*.*x", countersize, countersize, counter);
 +
-+		printk(KERN_DEBUG "unionfs: trying to rename %s to %s\n",
-+		       dentry->d_name.name, name);
++		pr_debug("unionfs: trying to rename %s to %s\n",
++			 dentry->d_name.name, name);
 +
 +		tmp_dentry = lookup_one_len(name, lower_dentry->d_parent,
 +					    nlen);
@@ -802,7 +739,7 @@
 +	err = copyup_named_file(dentry->d_parent->d_inode, file, name, bstart,
 +				bindex, file->f_path.dentry->d_inode->i_size);
 +	if (err) {
-+		if (err == -EEXIST)
++		if (unlikely(err == -EEXIST))
 +			goto retry;
 +		goto out;
 +	}
@@ -854,7 +791,7 @@
 +		 */
 +		old_bid = UNIONFS_F(file)->saved_branch_ids[bindex];
 +		i = branch_id_to_idx(sb, old_bid);
-+		if (i < 0) {
++		if (unlikely(i < 0)) {
 +			printk(KERN_ERR "unionfs: no superblock for "
 +			       "file %p\n", file);
 +			continue;
@@ -910,8 +847,9 @@
 +		if (IS_ERR(lower_file)) {
 +			err = PTR_ERR(lower_file);
 +			goto out;
-+		} else
++		} else {
 +			unionfs_set_lower_file_idx(file, bindex, lower_file);
++		}
 +	}
 +out:
 +	return err;
@@ -1045,8 +983,8 @@
 +	 * First revalidate the dentry inside struct file,
 +	 * but not unhashed dentries.
 +	 */
-+	if (!d_deleted(dentry) &&
-+	    !__unionfs_d_revalidate_chain(dentry, NULL, willwrite)) {
++	if (unlikely(!d_deleted(dentry) &&
++		     !__unionfs_d_revalidate_chain(dentry, NULL, willwrite))) {
 +		err = -ESTALE;
 +		goto out_nofree;
 +	}
@@ -1063,10 +1001,11 @@
 +	 * someone has copied up this file from underneath us, we also need
 +	 * to refresh things.
 +	 */
-+	if (!d_deleted(dentry) &&
-+	    (sbgen > fgen || dbstart(dentry) != fbstart(file))) {
++	if (unlikely(!d_deleted(dentry) &&
++		     (sbgen > fgen || dbstart(dentry) != fbstart(file)))) {
 +		/* save orig branch ID */
-+		int orig_brid =	UNIONFS_F(file)->saved_branch_ids[fbstart(file)];
++		int orig_brid =
++			UNIONFS_F(file)->saved_branch_ids[fbstart(file)];
 +
 +		/* First we throw out the existing files. */
 +		cleanup_file(file);
@@ -1077,13 +1016,13 @@
 +
 +		size = sizeof(struct file *) * sbmax(sb);
 +		UNIONFS_F(file)->lower_files = kzalloc(size, GFP_KERNEL);
-+		if (!UNIONFS_F(file)->lower_files) {
++		if (unlikely(!UNIONFS_F(file)->lower_files)) {
 +			err = -ENOMEM;
 +			goto out;
 +		}
 +		size = sizeof(int) * sbmax(sb);
 +		UNIONFS_F(file)->saved_branch_ids = kzalloc(size, GFP_KERNEL);
-+		if (!UNIONFS_F(file)->saved_branch_ids) {
++		if (unlikely(!UNIONFS_F(file)->saved_branch_ids)) {
 +			err = -ENOMEM;
 +			goto out;
 +		}
@@ -1101,7 +1040,7 @@
 +				goto out;
 +			new_brid = UNIONFS_F(file)->
 +			  saved_branch_ids[fbstart(file)];
-+			if (new_brid != orig_brid && sbgen > fgen) {
++			if (unlikely(new_brid != orig_brid && sbgen > fgen)) {
 +				/*
 +				 * If we re-opened the file on a different
 +				 * branch than the original one, and this
@@ -1115,15 +1054,16 @@
 +			}
 +		}
 +		atomic_set(&UNIONFS_F(file)->generation,
-+			   atomic_read(&UNIONFS_I(dentry->d_inode)->generation));
++			   atomic_read(
++				   &UNIONFS_I(dentry->d_inode)->generation));
 +	}
 +
 +	/* Copyup on the first write to a file on a readonly branch. */
 +	if (willwrite && IS_WRITE_FLAG(file->f_flags) &&
 +	    !IS_WRITE_FLAG(unionfs_lower_file(file)->f_flags) &&
 +	    is_robranch(dentry)) {
-+		dprintk(KERN_DEBUG "unionfs: do delay copyup of \"%s\"\n",
-+			dentry->d_name.name);
++		pr_debug("unionfs: do delay copyup of \"%s\"\n",
++			 dentry->d_name.name);
 +		err = do_delayed_copyup(file);
 +	}
 +
@@ -1145,6 +1085,7 @@
 +	struct dentry *lower_dentry;
 +	struct file *lower_file;
 +	int bindex, bstart, bend;
++	struct vfsmount *mnt;
 +
 +	bstart = fbstart(file) = dbstart(file->f_path.dentry);
 +	bend = fbend(file) = dbend(file->f_path.dentry);
@@ -1157,10 +1098,8 @@
 +
 +		dget(lower_dentry);
 +		unionfs_mntget(file->f_path.dentry, bindex);
-+		lower_file = dentry_open(lower_dentry,
-+					 unionfs_lower_mnt_idx(file->f_path.dentry,
-+							       bindex),
-+					 file->f_flags);
++		mnt = unionfs_lower_mnt_idx(file->f_path.dentry, bindex);
++		lower_file = dentry_open(lower_dentry, mnt, file->f_flags);
 +		if (IS_ERR(lower_file))
 +			return PTR_ERR(lower_file);
 +
@@ -1212,8 +1151,9 @@
 +					break;
 +			}
 +			return err;
-+		} else
++		} else {
 +			lower_flags &= ~(OPEN_WRITE_FLAGS);
++		}
 +	}
 +
 +	dget(lower_dentry);
@@ -1248,7 +1188,7 @@
 +
 +	file->private_data =
 +		kzalloc(sizeof(struct unionfs_file_info), GFP_KERNEL);
-+	if (!UNIONFS_F(file)) {
++	if (unlikely(!UNIONFS_F(file))) {
 +		err = -ENOMEM;
 +		goto out_nofree;
 +	}
@@ -1259,13 +1199,13 @@
 +
 +	size = sizeof(struct file *) * sbmax(inode->i_sb);
 +	UNIONFS_F(file)->lower_files = kzalloc(size, GFP_KERNEL);
-+	if (!UNIONFS_F(file)->lower_files) {
++	if (unlikely(!UNIONFS_F(file)->lower_files)) {
 +		err = -ENOMEM;
 +		goto out;
 +	}
 +	size = sizeof(int) * sbmax(inode->i_sb);
 +	UNIONFS_F(file)->saved_branch_ids = kzalloc(size, GFP_KERNEL);
-+	if (!UNIONFS_F(file)->saved_branch_ids) {
++	if (unlikely(!UNIONFS_F(file)->saved_branch_ids)) {
 +		err = -ENOMEM;
 +		goto out;
 +	}
@@ -1340,7 +1280,8 @@
 +	 * This is important for open-but-unlinked files, as well as mmap
 +	 * support.
 +	 */
-+	if ((err = unionfs_file_revalidate(file, true)))
++	err = unionfs_file_revalidate(file, true);
++	if (unlikely(err))
 +		goto out;
 +	unionfs_check_file(file);
 +	fileinfo = UNIONFS_F(file);
@@ -1365,11 +1306,11 @@
 +
 +	if (fileinfo->rdstate) {
 +		fileinfo->rdstate->access = jiffies;
-+		printk(KERN_DEBUG "unionfs: saving rdstate with cookie "
-+		       "%u [%d.%lld]\n",
-+		       fileinfo->rdstate->cookie,
-+		       fileinfo->rdstate->bindex,
-+		       (long long)fileinfo->rdstate->dirpos);
++		pr_debug("unionfs: saving rdstate with cookie "
++			 "%u [%d.%lld]\n",
++			 fileinfo->rdstate->cookie,
++			 fileinfo->rdstate->bindex,
++			 (long long)fileinfo->rdstate->dirpos);
 +		spin_lock(&inodeinfo->rdlock);
 +		inodeinfo->rdcount++;
 +		list_add_tail(&fileinfo->rdstate->cache,
@@ -1404,8 +1345,9 @@
 +		err = lower_file->f_op->unlocked_ioctl(lower_file, cmd, arg);
 +	} else if (lower_file->f_op->ioctl) {
 +		lock_kernel();
-+		err = lower_file->f_op->ioctl(lower_file->f_path.dentry->d_inode,
-+					      lower_file, cmd, arg);
++		err = lower_file->f_op->ioctl(
++			lower_file->f_path.dentry->d_inode,
++			lower_file, cmd, arg);
 +		unlock_kernel();
 +	}
 +
@@ -1433,7 +1375,8 @@
 +	unionfs_lock_dentry(dentry);
 +	orig_bstart = dbstart(dentry);
 +	orig_bend = dbend(dentry);
-+	if ((err = unionfs_partial_lookup(dentry)))
++	err = unionfs_partial_lookup(dentry);
++	if (err)
 +		goto out;
 +	bstart = dbstart(dentry);
 +	bend = dbend(dentry);
@@ -1444,7 +1387,7 @@
 +		lower_dentry = unionfs_lower_dentry_idx(dentry, bindex);
 +		if (!lower_dentry)
 +			continue;
-+		if (lower_dentry->d_inode)
++		if (likely(lower_dentry->d_inode))
 +			FD_SET(bindex, &branchlist);
 +		/* purge any lower objects after partial_lookup */
 +		if (bindex < orig_bstart || bindex > orig_bend) {
@@ -1467,7 +1410,7 @@
 +	ibend(dentry->d_inode) = orig_bend;
 +
 +	err = copy_to_user((void __user *)arg, &branchlist, sizeof(fd_set));
-+	if (err)
++	if (unlikely(err))
 +		err = -EFAULT;
 +
 +out:
@@ -1481,15 +1424,16 @@
 +
 +	unionfs_read_lock(file->f_path.dentry->d_sb);
 +
-+	if ((err = unionfs_file_revalidate(file, true)))
++	err = unionfs_file_revalidate(file, true);
++	if (unlikely(err))
 +		goto out;
 +
 +	/* check if asked for local commands */
 +	switch (cmd) {
 +	case UNIONFS_IOCTL_INCGEN:
 +		/* Increment the superblock generation count */
-+		printk("unionfs: incgen ioctl deprecated; "
-+		       "use \"-o remount,incgen\"\n");
++		pr_info("unionfs: incgen ioctl deprecated; "
++			"use \"-o remount,incgen\"\n");
 +		err = -ENOSYS;
 +		break;
 +
@@ -1519,7 +1463,8 @@
 +
 +	unionfs_read_lock(dentry->d_sb);
 +
-+	if ((err = unionfs_file_revalidate(file, true)))
++	err = unionfs_file_revalidate(file, true);
++	if (unlikely(err))
 +		goto out;
 +	unionfs_check_file(file);
 +
@@ -1563,10 +1508,10 @@
 +}
 diff --git a/fs/unionfs/copyup.c b/fs/unionfs/copyup.c
 new file mode 100644
-index 0000000..04bedb1
+index 0000000..98bed0b
 --- /dev/null
 +++ b/fs/unionfs/copyup.c
-@@ -0,0 +1,888 @@
+@@ -0,0 +1,897 @@
 +/*
 + * Copyright (c) 2003-2007 Erez Zadok
 + * Copyright (c) 2003-2006 Charles P. Wright
@@ -1612,7 +1557,7 @@
 +
 +	/* allocate space for the actual list */
 +	name_list = unionfs_xattr_alloc(list_size + 1, XATTR_LIST_MAX);
-+	if (!name_list || IS_ERR(name_list)) {
++	if (unlikely(!name_list || IS_ERR(name_list))) {
 +		err = PTR_ERR(name_list);
 +		goto out;
 +	}
@@ -1628,7 +1573,7 @@
 +
 +	/* allocate space to hold each xattr's value */
 +	attr_value = unionfs_xattr_alloc(XATTR_SIZE_MAX, XATTR_SIZE_MAX);
-+	if (!attr_value || IS_ERR(attr_value)) {
++	if (unlikely(!attr_value || IS_ERR(attr_value))) {
 +		err = PTR_ERR(name_list);
 +		goto out;
 +	}
@@ -1765,19 +1710,25 @@
 +		run_sioq(__unionfs_mknod, &args);
 +		err = args.err;
 +	} else if (S_ISREG(old_mode)) {
++		struct nameidata nd;
++		err = init_lower_nd(&nd, LOOKUP_CREATE);
++		if (unlikely(err < 0))
++			goto out;
++		args.create.nd = &nd;
 +		args.create.parent = new_lower_parent_dentry->d_inode;
 +		args.create.dentry = new_lower_dentry;
 +		args.create.mode = old_mode;
-+		args.create.nd = NULL;
 +
 +		run_sioq(__unionfs_create, &args);
 +		err = args.err;
++		release_lower_nd(&nd, err);
 +	} else {
-+		printk(KERN_ERR "unionfs: unknown inode type %d\n",
++		printk(KERN_CRIT "unionfs: unknown inode type %d\n",
 +		       old_mode);
 +		BUG();
 +	}
 +
++out:
 +	return err;
 +}
 +
@@ -1808,7 +1759,7 @@
 +		err = PTR_ERR(input_file);
 +		goto out;
 +	}
-+	if (!input_file->f_op || !input_file->f_op->read) {
++	if (unlikely(!input_file->f_op || !input_file->f_op->read)) {
 +		err = -EINVAL;
 +		goto out_close_in;
 +	}
@@ -1823,14 +1774,14 @@
 +		err = PTR_ERR(output_file);
 +		goto out_close_in2;
 +	}
-+	if (!output_file->f_op || !output_file->f_op->write) {
++	if (unlikely(!output_file->f_op || !output_file->f_op->write)) {
 +		err = -EINVAL;
 +		goto out_close_out;
 +	}
 +
 +	/* allocating a buffer */
 +	buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
-+	if (!buf) {
++	if (unlikely(!buf)) {
 +		err = -ENOMEM;
 +		goto out_close_out;
 +	}
@@ -1957,7 +1908,8 @@
 +
 +	sb = dir->i_sb;
 +
-+	if ((err = is_robranch_super(sb, new_bindex)))
++	err = is_robranch_super(sb, new_bindex);
++	if (err)
 +		goto out;
 +
 +	/* Create the directory structure above this dentry. */
@@ -1975,7 +1927,7 @@
 +	if (S_ISLNK(old_lower_dentry->d_inode->i_mode)) {
 +
 +		symbuf = kmalloc(PATH_MAX, GFP_KERNEL);
-+		if (!symbuf) {
++		if (unlikely(!symbuf)) {
 +			__clear(dentry, old_lower_dentry,
 +				old_bstart, old_bend,
 +				new_lower_dentry, new_bindex);
@@ -2028,7 +1980,8 @@
 +
 +#ifdef CONFIG_UNION_FS_XATTR
 +	/* Selinux uses extended attributes for permissions. */
-+	if ((err = copyup_xattrs(old_lower_dentry, new_lower_dentry)))
++	err = copyup_xattrs(old_lower_dentry, new_lower_dentry);
++	if (err)
 +		goto out_unlink;
 +#endif /* CONFIG_UNION_FS_XATTR */
 +
<<Diff was trimmed, longer than 597 lines>>

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/linux-2.6-unionfs-2.1.1.patch?r1=1.4&r2=1.5&f=u



More information about the pld-cvs-commit mailing list