Commit 551110a9 authored by Krishnakumar R's avatar Krishnakumar R Committed by Linus Torvalds

[PATCH] hugetlb: remove repeated code

Clean up some repeated code related to HugeTLB.  hugetlb_zero_setup would
have already allocated the file->f_op.
Signed-off-by: default avatarKrishnakumar. R <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 0b1533f6
...@@ -233,10 +233,11 @@ static int newseg (key_t key, int shmflg, size_t size) ...@@ -233,10 +233,11 @@ static int newseg (key_t key, int shmflg, size_t size)
shp->id = shm_buildid(id,shp->shm_perm.seq); shp->id = shm_buildid(id,shp->shm_perm.seq);
shp->shm_file = file; shp->shm_file = file;
file->f_dentry->d_inode->i_ino = shp->id; file->f_dentry->d_inode->i_ino = shp->id;
if (shmflg & SHM_HUGETLB)
set_file_hugepages(file); /* Hugetlb ops would have already been assigned. */
else if (!(shmflg & SHM_HUGETLB))
file->f_op = &shm_file_operations; file->f_op = &shm_file_operations;
shm_tot += numpages; shm_tot += numpages;
shm_unlock(shp); shm_unlock(shp);
return shp->id; return shp->id;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment