public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] udf: remove wrong prototype of udf_readdir
@ 2007-12-21 15:55 Marcin Slusarz
  2007-12-22  0:21 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Marcin Slusarz @ 2007-12-21 15:55 UTC (permalink / raw)
  To: Andrew Morton; +Cc: LKML, Ben Fennema, Jan Kara

sparse generated:
fs/udf/dir.c:78:5: warning: symbol 'udf_readdir' was not declared. Should it be static?
there are 2 different prototypes of udf_readdir - remove them and move
code around to make it still compile

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Acked-by: Jan Kara <jack@suse.cz>
---
 fs/udf/dir.c |  118 +++++++++++++++++++++++++++------------------------------
 1 files changed, 56 insertions(+), 62 deletions(-)

diff --git a/fs/udf/dir.c b/fs/udf/dir.c
index 9e3b9f9..174d2fc 100644
--- a/fs/udf/dir.c
+++ b/fs/udf/dir.c
@@ -36,68 +36,8 @@
 #include "udf_i.h"
 #include "udf_sb.h"

-/* Prototypes for file operations */
-static int udf_readdir(struct file *, void *, filldir_t);
-static int do_udf_readdir(struct inode *, struct file *, filldir_t, void *);
-
-/* readdir and lookup functions */
-
-const struct file_operations udf_dir_operations = {
-	.read			= generic_read_dir,
-	.readdir		= udf_readdir,
-	.ioctl			= udf_ioctl,
-	.fsync			= udf_fsync_file,
-};
-
-/*
- * udf_readdir
- *
- * PURPOSE
- *	Read a directory entry.
- *
- * DESCRIPTION
- *	Optional - sys_getdents() will return -ENOTDIR if this routine is not
- *	available.
- *
- *	Refer to sys_getdents() in fs/readdir.c
- *	sys_getdents() -> .
- *
- * PRE-CONDITIONS
- *	filp			Pointer to directory file.
- *	buf			Pointer to directory entry buffer.
- *	filldir			Pointer to filldir function.
- *
- * POST-CONDITIONS
- *	<return>		>=0 on success.
- *
- * HISTORY
- *	July 1, 1997 - Andrew E. Mileski
- *	Written, tested, and released.
- */
-
-int udf_readdir(struct file *filp, void *dirent, filldir_t filldir)
-{
-	struct inode *dir = filp->f_path.dentry->d_inode;
-	int result;
-
-	lock_kernel();
-
-	if (filp->f_pos == 0) {
-		if (filldir(dirent, ".", 1, filp->f_pos, dir->i_ino, DT_DIR) < 0) {
-			unlock_kernel();
-			return 0;
-		}
-		filp->f_pos++;
-	}
-
-	result = do_udf_readdir(dir, filp, filldir, dirent);
-	unlock_kernel();
- 	return result;
-}
-
-static int
-do_udf_readdir(struct inode *dir, struct file *filp, filldir_t filldir,
-	       void *dirent)
+static int do_udf_readdir(struct inode *dir, struct file *filp,
+			  filldir_t filldir, void *dirent)
 {
 	struct udf_fileident_bh fibh;
 	struct fileIdentDesc *fi = NULL;
@@ -244,3 +184,57 @@ do_udf_readdir(struct inode *dir, struct file *filp, filldir_t filldir,

 	return 0;
 }
+
+/*
+ * udf_readdir
+ *
+ * PURPOSE
+ *	Read a directory entry.
+ *
+ * DESCRIPTION
+ *	Optional - sys_getdents() will return -ENOTDIR if this routine is not
+ *	available.
+ *
+ *	Refer to sys_getdents() in fs/readdir.c
+ *	sys_getdents() -> .
+ *
+ * PRE-CONDITIONS
+ *	filp			Pointer to directory file.
+ *	buf			Pointer to directory entry buffer.
+ *	filldir			Pointer to filldir function.
+ *
+ * POST-CONDITIONS
+ *	<return>		>=0 on success.
+ *
+ * HISTORY
+ *	July 1, 1997 - Andrew E. Mileski
+ *	Written, tested, and released.
+ */
+
+static int udf_readdir(struct file *filp, void *dirent, filldir_t filldir)
+{
+	struct inode *dir = filp->f_path.dentry->d_inode;
+	int result;
+
+	lock_kernel();
+
+	if (filp->f_pos == 0) {
+		if (filldir(dirent, ".", 1, filp->f_pos, dir->i_ino, DT_DIR) < 0) {
+			unlock_kernel();
+			return 0;
+		}
+		filp->f_pos++;
+	}
+
+	result = do_udf_readdir(dir, filp, filldir, dirent);
+	unlock_kernel();
+ 	return result;
+}
+
+/* readdir and lookup functions */
+const struct file_operations udf_dir_operations = {
+	.read			= generic_read_dir,
+	.readdir		= udf_readdir,
+	.ioctl			= udf_ioctl,
+	.fsync			= udf_fsync_file,
+};
--
1.5.3.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/5] udf: remove wrong prototype of udf_readdir
  2007-12-21 15:55 [PATCH 1/5] udf: remove wrong prototype of udf_readdir Marcin Slusarz
@ 2007-12-22  0:21 ` Andrew Morton
  2007-12-22  9:00   ` Marcin Slusarz
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2007-12-22  0:21 UTC (permalink / raw)
  To: Marcin Slusarz; +Cc: linux-kernel, bfennema, jack

On Fri, 21 Dec 2007 16:55:03 +0100
Marcin Slusarz <marcin.slusarz@gmail.com> wrote:

> sparse generated:
> fs/udf/dir.c:78:5: warning: symbol 'udf_readdir' was not declared. Should it be static?
> there are 2 different prototypes of udf_readdir - remove them and move
> code around to make it still compile

Drat.  I just applied six udf patches from you and now we have a new patch
series of only five with no indication what changed.

I guess I really do need to apply my backlog in reverse time order.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/5] udf: remove wrong prototype of udf_readdir
  2007-12-22  0:21 ` Andrew Morton
@ 2007-12-22  9:00   ` Marcin Slusarz
  0 siblings, 0 replies; 3+ messages in thread
From: Marcin Slusarz @ 2007-12-22  9:00 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, bfennema, jack

On Fri, Dec 21, 2007 at 04:21:17PM -0800, Andrew Morton wrote:
> On Fri, 21 Dec 2007 16:55:03 +0100
> Marcin Slusarz <marcin.slusarz@gmail.com> wrote:
>
> > sparse generated:
> > fs/udf/dir.c:78:5: warning: symbol 'udf_readdir' was not declared. Should it be static?
> > there are 2 different prototypes of udf_readdir - remove them and move
> > code around to make it still compile
>
> Drat.  I just applied six udf patches from you and now we have a new patch
> series of only five with no indication what changed.
>
> I guess I really do need to apply my backlog in reverse time order.
I'm sorry for that. I added acked-by as Jan Kara suggested [1] and added better
description for 3rd patch. 6th patch was dropped [2] because it should be cleaned
up differently.

Marcin

[1] http://lkml.org/lkml/2007/12/20/151
[2] http://lkml.org/lkml/2007/12/17/201

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-12-22  8:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-21 15:55 [PATCH 1/5] udf: remove wrong prototype of udf_readdir Marcin Slusarz
2007-12-22  0:21 ` Andrew Morton
2007-12-22  9:00   ` Marcin Slusarz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox