GIT: unionfs2-2.6.27.y: Move one function off of branchman.c and remove source file.

Erez Zadok ezk at fsl.cs.sunysb.edu
Thu Aug 12 23:16:10 EDT 2010


commit f231658673ed53c0df440bcd7074ad0f23730b42
Author: Erez Zadok <ezk at bigvaio.(none)>
Date:   Sun Mar 25 01:37:15 2007 -0400

    Move one function off of branchman.c and remove source file.
    
    After branch-management support was added, branchman.c became obsolete: it
    used to hold the old ioctl-based branch-management commands, but now we do
    those commands via remount (in super.c).  So move the only remaining small
    query-file ioctl from branchman.c to commonfops.c, close to unionfs_ioctl;
    and remove any leftover extern's which referred to old code in branchman.c

diff --git a/fs/unionfs/Makefile b/fs/unionfs/Makefile
index e6b2e0c..f9050fa 100644
--- a/fs/unionfs/Makefile
+++ b/fs/unionfs/Makefile
@@ -1,7 +1,7 @@
 obj-$(CONFIG_UNION_FS) += unionfs.o
 
 unionfs-y := subr.o dentry.o file.o inode.o main.o super.o \
-	branchman.o rdstate.o copyup.o dirhelper.o rename.o \
+	rdstate.o copyup.o dirhelper.o rename.o \
 	unlink.o lookup.o commonfops.o dirfops.o sioq.o
 
 unionfs-$(CONFIG_UNION_FS_XATTR) += xattr.o
diff --git a/fs/unionfs/branchman.c b/fs/unionfs/branchman.c
deleted file mode 100644
index cd6a22b..0000000
--- a/fs/unionfs/branchman.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2003-2007 Erez Zadok
- * Copyright (c) 2003-2006 Charles P. Wright
- * Copyright (c) 2005-2007 Josef 'Jeff' Sipek
- * Copyright (c) 2005-2006 Junjiro Okajima
- * Copyright (c) 2005      Arun M. Krishnakumar
- * Copyright (c) 2004-2006 David P. Quigley
- * Copyright (c) 2003-2004 Mohammad Nayyer Zubair
- * Copyright (c) 2003      Puja Gupta
- * Copyright (c) 2003      Harikesavan Krishnan
- * Copyright (c) 2003-2007 Stony Brook University
- * Copyright (c) 2003-2007 The Research Foundation of SUNY
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#include "union.h"
-
-/*
- * return to user-space the branch indices containing the file in question
- *
- * We use fd_set and therefore we are limited to the number of the branches
- * to FD_SETSIZE, which is currently 1024 - plenty for most people
- */
-int unionfs_ioctl_queryfile(struct file *file, unsigned int cmd,
-			    unsigned long arg)
-{
-	int err = 0;
-	fd_set branchlist;
-	int bstart = 0, bend = 0, bindex = 0;
-	struct dentry *dentry, *hidden_dentry;
-
-	dentry = file->f_dentry;
-	unionfs_lock_dentry(dentry);
-	if ((err = unionfs_partial_lookup(dentry)))
-		goto out;
-	bstart = dbstart(dentry);
-	bend = dbend(dentry);
-
-	FD_ZERO(&branchlist);
-
-	for (bindex = bstart; bindex <= bend; bindex++) {
-		hidden_dentry = unionfs_lower_dentry_idx(dentry, bindex);
-		if (!hidden_dentry)
-			continue;
-		if (hidden_dentry->d_inode)
-			FD_SET(bindex, &branchlist);
-	}
-
-	err = copy_to_user((void __user *)arg, &branchlist, sizeof(fd_set));
-	if (err)
-		err = -EFAULT;
-
-out:
-	unionfs_unlock_dentry(dentry);
-	return err < 0 ? err : bend;
-}
diff --git a/fs/unionfs/commonfops.c b/fs/unionfs/commonfops.c
index c948108..d4a14e4 100644
--- a/fs/unionfs/commonfops.c
+++ b/fs/unionfs/commonfops.c
@@ -629,6 +629,46 @@ out:
 	return err;
 }
 
+/*
+ * return to user-space the branch indices containing the file in question
+ *
+ * We use fd_set and therefore we are limited to the number of the branches
+ * to FD_SETSIZE, which is currently 1024 - plenty for most people
+ */
+static int unionfs_ioctl_queryfile(struct file *file, unsigned int cmd,
+				   unsigned long arg)
+{
+	int err = 0;
+	fd_set branchlist;
+	int bstart = 0, bend = 0, bindex = 0;
+	struct dentry *dentry, *hidden_dentry;
+
+	dentry = file->f_dentry;
+	unionfs_lock_dentry(dentry);
+	if ((err = unionfs_partial_lookup(dentry)))
+		goto out;
+	bstart = dbstart(dentry);
+	bend = dbend(dentry);
+
+	FD_ZERO(&branchlist);
+
+	for (bindex = bstart; bindex <= bend; bindex++) {
+		hidden_dentry = unionfs_lower_dentry_idx(dentry, bindex);
+		if (!hidden_dentry)
+			continue;
+		if (hidden_dentry->d_inode)
+			FD_SET(bindex, &branchlist);
+	}
+
+	err = copy_to_user((void __user *)arg, &branchlist, sizeof(fd_set));
+	if (err)
+		err = -EFAULT;
+
+out:
+	unionfs_unlock_dentry(dentry);
+	return err < 0 ? err : bend;
+}
+
 long unionfs_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 {
 	long err;
diff --git a/fs/unionfs/union.h b/fs/unionfs/union.h
index 50a93f2..8d40124 100644
--- a/fs/unionfs/union.h
+++ b/fs/unionfs/union.h
@@ -320,12 +320,6 @@ extern int __unionfs_d_revalidate_chain(struct dentry *dentry,
 extern int unionfs_interpose(struct dentry *this_dentry,
 			     struct super_block *sb, int flag);
 
-/* Branch management ioctls. */
-extern int unionfs_ioctl_incgen(struct file *file, unsigned int cmd,
-				unsigned long arg);
-extern int unionfs_ioctl_queryfile(struct file *file, unsigned int cmd,
-				   unsigned long arg);
-
 #ifdef CONFIG_UNION_FS_XATTR
 /* Extended attribute functions. */
 extern void *unionfs_xattr_alloc(size_t size, size_t limit);


More information about the unionfs-cvs mailing list