diff options
author | Will Deacon <[email protected]> | 2012-06-07 14:21:13 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2012-06-07 14:43:55 -0700 |
commit | 7d8a45695cc8f9fcdf4121fcbd897ecb63f758e4 (patch) | |
tree | ba315d40c8b0457d132ea155d0db651275af6822 /tools/perf/util/trace-event-scripting.c | |
parent | 4e791c98ae7ff889121ca93b7bd97206e4a8d793 (diff) |
ipc: shm: restore MADV_REMOVE functionality on shared memory segments
Commit 17cf28afea2a ("mm/fs: remove truncate_range") removed the
truncate_range inode operation in favour of the fallocate file
operation.
When using SYSV IPC shared memory segments, calling madvise with the
MADV_REMOVE advice on an area of shared memory will attempt to invoke
the .fallocate function for the shm_file_operations, which is NULL and
therefore returns -EOPNOTSUPP to userspace. The previous behaviour
would inherit the inode_operations from the underlying tmpfs file and
invoke truncate_range there.
This patch restores the previous behaviour by wrapping the underlying
fallocate function in shm_fallocate, as we do for fsync.
[[email protected]: use -ENOTSUPP in shm_fallocate()]
Signed-off-by: Will Deacon <[email protected]>
Acked-by: Hugh Dickins <[email protected]>
Signed-off-by: Hugh Dickins <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'tools/perf/util/trace-event-scripting.c')
0 files changed, 0 insertions, 0 deletions