diff options
Diffstat (limited to 'fs/minix/inode.c')
-rw-r--r-- | fs/minix/inode.c | 33 |
1 files changed, 10 insertions, 23 deletions
diff --git a/fs/minix/inode.c b/fs/minix/inode.c index 7eb53970f4bc..f91a23693597 100644 --- a/fs/minix/inode.c +++ b/fs/minix/inode.c | |||
@@ -556,38 +556,25 @@ static struct buffer_head * V2_minix_update_inode(struct inode * inode) | |||
556 | return bh; | 556 | return bh; |
557 | } | 557 | } |
558 | 558 | ||
559 | static struct buffer_head *minix_update_inode(struct inode *inode) | 559 | static int minix_write_inode(struct inode *inode, int wait) |
560 | { | ||
561 | if (INODE_VERSION(inode) == MINIX_V1) | ||
562 | return V1_minix_update_inode(inode); | ||
563 | else | ||
564 | return V2_minix_update_inode(inode); | ||
565 | } | ||
566 | |||
567 | static int minix_write_inode(struct inode * inode, int wait) | ||
568 | { | ||
569 | brelse(minix_update_inode(inode)); | ||
570 | return 0; | ||
571 | } | ||
572 | |||
573 | int minix_sync_inode(struct inode * inode) | ||
574 | { | 560 | { |
575 | int err = 0; | 561 | int err = 0; |
576 | struct buffer_head *bh; | 562 | struct buffer_head *bh; |
577 | 563 | ||
578 | bh = minix_update_inode(inode); | 564 | if (INODE_VERSION(inode) == MINIX_V1) |
579 | if (bh && buffer_dirty(bh)) | 565 | bh = V1_minix_update_inode(inode); |
580 | { | 566 | else |
567 | bh = V2_minix_update_inode(inode); | ||
568 | if (!bh) | ||
569 | return -EIO; | ||
570 | if (wait && buffer_dirty(bh)) { | ||
581 | sync_dirty_buffer(bh); | 571 | sync_dirty_buffer(bh); |
582 | if (buffer_req(bh) && !buffer_uptodate(bh)) | 572 | if (buffer_req(bh) && !buffer_uptodate(bh)) { |
583 | { | ||
584 | printk("IO error syncing minix inode [%s:%08lx]\n", | 573 | printk("IO error syncing minix inode [%s:%08lx]\n", |
585 | inode->i_sb->s_id, inode->i_ino); | 574 | inode->i_sb->s_id, inode->i_ino); |
586 | err = -1; | 575 | err = -EIO; |
587 | } | 576 | } |
588 | } | 577 | } |
589 | else if (!bh) | ||
590 | err = -1; | ||
591 | brelse (bh); | 578 | brelse (bh); |
592 | return err; | 579 | return err; |
593 | } | 580 | } |