The __unionfs_write helper function was used only by unionfs_write, and
there is really no reason why they should not be combined.
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
---
fs/unionfs/file.c | 30 ++++++++++--------------------
1 files changed, 10 insertions(+), 20 deletions(-)
diff --git a/fs/unionfs/file.c b/fs/unionfs/file.c
index 1dfcfcb..2e5ec42 100644
--- a/fs/unionfs/file.c
+++ b/fs/unionfs/file.c
@@ -77,17 +77,20 @@ out:
return err;
}
-/* helper function to unionfs_write */
-static ssize_t __unionfs_write(struct file *file, const char __user *buf,
- size_t count, loff_t *ppos)
+static ssize_t unionfs_write(struct file *file, const char __user *buf,
+ size_t count, loff_t *ppos)
{
- int err = -EINVAL;
+ int err;
struct file *hidden_file = NULL;
struct inode *inode;
struct inode *hidden_inode;
loff_t pos = *ppos;
int bstart, bend;
+ unionfs_read_lock(file->f_dentry->d_sb);
+ if ((err = unionfs_file_revalidate(file, 1)))
+ goto out;
+
inode = file->f_dentry->d_inode;
bstart = fbstart(file);
@@ -98,8 +101,10 @@ static ssize_t __unionfs_write(struct file *file, const char __user *buf,
hidden_file = unionfs_lower_file(file);
hidden_inode = hidden_file->f_dentry->d_inode;
- if (!hidden_file->f_op || !hidden_file->f_op->write)
+ if (!hidden_file->f_op || !hidden_file->f_op->write) {
+ err = -EINVAL;
goto out;
+ }
/* adjust for append -- seek to the end of the file */
if (file->f_flags & O_APPEND)
@@ -120,21 +125,6 @@ static ssize_t __unionfs_write(struct file *file, const char __user *buf,
if (pos > inode->i_size)
inode->i_size = pos;
out:
- return err;
-}
-
-static ssize_t unionfs_write(struct file *file, const char __user *buf,
- size_t count, loff_t *ppos)
-{
- int err = 0;
-
- unionfs_read_lock(file->f_dentry->d_sb);
- if ((err = unionfs_file_revalidate(file, 1)))
- goto out;
-
- err = __unionfs_write(file, buf, count, ppos);
-
-out:
unionfs_read_unlock(file->f_dentry->d_sb);
return err;
}
--
1.5.2.rc1.165.gaf9b
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
| Andrew Morton | Re: Linux 2.6.21-rc4 |
| Len Brown | [PATCH 01/85] ACPI: Add missing acpi.debug_layer Documentation hunk from Thomas Re... |
| David | sdhci: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter - disabling IRQ |
| Olaf van der Spek | Unix sockets via TCP on localhost: is TCP slower? |
git: | |
| Andy Parkins | svn:externals using git submodules |
| Peter Karlsson | CRLF problems with Git on Win32 |
| Denis Bueno | Git clone error |
| Michael S. Tsirkin | git-kill: rewrite history removing a commit |
| Martín Coco | Hardware recommendation for firewalls (more than 4 NICs) |
| C. Soragan Ong | OpenBSD 4.4 amd64 bsd.mp can't detect 4GB memory |
| Richard Stallman | Real men don't attack straw men |
| Chris | OpenBSD 4.4 installation error: write failed; file system full |
| Jarek Poplawski | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Wenji Wu | A Linux TCP SACK Question |
| Dushan Tcholich | Re: ksoftirqd high cpu load on kernels 2.6.24 to 2.6.27-rc1-mm1 |
| Hannes Eder | [PATCH 19/27] drivers/net/usb: fix sparse warnings: make symbols static |
