#ifndef __PERF_STRLIST_H #define __PERF_STRLIST_H #include #include #include "rblist.h" struct str_node { struct rb_node rb_node; const char *s; }; struct strlist { struct rblist rblist; bool dupstr; bool file_only; }; /* * @file_only: When dirname is present, only consider entries as filenames, * that should not be added to the list if dirname/entry is not * found */ struct strlist_config { bool dont_dupstr; bool file_only; const char *dirname; }; struct strlist *strlist__new(const char *slist, const struct strlist_config *config); void strlist__delete(struct strlist *slist); void strlist__remove(struct strlist *slist, struct str_node *sn); int strlist__load(struct strlist *slist, const char *filename); int strlist__add(struct strlist *slist, const char *str); struct str_node *strlist__entry(const struct strlist *slist, unsigned int idx); struct str_node *strlist__find(struct strlist *slist, const char *entry); static inline bool strlist__has_entry(struct strlist *slist, const char *entry) { return strlist__find(slist, entry) != NULL; } static inline bool strlist__empty(const struct strlist *slist) { return rblist__empty(&slist->rblist); } static inline unsigned int strlist__nr_entries(const struct strlist *slist) { return rblist__nr_entries(&slist->rblist); } /* For strlist iteration */ static inline struct str_node *strlist__first(struct strlist *slist) { struct rb_node *rn = rb_first(&slist->rblist.entries); return rn ? rb_entry(rn, struct str_node, rb_node) : NULL; } static inline struct str_node *strlist__next(struct str_node *sn) { struct rb_node *rn; if (!sn) return NULL; rn = rb_next(&sn->rb_node); return rn ? rb_entry(rn, struct str_node, rb_node) : NULL; } /** * strlist_for_each - iterate over a strlist * @pos: the &struct str_node to use as a loop cursor. * @slist: the &struct strlist for loop. */ #define strlist__for_each_entry(pos, slist) \ for (pos = strlist__first(slist); pos; pos = strlist__next(pos)) /** * strlist_for_each_safe - iterate over a strlist safe against removal of * str_node * @pos: the &struct str_node to use as a loop cursor. * @n: another &struct str_node to use as temporary storage. * @slist: the &struct strlist for loop. */ #define strlist__for_each_entry_safe(pos, n, slist) \ for (pos = strlist__first(slist), n = strlist__next(pos); pos;\ pos = n, n = strlist__next(n)) #endif /* __PERF_STRLIST_H */ ffcde9'/>
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-10-15 12:09:13 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2016-10-15 12:09:13 -0700
commitdf34d04a6f09ba41037e58c3df6d6fbed0ffcde9 (patch)
tree13c81a36713fafc7abd74cb337860a1feb279968 /net/bridge/br.c
parent9ffc66941df278c9f4df979b6bcf6c6ddafedd16 (diff)
parenta17e7d2010b44103e3b8e00d0c8c510606457bc6 (diff)
Merge tag 'befs-v4.9-rc1' of git://github.com/luisbg/linux-befs
Pull befs fixes from Luis de Bethencourt: "I recently took maintainership of the befs file system [0]. This is the first time I send you a git pull request, so please let me know if all the below is OK. Salah Triki and myself have been cleaning the code and fixing a few small bugs. Sorry I couldn't send this sooner in the merge window, I was waiting to have my GPG key signed by kernel members at ELCE in Berlin a few days ago." [0] https://lkml.org/lkml/2016/7/27/502 * tag 'befs-v4.9-rc1' of git://github.com/luisbg/linux-befs: (39 commits) befs: befs: fix style issues in datastream.c befs: improve documentation in datastream.c befs: fix typos in datastream.c befs: fix typos in btree.c befs: fix style issues in super.c befs: fix comment style befs: add check for ag_shift in superblock befs: dump inode_size superblock information befs: remove unnecessary initialization befs: fix typo in befs_sb_info befs: add flags field to validate superblock state befs: fix typo in befs_find_key befs: remove unused BEFS_BT_PARMATCH fs: befs: remove ret variable fs: befs: remove in vain variable assignment fs: befs: remove unnecessary *befs_sb variable fs: befs: remove useless initialization to zero fs: befs: remove in vain variable assignment fs: befs: Insert NULL inode to dentry fs: befs: Remove useless calls to brelse in befs_find_brun_dblindirect ...
Diffstat (limited to 'net/bridge/br.c')