Skip to content

Commit

Permalink
[PATCH] hugetlb: remove repeated code
Browse files Browse the repository at this point in the history
Clean up some repeated code related to HugeTLB.  hugetlb_zero_setup would
have already allocated the file->f_op.

Signed-off-by: Krishnakumar. R <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
0xkrishnakumar authored and Linus Torvalds committed Oct 30, 2005
1 parent 0b1533f commit 551110a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ipc/shm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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->shm_file = file;
file->f_dentry->d_inode->i_ino = shp->id;
if (shmflg & SHM_HUGETLB)
set_file_hugepages(file);
else

/* Hugetlb ops would have already been assigned. */
if (!(shmflg & SHM_HUGETLB))
file->f_op = &shm_file_operations;

shm_tot += numpages;
shm_unlock(shp);
return shp->id;
Expand Down

0 comments on commit 551110a

Please sign in to comment.