[Btrfs-devel] Some queries about map_extent_buffer()

Yan Zheng yanzheng at 21cn.com
Mon Mar 17 04:52:35 PDT 2008


2008/3/17, Peter Teoh <htmldeveloper at gmail.com>:
> Thanks for the explanation.   But my point is the C statement "continue":
>
>         for (i = start_slot; i < end_slot; i++) {============> start
>  of loop, "continue" therefore will come here.
>                 int close = 1;
>
>
>                 if (!parent->map_token) {
>                         map_extent_buffer(parent,
>                                         btrfs_node_key_ptr_offset(i),
>                                         sizeof(struct btrfs_key_ptr),
>                                         &parent->map_token, &parent->kaddr,
>                                         &parent->map_start, &parent->map_len,
>                                         KM_USER1);
>                 }
Please pay attention to the fourth parameter for map_extent_buffer.
Once map_extent_buffer has been called,  parent->map_token must not be
NULL.
The test 'if (!parent->map_token)' prevents map_extent_buffer from
being called again.

Regards
YZ



More information about the Btrfs-devel mailing list