Re: [PATCH] Btrfs: implement inode_operations callback tmpfile

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tuesday 01 Apr 2014 11:53:19 PM Filipe David Borba Manana wrote:
> +static int btrfs_tmpfile(struct inode *dir, struct dentry *dentry, umode_t mode)
> +{
> +	struct btrfs_trans_handle *trans;
> +	struct btrfs_root *root = BTRFS_I(dir)->root;
> +	struct inode *inode = NULL;
> +	u64 objectid;
> +	u64 index;
> +	int ret = 0;
> +
> +	/*
> +	 * 2 for inode item and ref
> +	 * 2 for dir items
> +	 * 1 for xattr if selinux is on
> +	 */
> +	trans = btrfs_start_transaction(root, 5);
> +	if (IS_ERR(trans))
> +		return PTR_ERR(trans);
> +

Hello,

Any particular reason to reserve space for 5 items? For the O_TMPFILE
case we seem to allocate and use just the one inode item and none of
the associated 'inode ref', 'dir item' and 'dir index item' since
there is no directory entry associated with the file. I am not
sure about the xattr item though.

Thanks,
chandan.

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux