summaryrefslogtreecommitdiff
path: root/fs/qnx4/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/qnx4/inode.c')
-rw-r--r--fs/qnx4/inode.c38
1 files changed, 12 insertions, 26 deletions
diff --git a/fs/qnx4/inode.c b/fs/qnx4/inode.c
index 95c12fc613f1..40712867b8a8 100644
--- a/fs/qnx4/inode.c
+++ b/fs/qnx4/inode.c
@@ -24,6 +24,7 @@
#include <linux/smp_lock.h>
#include <linux/pagemap.h>
#include <linux/buffer_head.h>
+#include <linux/writeback.h>
#include <linux/vfs.h>
#include <asm/uaccess.h>
@@ -34,31 +35,6 @@ static const struct super_operations qnx4_sops;
#ifdef CONFIG_QNX4FS_RW
-int qnx4_sync_inode(struct inode *inode)
-{
- int err = 0;
-# if 0
- struct buffer_head *bh;
-
- bh = qnx4_update_inode(inode);
- if (bh && buffer_dirty(bh))
- {
- sync_dirty_buffer(bh);
- if (buffer_req(bh) && !buffer_uptodate(bh))
- {
- printk ("IO error syncing qnx4 inode [%s:%08lx]\n",
- inode->i_sb->s_id, inode->i_ino);
- err = -1;
- }
- brelse (bh);
- } else if (!bh) {
- err = -1;
- }
-# endif
-
- return err;
-}
-
static void qnx4_delete_inode(struct inode *inode)
{
QNX4DEBUG(("qnx4: deleting inode [%lu]\n", (unsigned long) inode->i_ino));
@@ -70,7 +46,7 @@ static void qnx4_delete_inode(struct inode *inode)
unlock_kernel();
}
-static int qnx4_write_inode(struct inode *inode, int unused)
+static int qnx4_write_inode(struct inode *inode, int do_sync)
{
struct qnx4_inode_entry *raw_inode;
int block, ino;
@@ -107,6 +83,16 @@ static int qnx4_write_inode(struct inode *inode, int unused)
raw_inode->di_ctime = cpu_to_le32(inode->i_ctime.tv_sec);
raw_inode->di_first_xtnt.xtnt_size = cpu_to_le32(inode->i_blocks);
mark_buffer_dirty(bh);
+ if (do_sync) {
+ sync_dirty_buffer(bh);
+ if (buffer_req(bh) && !buffer_uptodate(bh)) {
+ printk("qnx4: IO error syncing inode [%s:%08x]\n",
+ inode->i_sb->s_id, ino);
+ brelse(bh);
+ unlock_kernel();
+ return -EIO;
+ }
+ }
brelse(bh);
unlock_kernel();
return 0;