diff options
author | Ken Chen <kenchen@google.com> | 2007-11-14 19:59:44 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-11-14 21:45:40 -0500 |
commit | 45c682a68a87251d9a01383ce076ab21ee09812e (patch) | |
tree | d9fa6a02263c50ef97e1c525b91b29b6aedf9e40 /include/linux | |
parent | 8cde045c7ee97573be6ce495b8f7c918182a2c7a (diff) |
hugetlb: fix i_blocks accounting
For administrative purpose, we want to query actual block usage for
hugetlbfs file via fstat. Currently, hugetlbfs always return 0. Fix that
up since kernel already has all the information to track it properly.
Signed-off-by: Ken Chen <kenchen@google.com>
Acked-by: Adam Litke <agl@us.ibm.com>
Cc: Badari Pulavarty <pbadari@us.ibm.com>
Cc: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/hugetlb.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 8104e5af75ab..24968790bc3e 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -168,6 +168,8 @@ struct file *hugetlb_file_setup(const char *name, size_t); | |||
168 | int hugetlb_get_quota(struct address_space *mapping, long delta); | 168 | int hugetlb_get_quota(struct address_space *mapping, long delta); |
169 | void hugetlb_put_quota(struct address_space *mapping, long delta); | 169 | void hugetlb_put_quota(struct address_space *mapping, long delta); |
170 | 170 | ||
171 | #define BLOCKS_PER_HUGEPAGE (HPAGE_SIZE / 512) | ||
172 | |||
171 | static inline int is_file_hugepages(struct file *file) | 173 | static inline int is_file_hugepages(struct file *file) |
172 | { | 174 | { |
173 | if (file->f_op == &hugetlbfs_file_operations) | 175 | if (file->f_op == &hugetlbfs_file_operations) |