summaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-07-18 13:53:06 +0200
committerTakashi Iwai <tiwai@suse.de>2012-07-18 13:53:06 +0200
commit61eab000f3536f080eab43fd5eed3fd817ded76e (patch)
treed1448b3b90c5650b522c8d13d8bdd7bd65a5cf52 /ipc
parent68e67f40b7343383517c3f951b4b8db7626406bc (diff)
parent4e01ec636e64707d202a1ca21a47bbc6d53085b7 (diff)
downloadlinux-61eab000f3536f080eab43fd5eed3fd817ded76e.tar.bz2
Merge branch 'topic/hda' into for-next
This is a large chunk merge for 3.6 HD-audio things
Diffstat (limited to 'ipc')
-rw-r--r--ipc/shm.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/ipc/shm.c b/ipc/shm.c
index 5e2cbfdab6fc..41c1285d697a 100644
--- a/ipc/shm.c
+++ b/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)