Skip to contentSkip to conversation

hugetlb: Remove spurious i_blocks accounting check

PATCH New Adam Litke 1 participant 1 message Oct 14, 2005

Subsystems (2)
lore
Share & tools
lore

Adam Litke

author
#0 lore raw

PATCH 1/1 hugetlb: Remove spurious i_blocks accounting check

Fix up hugetlb-simple-overcommit-check.patch in -mm tree

Pft. This bit of code that Bill Irwin pointed out snuck in here from another accounting approach I was investigating.

 inode.c |    9 ---------
 1 files changed, 9 deletions(-)
fs/hugetlbfs/inode.c +0 -9
diff -upN reference/fs/hugetlbfs/inode.c current/fs/hugetlbfs/inode.c
@@ -75,14 +75,6 @@ huge_pages_needed(struct address_space *
 	pgoff_t endpg = next + ((end - start) >> PAGE_SHIFT);
 	struct inode *inode = vma->vm_file->f_dentry->d_inode;
 
-	/*
-	 * Shared memory segments are accounted for at shget time,
-	 * not at shmat (when the mapping is actually created) so 
-	 * check here if the memory has already been accounted for.
-	 */
-	if (inode->i_blocks != 0)
-		return 0;
-
 	pagevec_init(&pvec, 0);
 	while (next < endpg) {
 		if (!pagevec_lookup(&pvec, mapping, next, PAGEVEC_SIZE))
@@ -844,7 +836,6 @@ struct file *hugetlb_zero_setup(size_t s
 	d_instantiate(dentry, inode);
 	inode->i_size = size;
 	inode->i_nlink = 0;
-	inode->i_blocks = 1;
 	file->f_vfsmnt = mntget(hugetlbfs_vfsmount);
 	file->f_dentry = dentry;
 	file->f_mapping = inode->i_mapping;
Signature · 8 lines
Adam Litke - (agl at us.ibm.com)
IBM Linux Technology Center

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>