Move one function off of branchman.c and remove source file.
authorErez Zadok <ezk@bigvaio.(none)>
Sun, 25 Mar 2007 05:37:15 +0000 (01:37 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Mon, 12 Jan 2009 23:20:23 +0000 (18:20 -0500)
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

fs/unionfs/Makefile
fs/unionfs/branchman.c [deleted file]
fs/unionfs/commonfops.c
fs/unionfs/union.h

index e6b2e0cd102b51e2d7191df03fd24f6352febaa4..f9050fa1ca7c21cd3d20b3af4d5052332cefe00e 100644 (file)
@@ -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 (file)
index cd6a22b..0000000
+++ /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;
-}
index c948108359cf8bd751b6d5549af6394abd0c69ef..d4a14e436213daa9cb5afbcc997b9330cc24e733 100644 (file)
@@ -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;
index 50a93f2264a854c33cb730fdf69f96c6497c711c..8d401243a22a9b95af94407741354ae8a05f9c8e 100644 (file)
@@ -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);