aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ubifs/journal.c
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2008-07-22 05:06:13 -0400
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2008-08-13 04:26:25 -0400
commit1f28681ad34a0c7e51dc5070c84b53f7bd34f44c (patch)
tree11f5d3142a76e2e6723c7ae8612ba81cef446249 /fs/ubifs/journal.c
parentfbfa6c884aae2aff479eb8c996c564b1a34eae30 (diff)
UBIFS: remove unneeded function parameter
Simplify 'ubifs_jnl_write_inode()' by removing the 'deletion' parameter which is not really needed because we may test inode->i_nlink and check whether this is a deletion or not. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'fs/ubifs/journal.c')
-rw-r--r--fs/ubifs/journal.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/fs/ubifs/journal.c b/fs/ubifs/journal.c
index 283155abe5f5..666ad82ec51a 100644
--- a/fs/ubifs/journal.c
+++ b/fs/ubifs/journal.c
@@ -750,30 +750,25 @@ out_free:
750 * ubifs_jnl_write_inode - flush inode to the journal. 750 * ubifs_jnl_write_inode - flush inode to the journal.
751 * @c: UBIFS file-system description object 751 * @c: UBIFS file-system description object
752 * @inode: inode to flush 752 * @inode: inode to flush
753 * @deletion: inode has been deleted
754 * 753 *
755 * This function writes inode @inode to the journal. If the inode is 754 * This function writes inode @inode to the journal. If the inode is
756 * synchronous, it also synchronizes the write-buffer. Returns zero in case of 755 * synchronous, it also synchronizes the write-buffer. Returns zero in case of
757 * success and a negative error code in case of failure. 756 * success and a negative error code in case of failure.
758 */ 757 */
759int ubifs_jnl_write_inode(struct ubifs_info *c, const struct inode *inode, 758int ubifs_jnl_write_inode(struct ubifs_info *c, const struct inode *inode)
760 int deletion)
761{ 759{
762 int err, len, lnum, offs, sync = 0; 760 int err, lnum, offs;
763 struct ubifs_ino_node *ino; 761 struct ubifs_ino_node *ino;
764 struct ubifs_inode *ui = ubifs_inode(inode); 762 struct ubifs_inode *ui = ubifs_inode(inode);
763 int sync = 0, len = UBIFS_INO_NODE_SZ, last_reference = !inode->i_nlink;
765 764
766 dbg_jnl("ino %lu%s", inode->i_ino, 765 dbg_jnl("ino %lu, nlink %u", inode->i_ino, inode->i_nlink);
767 deletion ? " (last reference)" : "");
768 if (deletion)
769 ubifs_assert(inode->i_nlink == 0);
770 766
771 len = UBIFS_INO_NODE_SZ;
772 /* 767 /*
773 * If the inode is being deleted, do not write the attached data. No 768 * If the inode is being deleted, do not write the attached data. No
774 * need to synchronize the write-buffer either. 769 * need to synchronize the write-buffer either.
775 */ 770 */
776 if (!deletion) { 771 if (!last_reference) {
777 len += ui->data_len; 772 len += ui->data_len;
778 sync = IS_SYNC(inode); 773 sync = IS_SYNC(inode);
779 } 774 }
@@ -786,7 +781,7 @@ int ubifs_jnl_write_inode(struct ubifs_info *c, const struct inode *inode,
786 if (err) 781 if (err)
787 goto out_free; 782 goto out_free;
788 783
789 pack_inode(c, ino, inode, 1, deletion); 784 pack_inode(c, ino, inode, 1, last_reference);
790 err = write_head(c, BASEHD, ino, len, &lnum, &offs, sync); 785 err = write_head(c, BASEHD, ino, len, &lnum, &offs, sync);
791 if (err) 786 if (err)
792 goto out_release; 787 goto out_release;
@@ -795,7 +790,7 @@ int ubifs_jnl_write_inode(struct ubifs_info *c, const struct inode *inode,
795 inode->i_ino); 790 inode->i_ino);
796 release_head(c, BASEHD); 791 release_head(c, BASEHD);
797 792
798 if (deletion) { 793 if (last_reference) {
799 err = ubifs_tnc_remove_ino(c, inode->i_ino); 794 err = ubifs_tnc_remove_ino(c, inode->i_ino);
800 if (err) 795 if (err)
801 goto out_ro; 796 goto out_ro;