History

mm, memcg: create mem_cgroup_from_seq

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).

Chris Down committed 7 years ago

Commit aa9694b1 parent dc505373 files · +25 −15Browse files

Showing the changes to include/linux (1 of 3 files). Show all

Unified · Split

include/linux/memcontrol.h+10−0
@@ -429,6 +429,11 @@ static inline unsigned short mem_cgroup_id(struct mem_cgroup *memcg) · 428 unmodified lines
429429 }
430430 struct mem_cgroup *mem_cgroup_from_id(unsigned short id);
431431
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+
432437 static inline struct mem_cgroup *lruvec_memcg(struct lruvec *lruvec)
433438 {
434439 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
937942 return NULL;
938943 }
939944
945+static inline struct mem_cgroup *mem_cgroup_from_seq(struct seq_file *m)
946+{
947+ return NULL;
948+}
949+
940950 static inline struct mem_cgroup *lruvec_memcg(struct lruvec *lruvec)
941951 {
942952 return NULL;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t