
From: Andrew Morton <akpm@osdl.org>

- Remove forward decl

- 80-cols

Cc: Peter Staubach <staubach@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 fs/open.c |  117 ++++++++++++++++++++++++++++++--------------------------------
 1 files changed, 57 insertions(+), 60 deletions(-)

diff -puN fs/open.c~open-returns-enfile-but-creates-file-anyway-tidy fs/open.c
--- devel/fs/open.c~open-returns-enfile-but-creates-file-anyway-tidy	2005-08-31 21:01:14.000000000 -0700
+++ devel-akpm/fs/open.c	2005-08-31 21:01:14.000000000 -0700
@@ -737,8 +737,63 @@ asmlinkage long sys_fchown(unsigned int 
 	return error;
 }
 
-static struct file *__dentry_open(struct dentry *, struct vfsmount *, int,
-				struct file *);
+static struct file *__dentry_open(struct dentry *dentry, struct vfsmount *mnt,
+					int flags, struct file *f)
+{
+	struct inode *inode;
+	int error;
+
+	f->f_flags = flags;
+	f->f_mode = ((flags+1) & O_ACCMODE) | FMODE_LSEEK |
+				FMODE_PREAD | FMODE_PWRITE;
+	inode = dentry->d_inode;
+	if (f->f_mode & FMODE_WRITE) {
+		error = get_write_access(inode);
+		if (error)
+			goto cleanup_file;
+	}
+
+	f->f_mapping = inode->i_mapping;
+	f->f_dentry = dentry;
+	f->f_vfsmnt = mnt;
+	f->f_pos = 0;
+	f->f_op = fops_get(inode->i_fop);
+	file_move(f, &inode->i_sb->s_files);
+
+	if (f->f_op && f->f_op->open) {
+		error = f->f_op->open(inode,f);
+		if (error)
+			goto cleanup_all;
+	}
+	f->f_flags &= ~(O_CREAT | O_EXCL | O_NOCTTY | O_TRUNC);
+
+	file_ra_state_init(&f->f_ra, f->f_mapping->host->i_mapping);
+
+	/* NB: we're sure to have correct a_ops only after f_op->open */
+	if (f->f_flags & O_DIRECT) {
+		if (!f->f_mapping->a_ops ||
+		    ((!f->f_mapping->a_ops->direct_IO) &&
+		    (!f->f_mapping->a_ops->get_xip_page))) {
+			fput(f);
+			f = ERR_PTR(-EINVAL);
+		}
+	}
+
+	return f;
+
+cleanup_all:
+	fops_put(f->f_op);
+	if (f->f_mode & FMODE_WRITE)
+		put_write_access(inode);
+	file_kill(f);
+	f->f_dentry = NULL;
+	f->f_vfsmnt = NULL;
+cleanup_file:
+	put_filp(f);
+	dput(dentry);
+	mntput(mnt);
+	return ERR_PTR(error);
+}
 
 /*
  * Note that while the flag value (low two bits) for sys_open means:
@@ -778,7 +833,6 @@ struct file *filp_open(const char * file
 	put_filp(f);
 	return ERR_PTR(error);
 }
-
 EXPORT_SYMBOL(filp_open);
 
 struct file *dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags)
@@ -793,65 +847,8 @@ struct file *dentry_open(struct dentry *
 
 	return __dentry_open(dentry, mnt, flags, f);
 }
-
 EXPORT_SYMBOL(dentry_open);
 
-static struct file *__dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags, struct file *f)
-{
-	struct inode *inode;
-	int error;
-
-	f->f_flags = flags;
-	f->f_mode = ((flags+1) & O_ACCMODE) | FMODE_LSEEK | FMODE_PREAD | FMODE_PWRITE;
-	inode = dentry->d_inode;
-	if (f->f_mode & FMODE_WRITE) {
-		error = get_write_access(inode);
-		if (error)
-			goto cleanup_file;
-	}
-
-	f->f_mapping = inode->i_mapping;
-	f->f_dentry = dentry;
-	f->f_vfsmnt = mnt;
-	f->f_pos = 0;
-	f->f_op = fops_get(inode->i_fop);
-	file_move(f, &inode->i_sb->s_files);
-
-	if (f->f_op && f->f_op->open) {
-		error = f->f_op->open(inode,f);
-		if (error)
-			goto cleanup_all;
-	}
-	f->f_flags &= ~(O_CREAT | O_EXCL | O_NOCTTY | O_TRUNC);
-
-	file_ra_state_init(&f->f_ra, f->f_mapping->host->i_mapping);
-
-	/* NB: we're sure to have correct a_ops only after f_op->open */
-	if (f->f_flags & O_DIRECT) {
-		if (!f->f_mapping->a_ops ||
-		    ((!f->f_mapping->a_ops->direct_IO) &&
-		    (!f->f_mapping->a_ops->get_xip_page))) {
-			fput(f);
-			f = ERR_PTR(-EINVAL);
-		}
-	}
-
-	return f;
-
-cleanup_all:
-	fops_put(f->f_op);
-	if (f->f_mode & FMODE_WRITE)
-		put_write_access(inode);
-	file_kill(f);
-	f->f_dentry = NULL;
-	f->f_vfsmnt = NULL;
-cleanup_file:
-	put_filp(f);
-	dput(dentry);
-	mntput(mnt);
-	return ERR_PTR(error);
-}
-
 /*
  * Find an empty file descriptor entry, and mark it busy.
  */
_
