Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 310553
b: refs/heads/master
c: 7d8a456
h: refs/heads/master
i:
  310551: 08fa907
v: v3
  • Loading branch information
Will Deacon authored and Linus Torvalds committed Jun 7, 2012
1 parent 614c3fe commit a40345b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4e791c98ae7ff889121ca93b7bd97206e4a8d793
refs/heads/master: 7d8a45695cc8f9fcdf4121fcbd897ecb63f758e4
12 changes: 12 additions & 0 deletions trunk/ipc/shm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 = {
Expand All @@ -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)
Expand Down

0 comments on commit a40345b

Please sign in to comment.