mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-10 15:10:38 +00:00
btrfs: Make btrfs_add_nondir take btrfs_inode
Signed-off-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
db0a669fb0
commit
cef415af20
@ -6321,10 +6321,10 @@ fail_dir_item:
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int btrfs_add_nondir(struct btrfs_trans_handle *trans,
|
static int btrfs_add_nondir(struct btrfs_trans_handle *trans,
|
||||||
struct inode *dir, struct dentry *dentry,
|
struct btrfs_inode *dir, struct dentry *dentry,
|
||||||
struct inode *inode, int backref, u64 index)
|
struct btrfs_inode *inode, int backref, u64 index)
|
||||||
{
|
{
|
||||||
int err = btrfs_add_link(trans, BTRFS_I(dir), BTRFS_I(inode),
|
int err = btrfs_add_link(trans, dir, inode,
|
||||||
dentry->d_name.name, dentry->d_name.len,
|
dentry->d_name.name, dentry->d_name.len,
|
||||||
backref, index);
|
backref, index);
|
||||||
if (err > 0)
|
if (err > 0)
|
||||||
@ -6378,7 +6378,8 @@ static int btrfs_mknod(struct inode *dir, struct dentry *dentry,
|
|||||||
if (err)
|
if (err)
|
||||||
goto out_unlock_inode;
|
goto out_unlock_inode;
|
||||||
|
|
||||||
err = btrfs_add_nondir(trans, dir, dentry, inode, 0, index);
|
err = btrfs_add_nondir(trans, BTRFS_I(dir), dentry, BTRFS_I(inode),
|
||||||
|
0, index);
|
||||||
if (err) {
|
if (err) {
|
||||||
goto out_unlock_inode;
|
goto out_unlock_inode;
|
||||||
} else {
|
} else {
|
||||||
@ -6455,7 +6456,8 @@ static int btrfs_create(struct inode *dir, struct dentry *dentry,
|
|||||||
if (err)
|
if (err)
|
||||||
goto out_unlock_inode;
|
goto out_unlock_inode;
|
||||||
|
|
||||||
err = btrfs_add_nondir(trans, dir, dentry, inode, 0, index);
|
err = btrfs_add_nondir(trans, BTRFS_I(dir), dentry, BTRFS_I(inode),
|
||||||
|
0, index);
|
||||||
if (err)
|
if (err)
|
||||||
goto out_unlock_inode;
|
goto out_unlock_inode;
|
||||||
|
|
||||||
@ -6521,7 +6523,8 @@ static int btrfs_link(struct dentry *old_dentry, struct inode *dir,
|
|||||||
ihold(inode);
|
ihold(inode);
|
||||||
set_bit(BTRFS_INODE_COPY_EVERYTHING, &BTRFS_I(inode)->runtime_flags);
|
set_bit(BTRFS_INODE_COPY_EVERYTHING, &BTRFS_I(inode)->runtime_flags);
|
||||||
|
|
||||||
err = btrfs_add_nondir(trans, dir, dentry, inode, 1, index);
|
err = btrfs_add_nondir(trans, BTRFS_I(dir), dentry, BTRFS_I(inode),
|
||||||
|
1, index);
|
||||||
|
|
||||||
if (err) {
|
if (err) {
|
||||||
drop_inode = 1;
|
drop_inode = 1;
|
||||||
@ -9703,8 +9706,8 @@ static int btrfs_whiteout_for_rename(struct btrfs_trans_handle *trans,
|
|||||||
if (ret)
|
if (ret)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
ret = btrfs_add_nondir(trans, dir, dentry,
|
ret = btrfs_add_nondir(trans, BTRFS_I(dir), dentry,
|
||||||
inode, 0, index);
|
BTRFS_I(inode), 0, index);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
@ -10253,7 +10256,8 @@ static int btrfs_symlink(struct inode *dir, struct dentry *dentry,
|
|||||||
* elsewhere above.
|
* elsewhere above.
|
||||||
*/
|
*/
|
||||||
if (!err)
|
if (!err)
|
||||||
err = btrfs_add_nondir(trans, dir, dentry, inode, 0, index);
|
err = btrfs_add_nondir(trans, BTRFS_I(dir), dentry,
|
||||||
|
BTRFS_I(inode), 0, index);
|
||||||
if (err) {
|
if (err) {
|
||||||
drop_inode = 1;
|
drop_inode = 1;
|
||||||
goto out_unlock_inode;
|
goto out_unlock_inode;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user