linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Josef 'Jeff' Sipek" <jsipek@cs.sunysb.edu>
To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Cc: akpm@linux-foundation.org, "Josef 'Jeff' Sipek" <jsipek@cs.sunysb.edu>
Subject: [PATCH 10/21] Unionfs: Move unionfs_query_file to commonfops.c
Date: Wed, 23 May 2007 20:36:00 -0400	[thread overview]
Message-ID: <11799669734102-git-send-email-jsipek@cs.sunysb.edu> (raw)
In-Reply-To: <11799669712090-git-send-email-jsipek@cs.sunysb.edu>

Moved unionfs_query_file closer to its one user in commonfops.c.
Additionally, it can now become static, and branchman.c can be removed as it
is empty.

Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
---
 fs/unionfs/Makefile     |    4 +-
 fs/unionfs/branchman.c  |   60 -----------------------------------------------
 fs/unionfs/commonfops.c |   41 ++++++++++++++++++++++++++++++++
 fs/unionfs/union.h      |    6 ----
 4 files changed, 43 insertions(+), 68 deletions(-)
 delete mode 100644 fs/unionfs/branchman.c

diff --git a/fs/unionfs/Makefile b/fs/unionfs/Makefile
index e6b2e0c..6986d79 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 \
-	unlink.o lookup.o commonfops.o dirfops.o sioq.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 4545e18..0000000
--- a/fs/unionfs/branchman.c
+++ /dev/null
@@ -1,60 +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 a57471e..69d9c87 100644
--- a/fs/unionfs/commonfops.c
+++ b/fs/unionfs/commonfops.c
@@ -632,6 +632,47 @@ 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 fee4f88..dab408f 100644
--- a/fs/unionfs/union.h
+++ b/fs/unionfs/union.h
@@ -319,12 +319,6 @@ int __unionfs_d_revalidate_chain(struct dentry *dentry, struct nameidata *nd);
 extern int unionfs_interpose(struct dentry *this_dentry,
 			     struct super_block *sb, int flag);
 
-/* Branch management ioctls. */
-int unionfs_ioctl_incgen(struct file *file, unsigned int cmd,
-			 unsigned long arg);
-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);
-- 
1.5.2.rc1.165.gaf9b


  parent reply	other threads:[~2007-05-24  0:37 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-24  0:35 [GIT PULL -mm] Unionfs cleanups and fixes Josef 'Jeff' Sipek
2007-05-24  0:35 ` [PATCH 01/21] Unionfs: Tiny documentation fixups Josef 'Jeff' Sipek
2007-05-24  0:35 ` [PATCH 02/21] Unionfs: Coding style fixes Josef 'Jeff' Sipek
2007-05-24  0:35 ` [PATCH 03/21] Unionfs: Every printk should prefix with "unionfs: " consistently Josef 'Jeff' Sipek
2007-05-24  0:35 ` [PATCH 04/21] Unionfs: Add missing copyright notices Josef 'Jeff' Sipek
2007-05-24  0:35 ` [PATCH 05/21] Unionfs: Cleanup of strings and comments Josef 'Jeff' Sipek
2007-05-24  0:35 ` [PATCH 06/21] Unionfs: Added numerous comments Josef 'Jeff' Sipek
2007-05-24  0:35 ` [PATCH 07/21] Unionfs: Consistent pointer declaration spacing Josef 'Jeff' Sipek
2007-05-24  0:35 ` [PATCH 08/21] Unionfs: Rename Unionfs's double_lock_dentry to avoid confusion Josef 'Jeff' Sipek
2007-05-24  0:35 ` [PATCH 09/21] Unionfs: Rename our "do_rename" to __unionfs_rename Josef 'Jeff' Sipek
2007-05-24  0:36 ` Josef 'Jeff' Sipek [this message]
2007-05-24  0:36 ` [PATCH 11/21] Unionfs: Combine unionfs_write with __unionfs_write Josef 'Jeff' Sipek
2007-05-24  0:36 ` [PATCH 12/21] Unionfs: Prefix external functions with 'extern' properly Josef 'Jeff' Sipek
2007-05-24  0:36 ` [PATCH 13/21] Unionfs: Don't leak resources when copyup fails partially Josef 'Jeff' Sipek
2007-05-24  0:36 ` [PATCH 14/21] Unionfs: Call realloc unconditionally Josef 'Jeff' Sipek
2007-05-24  0:36 ` [PATCH 15/21] Unionfs: Use krealloc instead of open-coding the functionality Josef 'Jeff' Sipek
2007-05-24  0:36 ` [PATCH 16/21] Unionfs: Disallow setting leftmost branch to readonly Josef 'Jeff' Sipek
2007-05-24  0:36 ` [PATCH 17/21] Unionfs: Documentation update regarding overlapping branches and new lookup code Josef 'Jeff' Sipek
2007-05-24  0:36 ` [PATCH 18/21] Unionfs: Remove defunct unionfs_put_inode super op Josef 'Jeff' Sipek
2007-05-24  0:36 ` [PATCH 19/21] Unionfs: Actually catch bad use of unionfs_mnt{get,put} Josef 'Jeff' Sipek
2007-05-24  0:36 ` [PATCH 20/21] Unionfs: Removed a trailing whitespace Josef 'Jeff' Sipek
2007-05-24  0:36 ` [PATCH 21/21] Unionfs: Correctly decrement refcounts of mnt's upon branch management Josef 'Jeff' Sipek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=11799669734102-git-send-email-jsipek@cs.sunysb.edu \
    --to=jsipek@cs.sunysb.edu \
    --cc=akpm@linux-foundation.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).