commit a94799ac8018d57186b0485b51885a96d60f7034
Author: Yiannis Pericleous <[EMAIL PROTECTED]>
Date:   Sat Apr 21 12:02:51 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
    
    Conflicts:
    
        fs/unionfs/Makefile

diff --git a/fs/unionfs/Makefile b/fs/unionfs/Makefile
index 167e74f..5d1306f 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 odf.o \
        config.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 d3fbca5..15d3ce8 100644
--- a/fs/unionfs/commonfops.c
+++ b/fs/unionfs/commonfops.c
@@ -706,6 +706,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 0d839ea..2e8f90d 100644
--- a/fs/unionfs/union.h
+++ b/fs/unionfs/union.h
@@ -347,12 +347,6 @@ int unionfs_silly_rename(struct dentry *dentry, struct 
dentry *hidden_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);
_______________________________________________
unionfs-cvs mailing list: http://unionfs.filesystems.org/
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs-cvs

Reply via email to