[PATCH][HugeTLB] Remove repeated code

From: Krishnakumar R
Date: Tue Oct 04 2005 - 21:30:27 EST


Hi,

The following patch cleans up some repeated code related to HugeTLB.
hugetlb_zero_setup would have already allocated the file->f_op.

Thanks and Regards,
KK.

PS: Ack-ed by Rohit


Signed-off-by: Krishnakumar. R <rkrishnakumar@xxxxxxxxx>

--- linux-2.6.14-rc2-mm1/ipc/shm.orig.c 2005-10-04 23:15:01.000000000 +0530
+++ linux-2.6.14-rc2-mm1/ipc/shm.c 2005-10-05 01:09:03.000000000 +0530
@@ -233,10 +233,11 @@ static int newseg (key_t key, int shmflg
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;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/