Displaying 5 results from an estimated 5 matches for "btrfs_inc_nlink".
2013 Oct 16
3
trivial cleanups
Hi gang,
Here''s some trivial cleanups that I''ve built up while reading through
the code.  They''ve been run through xfstests -g quick.
- z
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
2009 Nov 12
0
[PATCH 05/12] Btrfs: Avoid orphan inodes cleanup during replaying log
...(wc->trans, root,
+							 key.objectid);
 				BUG_ON(ret);
-
-				/* if the nlink count is zero here, the iput
-				 * will free the inode.  We bump it to make
-				 * sure it doesn''t get freed until the link
-				 * count fixup is done
-				 */
-				if (inode->i_nlink == 0) {
-					btrfs_inc_nlink(inode);
-					btrfs_update_inode(wc->trans,
-							   root, inode);
-				}
-				iput(inode);
 			}
+
 			ret = link_to_fixup_dir(wc->trans, root,
 						path, key.objectid);
 			BUG_ON(ret);
-- 
1.6.2.5
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
t...
2013 Apr 25
0
[PATCH] Btrfs: remove almost all of the BUG()'s from tree-log.c
...UG_ON(ret);
+		if (ret)
+			return ret;
 		ptr = (unsigned long)(di + 1);
 		ptr += name_len;
 	}
@@ -1766,16 +1787,21 @@ again:
 
 			ret = link_to_fixup_dir(trans, root,
 						path, location.objectid);
-			BUG_ON(ret);
+			if (ret) {
+				kfree(name);
+				iput(inode);
+				goto out;
+			}
+
 			btrfs_inc_nlink(inode);
 			ret = btrfs_unlink_inode(trans, root, dir, inode,
 						 name, name_len);
-			BUG_ON(ret);
-
-			btrfs_run_delayed_items(trans, root);
-
+			if (!ret)
+				btrfs_run_delayed_items(trans, root);
 			kfree(name);
 			iput(inode);
+			if (ret)
+				goto out;
 
 			/* there might still be...
2009 Aug 24
0
[PATCH] Btrfs: proper metadata -ENOSPC handling
...t dentry *dentry,
 out_unlock:
 	nr = trans->blocks_used;
 	btrfs_end_transaction_throttle(trans, root);
-fail:
+
 	if (drop_inode) {
 		inode_dec_link_count(inode);
 		iput(inode);
@@ -3864,14 +3918,18 @@ static int btrfs_link(struct dentry *old_dentry, struct inode *dir,
 		return -ENOENT;
 
 	btrfs_inc_nlink(inode);
-	err = btrfs_check_metadata_free_space(root);
-	if (err)
-		goto fail;
 	err = btrfs_set_inode_index(dir, &index);
 	if (err)
 		goto fail;
 
-	trans = btrfs_start_transaction(root, 1);
+	/*
+	 * 1 items for inode ref
+	 * 2 items for dir items
+	 */
+	trans = btrfs_start_transaction(r...
2010 Sep 03
0
[PATCH 1/2] btrfs: document where we use BUG_ON instead of error handling
...ame(trans, root, path, eb, di, key);
-		BUG_ON(ret);
+		btrfs_fixable_bug_on(ret);
 		ptr = (unsigned long)(di + 1);
 		ptr += name_len;
 	}
@@ -1429,11 +1429,11 @@ again:
 
 			ret = link_to_fixup_dir(trans, root,
 						path, location.objectid);
-			BUG_ON(ret);
+			btrfs_fixable_bug_on(ret);
 			btrfs_inc_nlink(inode);
 			ret = btrfs_unlink_inode(trans, root, dir, inode,
 						 name, name_len);
-			BUG_ON(ret);
+			btrfs_fixable_bug_on(ret);
 			kfree(name);
 			iput(inode);
 
@@ -1539,7 +1539,7 @@ again:
 			ret = check_item_in_log(trans, root, log, path,
 						log_path, dir,
 						&found_key);
-...