Commit 165eaa86 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] hugetlb: report shared memory attachment counts

From Rohit Seth

Attached is a patch that passes the correct information back to user
land for number of attachments to shared memory segment.  I could have
done few more changes in a way nattach is getting set for regular cases
now, but just want to limit it at this point.
parent f19dc938
...@@ -465,7 +465,10 @@ asmlinkage long sys_shmctl (int shmid, int cmd, struct shmid_ds *buf) ...@@ -465,7 +465,10 @@ asmlinkage long sys_shmctl (int shmid, int cmd, struct shmid_ds *buf)
tbuf.shm_ctime = shp->shm_ctim; tbuf.shm_ctime = shp->shm_ctim;
tbuf.shm_cpid = shp->shm_cprid; tbuf.shm_cpid = shp->shm_cprid;
tbuf.shm_lpid = shp->shm_lprid; tbuf.shm_lpid = shp->shm_lprid;
tbuf.shm_nattch = shp->shm_nattch; if (!is_file_hugepages(shp->shm_file))
tbuf.shm_nattch = shp->shm_nattch;
else
tbuf.shm_nattch = file_count(shp->shm_file) - 1;
shm_unlock(shp); shm_unlock(shp);
if(copy_shmid_to_user (buf, &tbuf, version)) if(copy_shmid_to_user (buf, &tbuf, version))
err = -EFAULT; err = -EFAULT;
...@@ -746,7 +749,7 @@ static int sysvipc_shm_read_proc(char *buffer, char **start, off_t offset, int l ...@@ -746,7 +749,7 @@ static int sysvipc_shm_read_proc(char *buffer, char **start, off_t offset, int l
shp->shm_segsz, shp->shm_segsz,
shp->shm_cprid, shp->shm_cprid,
shp->shm_lprid, shp->shm_lprid,
shp->shm_nattch, is_file_hugepages(shp->shm_file) ? (file_count(shp->shm_file) - 1) : shp->shm_nattch,
shp->shm_perm.uid, shp->shm_perm.uid,
shp->shm_perm.gid, shp->shm_perm.gid,
shp->shm_perm.cuid, shp->shm_perm.cuid,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment