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>
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user