aboutsummaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authorAndrew Morton <akpm@digeo.com>2002-12-21 01:08:22 -0800
committerLinus Torvalds <torvalds@home.transmeta.com>2002-12-21 01:08:22 -0800
commit165eaa86b09c7eebef92a552b737582ff5e2180c (patch)
tree90042c9921a39c57057b7ac54de76ac86277f2a5 /ipc
parentf19dc938e38646ce167258edb228e1f131a0d222 (diff)
downloadhistory-165eaa86b09c7eebef92a552b737582ff5e2180c.tar.gz
[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.
Diffstat (limited to 'ipc')
-rw-r--r--ipc/shm.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ipc/shm.c b/ipc/shm.c
index 8a6b7a5244bb7d..a959e40f6244b6 100644
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -465,7 +465,10 @@ asmlinkage long sys_shmctl (int shmid, int cmd, struct shmid_ds *buf)
tbuf.shm_ctime = shp->shm_ctim;
tbuf.shm_cpid = shp->shm_cprid;
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);
if(copy_shmid_to_user (buf, &tbuf, version))
err = -EFAULT;
@@ -746,7 +749,7 @@ static int sysvipc_shm_read_proc(char *buffer, char **start, off_t offset, int l
shp->shm_segsz,
shp->shm_cprid,
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.gid,
shp->shm_perm.cuid,