summaryrefslogtreecommitdiff
path: root/ipc/shm.c
diff options
context:
space:
mode:
authorKrishnakumar R <rkrishnakumar@gmail.com>2005-10-29 18:16:45 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2005-10-29 21:40:43 -0700
commit551110a94aa15890d1709b179c4be1e66ff6db53 (patch)
treef16ab250dcb50a7839d26b7abc2a165b705c5fb0 /ipc/shm.c
parent0b1533f67cc1a595457af6d05ab3510294e2ca9c (diff)
downloadlinux-3.10-551110a94aa15890d1709b179c4be1e66ff6db53.tar.gz
linux-3.10-551110a94aa15890d1709b179c4be1e66ff6db53.tar.bz2
linux-3.10-551110a94aa15890d1709b179c4be1e66ff6db53.zip
[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: Krishnakumar. R <rkrishnakumar@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'ipc/shm.c')
-rw-r--r--ipc/shm.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/ipc/shm.c b/ipc/shm.c
index dca90489e3b..b58c651d31a 100644
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -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;