mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-27 22:24:11 +08:00
[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>
This commit is contained in:
parent
0b1533f67c
commit
551110a94a
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user