Commit 59573240 authored by John Stultz's avatar John Stultz Committed by Greg Kroah-Hartman

staging: ashmem: Fix ASHMEM_PURGE_ALL_CACHES return value

Hopefully this isn't too late for 3.12.

In commit 7dc19d5a (convert shrinkers to new count/scan API)
the return value to PURGE_ALL_CACHES was dropped, causing -EPERM
to always be returned.

This patch re-adds the ret assignment, setting it to the the
ashmem_shrink_count(), which is the lru_count.

(Sorry this was missed in the review!)

Fixes: 7dc19d5a ("convert shrinkers to new count/scan API")
Cc: Colin Cross <ccross@android.com>
Cc: Android Kernel Team <kernel-team@android.com>
Cc: Glauber Costa <glommer@openvz.org>
Reported-by: default avatarYongQin Liu <yongqin.liu@linaro.org>
Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
Cc: stable <stable@kernel.org> # 3.12
Acked-by: default avatarDave Chinner <dchinner@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 29323b3e
...@@ -777,7 +777,7 @@ static long ashmem_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -777,7 +777,7 @@ static long ashmem_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
.gfp_mask = GFP_KERNEL, .gfp_mask = GFP_KERNEL,
.nr_to_scan = LONG_MAX, .nr_to_scan = LONG_MAX,
}; };
ret = ashmem_shrink_count(&ashmem_shrinker, &sc);
nodes_setall(sc.nodes_to_scan); nodes_setall(sc.nodes_to_scan);
ashmem_shrink_scan(&ashmem_shrinker, &sc); ashmem_shrink_scan(&ashmem_shrinker, &sc);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment