aboutsummaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-06-13 23:52:39 -0400
committerDavid S. Miller <davem@davemloft.net>2008-06-13 23:52:39 -0400
commit4ae127d1b6c71f9240dd4245f240e6dd8fc98014 (patch)
treeb7aa27b3e0c655f4613fe2146cb57d7f69e421f6 /ipc
parent875ec4333b99144e2589e900a0bcd2c25c757b27 (diff)
parent7775c9753b94fe429dc4323360d6502c95e0dd6e (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: drivers/net/smc911x.c
Diffstat (limited to 'ipc')
-rw-r--r--ipc/msg.c13
-rw-r--r--ipc/shm.c18
2 files changed, 14 insertions, 17 deletions
diff --git a/ipc/msg.c b/ipc/msg.c
index 32494e8cc7a5..b4eee1c6101d 100644
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -98,20 +98,15 @@ void recompute_msgmni(struct ipc_namespace *ns)
98 98
99 if (allowed < MSGMNI) { 99 if (allowed < MSGMNI) {
100 ns->msg_ctlmni = MSGMNI; 100 ns->msg_ctlmni = MSGMNI;
101 goto out_callback; 101 return;
102 } 102 }
103 103
104 if (allowed > IPCMNI / nb_ns) { 104 if (allowed > IPCMNI / nb_ns) {
105 ns->msg_ctlmni = IPCMNI / nb_ns; 105 ns->msg_ctlmni = IPCMNI / nb_ns;
106 goto out_callback; 106 return;
107 } 107 }
108 108
109 ns->msg_ctlmni = allowed; 109 ns->msg_ctlmni = allowed;
110
111out_callback:
112
113 printk(KERN_INFO "msgmni has been set to %d for ipc namespace %p\n",
114 ns->msg_ctlmni, ns);
115} 110}
116 111
117void msg_init_ns(struct ipc_namespace *ns) 112void msg_init_ns(struct ipc_namespace *ns)
@@ -136,6 +131,10 @@ void msg_exit_ns(struct ipc_namespace *ns)
136void __init msg_init(void) 131void __init msg_init(void)
137{ 132{
138 msg_init_ns(&init_ipc_ns); 133 msg_init_ns(&init_ipc_ns);
134
135 printk(KERN_INFO "msgmni has been set to %d\n",
136 init_ipc_ns.msg_ctlmni);
137
139 ipc_init_proc_interface("sysvipc/msg", 138 ipc_init_proc_interface("sysvipc/msg",
140 " key msqid perms cbytes qnum lspid lrpid uid gid cuid cgid stime rtime ctime\n", 139 " key msqid perms cbytes qnum lspid lrpid uid gid cuid cgid stime rtime ctime\n",
141 IPC_MSG_IDS, sysvipc_msg_proc_show); 140 IPC_MSG_IDS, sysvipc_msg_proc_show);
diff --git a/ipc/shm.c b/ipc/shm.c
index 554429ade079..790240cd067f 100644
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -894,8 +894,6 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr)
894 if (!sfd) 894 if (!sfd)
895 goto out_put_dentry; 895 goto out_put_dentry;
896 896
897 err = -ENOMEM;
898
899 file = alloc_file(path.mnt, path.dentry, f_mode, &shm_file_operations); 897 file = alloc_file(path.mnt, path.dentry, f_mode, &shm_file_operations);
900 if (!file) 898 if (!file)
901 goto out_free; 899 goto out_free;
@@ -1060,16 +1058,16 @@ asmlinkage long sys_shmdt(char __user *shmaddr)
1060static int sysvipc_shm_proc_show(struct seq_file *s, void *it) 1058static int sysvipc_shm_proc_show(struct seq_file *s, void *it)
1061{ 1059{
1062 struct shmid_kernel *shp = it; 1060 struct shmid_kernel *shp = it;
1063 char *format;
1064 1061
1065#define SMALL_STRING "%10d %10d %4o %10u %5u %5u %5d %5u %5u %5u %5u %10lu %10lu %10lu\n" 1062#if BITS_PER_LONG <= 32
1066#define BIG_STRING "%10d %10d %4o %21u %5u %5u %5d %5u %5u %5u %5u %10lu %10lu %10lu\n" 1063#define SIZE_SPEC "%10lu"
1064#else
1065#define SIZE_SPEC "%21lu"
1066#endif
1067 1067
1068 if (sizeof(size_t) <= sizeof(int)) 1068 return seq_printf(s,
1069 format = SMALL_STRING; 1069 "%10d %10d %4o " SIZE_SPEC " %5u %5u "
1070 else 1070 "%5lu %5u %5u %5u %5u %10lu %10lu %10lu\n",
1071 format = BIG_STRING;
1072 return seq_printf(s, format,
1073 shp->shm_perm.key, 1071 shp->shm_perm.key,
1074 shp->shm_perm.id, 1072 shp->shm_perm.id,
1075 shp->shm_perm.mode, 1073 shp->shm_perm.mode,