ANDROID: taskstats: track fsync syscalls
This adds a counter to the taskstats extended accounting fields, which
tracks the number of times fsync is called, and then plumbs it through
to the uid_sys_stats driver.
Bug: 120442023
Change-Id: I6c138de5b2332eea70f57e098134d1d141247b3f
Signed-off-by: Jin Qian <jinqian@google.com>
[AmitP: Refactored changes to align with changes from upstream commit
9a07000400 ("sched/headers: Move CONFIG_TASK_XACCT bits from <linux/sched.h> to <linux/sched/xacct.h>")]
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
[tkjos: Needed for storaged fsync accounting ("storaged --uid" and
"storaged --task").]
[astrachan: This is modifying a userspace interface and should probably
be reworked]
Signed-off-by: Alistair Strachan <astrachan@google.com>
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
#include <linux/slab.h>
|
||||
#include <linux/export.h>
|
||||
#include <linux/namei.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/sched/xacct.h>
|
||||
#include <linux/writeback.h>
|
||||
#include <linux/syscalls.h>
|
||||
#include <linux/linkage.h>
|
||||
@@ -220,6 +220,7 @@ static int do_fsync(unsigned int fd, int datasync)
|
||||
if (f.file) {
|
||||
ret = vfs_fsync(f.file, datasync);
|
||||
fdput(f);
|
||||
inc_syscfs(current);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user