projects
/
platform
/
adaptation
/
renesas_rcar
/
renesas_kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sched: Move up affinity check to mitigate useless redoing overhead
[platform/adaptation/renesas_rcar/renesas_kernel.git]
/
ipc
/
shm.c
diff --git
a/ipc/shm.c
b/ipc/shm.c
index
4fa6d8f
..
cb858df
100644
(file)
--- a/
ipc/shm.c
+++ b/
ipc/shm.c
@@
-193,7
+193,7
@@
static void shm_destroy(struct ipc_namespace *ns, struct shmid_kernel *shp)
if (!is_file_hugepages(shp->shm_file))
shmem_lock(shp->shm_file, 0, shp->mlock_user);
else if (shp->mlock_user)
if (!is_file_hugepages(shp->shm_file))
shmem_lock(shp->shm_file, 0, shp->mlock_user);
else if (shp->mlock_user)
- user_shm_unlock(
shp->shm_file->f_path.dentry->d_inode
->i_size,
+ user_shm_unlock(
file_inode(shp->shm_file)
->i_size,
shp->mlock_user);
fput (shp->shm_file);
security_shm_free(shp);
shp->mlock_user);
fput (shp->shm_file);
security_shm_free(shp);
@@
-529,7
+529,7
@@
static int newseg(struct ipc_namespace *ns, struct ipc_params *params)
* shmid gets reported as "inode#" in /proc/pid/maps.
* proc-ps tools use this. Changing this will break them.
*/
* shmid gets reported as "inode#" in /proc/pid/maps.
* proc-ps tools use this. Changing this will break them.
*/
- file
->f_dentry->d_inode
->i_ino = shp->shm_perm.id;
+ file
_inode(file)
->i_ino = shp->shm_perm.id;
ns->shm_tot += numpages;
error = shp->shm_perm.id;
ns->shm_tot += numpages;
error = shp->shm_perm.id;
@@
-678,7
+678,7
@@
static void shm_add_rss_swap(struct shmid_kernel *shp,
{
struct inode *inode;
{
struct inode *inode;
- inode =
shp->shm_file->f_path.dentry->d_inode
;
+ inode =
file_inode(shp->shm_file)
;
if (is_file_hugepages(shp->shm_file)) {
struct address_space *mapping = inode->i_mapping;
if (is_file_hugepages(shp->shm_file)) {
struct address_space *mapping = inode->i_mapping;
@@
-967,11
+967,11
@@
long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr,
unsigned long flags;
unsigned long prot;
int acc_mode;
unsigned long flags;
unsigned long prot;
int acc_mode;
- unsigned long user_addr;
struct ipc_namespace *ns;
struct shm_file_data *sfd;
struct path path;
fmode_t f_mode;
struct ipc_namespace *ns;
struct shm_file_data *sfd;
struct path path;
fmode_t f_mode;
+ unsigned long populate = 0;
err = -EINVAL;
if (shmid < 0)
err = -EINVAL;
if (shmid < 0)
@@
-1042,7
+1042,8
@@
long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr,
is_file_hugepages(shp->shm_file) ?
&shm_file_operations_huge :
&shm_file_operations);
is_file_hugepages(shp->shm_file) ?
&shm_file_operations_huge :
&shm_file_operations);
- if (!file)
+ err = PTR_ERR(file);
+ if (IS_ERR(file))
goto out_free;
file->private_data = sfd;
goto out_free;
file->private_data = sfd;
@@
-1070,13
+1071,15
@@
long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr,
goto invalid;
}
goto invalid;
}
-
user_addr = do_mmap_pgoff(file, addr, size, prot, flags, 0
);
- *raddr =
user_
addr;
+
addr = do_mmap_pgoff(file, addr, size, prot, flags, 0, &populate
);
+ *raddr = addr;
err = 0;
err = 0;
- if (IS_ERR_VALUE(
user_
addr))
- err = (long)
user_
addr;
+ if (IS_ERR_VALUE(addr))
+ err = (long)addr;
invalid:
up_write(¤t->mm->mmap_sem);
invalid:
up_write(¤t->mm->mmap_sem);
+ if (populate)
+ mm_populate(addr, populate);
out_fput:
fput(file);
out_fput:
fput(file);
@@
-1173,7
+1176,7
@@
SYSCALL_DEFINE1(shmdt, char __user *, shmaddr)
(vma->vm_start - addr)/PAGE_SIZE == vma->vm_pgoff) {
(vma->vm_start - addr)/PAGE_SIZE == vma->vm_pgoff) {
- size =
vma->vm_file->f_path.dentry->d_inode
->i_size;
+ size =
file_inode(vma->vm_file)
->i_size;
do_munmap(mm, vma->vm_start, vma->vm_end - vma->vm_start);
/*
* We discovered the size of the shm segment, so
do_munmap(mm, vma->vm_start, vma->vm_end - vma->vm_start);
/*
* We discovered the size of the shm segment, so