This is the start of a series of patches similar to my earlier DEFINE_MEMCG_MAX_OR_VAL work, but with less Macro Magic(tm). There are a bunch of places we go from seq_file to mem_cgroup, which currently requires manually getting the css, then getting the mem_cgroup from the css. It's in enough places now that having mem_cgroup_from_seq makes sense (and also makes the next patch a bit nicer).
Showing the changes to include/linux (1 of 3 files). Show all
Unified · Split
| @@ -429,6 +429,11 @@ static inline unsigned short mem_cgroup_id(struct mem_cgroup *memcg) · 428 unmodified lines | ||
| 429 | 429 | } |
| 430 | 430 | struct mem_cgroup *mem_cgroup_from_id(unsigned short id); |
| 431 | 431 | |
| 432 | +static inline struct mem_cgroup *mem_cgroup_from_seq(struct seq_file *m) | |
| 433 | +{ | |
| 434 | + return mem_cgroup_from_css(seq_css(m)); | |
| 435 | +} | |
| 436 | + | |
| 432 | 437 | static inline struct mem_cgroup *lruvec_memcg(struct lruvec *lruvec) |
| 433 | 438 | { |
| 434 | 439 | struct mem_cgroup_per_node *mz; |
| @@ -937,6 +942,11 @@ static inline struct mem_cgroup *mem_cgroup_from_id(unsigned short id) · 502 unmodified lines | ||
| 937 | 942 | return NULL; |
| 938 | 943 | } |
| 939 | 944 | |
| 945 | +static inline struct mem_cgroup *mem_cgroup_from_seq(struct seq_file *m) | |
| 946 | +{ | |
| 947 | + return NULL; | |
| 948 | +} | |
| 949 | + | |
| 940 | 950 | static inline struct mem_cgroup *lruvec_memcg(struct lruvec *lruvec) |
| 941 | 951 | { |
| 942 | 952 | return NULL; |