diff options
| author | Takashi Iwai <tiwai@suse.de> | 2013-08-01 05:12:10 -0400 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2013-08-01 05:12:10 -0400 |
| commit | 209fb1b7e298c5f5a93a9450bc9e9e7923f745d9 (patch) | |
| tree | 27cbfa78e5eeaceb2aae1c165f7f0e24f6fee286 /kernel/cgroup.c | |
| parent | a8d30608eaed6cc759b8e2e8a8bbbb42591f797f (diff) | |
| parent | 3fef7f795fff7ccc58d55a28315ca73305515884 (diff) | |
Merge tag 'asoc-v3.11-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v3.11
A fix to make sure userspace knows when control writes have caused a
change in value, fixing some UIs, plus a few few driver fixes mainly
cleaning up issues from recent refactorings on less mainstream platforms.
Diffstat (limited to 'kernel/cgroup.c')
| -rw-r--r-- | kernel/cgroup.c | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 0e0b20b8c5db..789ec4683db3 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
| @@ -1845,36 +1845,43 @@ out: | |||
| 1845 | EXPORT_SYMBOL_GPL(cgroup_path); | 1845 | EXPORT_SYMBOL_GPL(cgroup_path); |
| 1846 | 1846 | ||
| 1847 | /** | 1847 | /** |
| 1848 | * task_cgroup_path_from_hierarchy - cgroup path of a task on a hierarchy | 1848 | * task_cgroup_path - cgroup path of a task in the first cgroup hierarchy |
| 1849 | * @task: target task | 1849 | * @task: target task |
| 1850 | * @hierarchy_id: the hierarchy to look up @task's cgroup from | ||
| 1851 | * @buf: the buffer to write the path into | 1850 | * @buf: the buffer to write the path into |
| 1852 | * @buflen: the length of the buffer | 1851 | * @buflen: the length of the buffer |
| 1853 | * | 1852 | * |
| 1854 | * Determine @task's cgroup on the hierarchy specified by @hierarchy_id and | 1853 | * Determine @task's cgroup on the first (the one with the lowest non-zero |
| 1855 | * copy its path into @buf. This function grabs cgroup_mutex and shouldn't | 1854 | * hierarchy_id) cgroup hierarchy and copy its path into @buf. This |
| 1856 | * be used inside locks used by cgroup controller callbacks. | 1855 | * function grabs cgroup_mutex and shouldn't be used inside locks used by |
| 1856 | * cgroup controller callbacks. | ||
| 1857 | * | ||
| 1858 | * Returns 0 on success, fails with -%ENAMETOOLONG if @buflen is too short. | ||
| 1857 | */ | 1859 | */ |
| 1858 | int task_cgroup_path_from_hierarchy(struct task_struct *task, int hierarchy_id, | 1860 | int task_cgroup_path(struct task_struct *task, char *buf, size_t buflen) |
| 1859 | char *buf, size_t buflen) | ||
| 1860 | { | 1861 | { |
| 1861 | struct cgroupfs_root *root; | 1862 | struct cgroupfs_root *root; |
| 1862 | struct cgroup *cgrp = NULL; | 1863 | struct cgroup *cgrp; |
| 1863 | int ret = -ENOENT; | 1864 | int hierarchy_id = 1, ret = 0; |
| 1865 | |||
| 1866 | if (buflen < 2) | ||
| 1867 | return -ENAMETOOLONG; | ||
| 1864 | 1868 | ||
| 1865 | mutex_lock(&cgroup_mutex); | 1869 | mutex_lock(&cgroup_mutex); |
| 1866 | 1870 | ||
| 1867 | root = idr_find(&cgroup_hierarchy_idr, hierarchy_id); | 1871 | root = idr_get_next(&cgroup_hierarchy_idr, &hierarchy_id); |
| 1872 | |||
| 1868 | if (root) { | 1873 | if (root) { |
| 1869 | cgrp = task_cgroup_from_root(task, root); | 1874 | cgrp = task_cgroup_from_root(task, root); |
| 1870 | ret = cgroup_path(cgrp, buf, buflen); | 1875 | ret = cgroup_path(cgrp, buf, buflen); |
| 1876 | } else { | ||
| 1877 | /* if no hierarchy exists, everyone is in "/" */ | ||
| 1878 | memcpy(buf, "/", 2); | ||
| 1871 | } | 1879 | } |
| 1872 | 1880 | ||
| 1873 | mutex_unlock(&cgroup_mutex); | 1881 | mutex_unlock(&cgroup_mutex); |
| 1874 | |||
| 1875 | return ret; | 1882 | return ret; |
| 1876 | } | 1883 | } |
| 1877 | EXPORT_SYMBOL_GPL(task_cgroup_path_from_hierarchy); | 1884 | EXPORT_SYMBOL_GPL(task_cgroup_path); |
| 1878 | 1885 | ||
| 1879 | /* | 1886 | /* |
| 1880 | * Control Group taskset | 1887 | * Control Group taskset |
