]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] hugetlb: remove repeated code
authorKrishnakumar R <rkrishnakumar@gmail.com>
Sun, 30 Oct 2005 01:16:45 +0000 (18:16 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Sun, 30 Oct 2005 04:40:43 +0000 (21:40 -0700)
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>
ipc/shm.c

index dca90489e3b0f7b9cfd189b593eeee1d3c0f197e..b58c651d31ae23a36c58a1de3005e6b5d46a2662 100644 (file)
--- 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;