On Wed, Apr 16, 2014 at 10:00 AM, Chandan Rajendra
<chan...@linux.vnet.ibm.com> wrote:
> 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.

Correct, not needed for directory entries.
The xattr is needed for the case where an acl is inherited. And 5
units are required for orphan insertion (see comment on top of
btrfs_orphan_add).
I'll update the comment.

Thanks

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



-- 
Filipe David Manana,

"Reasonable men adapt themselves to the world.
 Unreasonable men adapt the world to themselves.
 That's why all progress depends on unreasonable men."
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to