On Wed, Aug 21, 2019 at 03:16:11PM +0000, Vladimir Panteleev wrote: > On Wed, 21 Aug 2019 at 14:35, David Sterba <dsterba@xxxxxxx> wrote: > > match_strdup takes an opaque type > > substring_t that is used by the parser. > > Sorry, how would one determine that the type is opaque? It's a typedef, which is kind of indication "don't look inside" as the kernel coding does not normally use typedefs. > > I've checked some other > > usages in the tree and the match_strdup/memparse/kstrtoull is quite > > common. > > Sorry, I also see there are places where substring_t's .from / .to are > still accessed directly (including in btrfs code). Do you think they > ought to use match_strdup instead? You're right, the compression option parsing references ::from heavily. So for temporary use it would be ok to avoid the allocation, which means match_strdup would be used only in btrfs_parse_subvol_options.
