From a40345bb402b4a9274a4ec4c99fb9292b63150c7 Mon Sep 17 00:00:00 2001 From: Will Deacon Date: Thu, 7 Jun 2012 14:21:13 -0700 Subject: [PATCH] --- yaml --- r: 310553 b: refs/heads/master c: 7d8a45695cc8f9fcdf4121fcbd897ecb63f758e4 h: refs/heads/master i: 310551: 08fa9073fa55106ae254a7e98de7c5d89f4ddd48 v: v3 --- [refs] | 2 +- trunk/ipc/shm.c | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index fb23d1de6de6..28f327790239 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 4e791c98ae7ff889121ca93b7bd97206e4a8d793 +refs/heads/master: 7d8a45695cc8f9fcdf4121fcbd897ecb63f758e4 diff --git a/trunk/ipc/shm.c b/trunk/ipc/shm.c index 5e2cbfdab6fc..41c1285d697a 100644 --- a/trunk/ipc/shm.c +++ b/trunk/ipc/shm.c @@ -393,6 +393,16 @@ static int shm_fsync(struct file *file, loff_t start, loff_t end, int datasync) return sfd->file->f_op->fsync(sfd->file, start, end, datasync); } +static long shm_fallocate(struct file *file, int mode, loff_t offset, + loff_t len) +{ + struct shm_file_data *sfd = shm_file_data(file); + + if (!sfd->file->f_op->fallocate) + return -EOPNOTSUPP; + return sfd->file->f_op->fallocate(file, mode, offset, len); +} + static unsigned long shm_get_unmapped_area(struct file *file, unsigned long addr, unsigned long len, unsigned long pgoff, unsigned long flags) @@ -410,6 +420,7 @@ static const struct file_operations shm_file_operations = { .get_unmapped_area = shm_get_unmapped_area, #endif .llseek = noop_llseek, + .fallocate = shm_fallocate, }; static const struct file_operations shm_file_operations_huge = { @@ -418,6 +429,7 @@ static const struct file_operations shm_file_operations_huge = { .release = shm_release, .get_unmapped_area = shm_get_unmapped_area, .llseek = noop_llseek, + .fallocate = shm_fallocate, }; int is_file_shm_hugepages(struct file *file)