From 45c682a68a87251d9a01383ce076ab21ee09812e Mon Sep 17 00:00:00 2001 From: Ken Chen Date: Wed, 14 Nov 2007 16:59:44 -0800 Subject: 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 Acked-by: Adam Litke Cc: Badari Pulavarty Cc: David Gibson Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/hugetlb.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/linux/hugetlb.h') 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); int hugetlb_get_quota(struct address_space *mapping, long delta); void hugetlb_put_quota(struct address_space *mapping, long delta); +#define BLOCKS_PER_HUGEPAGE (HPAGE_SIZE / 512) + static inline int is_file_hugepages(struct file *file) { if (file->f_op == &hugetlbfs_file_operations) -- cgit v1.2.2