From: Krishnakumar R Date: Sun, 30 Oct 2005 01:16:45 +0000 (-0700) Subject: [PATCH] hugetlb: remove repeated code X-Git-Tag: v2.6.15-rc1~730^2^2~19 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=551110a94aa15890d1709b179c4be1e66ff6db53;p=~shefty%2Frdma-dev.git [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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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;