diff options
Diffstat (limited to 'include/linux')
249 files changed, 5153 insertions, 2528 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 2b8a7d68fa..f7a52e19b4 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
| @@ -1,63 +1,344 @@ | |||
| 1 | header-y := byteorder/ dvb/ hdlc/ isdn/ nfsd/ raid/ sunrpc/ tc_act/ \ | 1 | header-y += byteorder/ |
| 2 | netfilter/ netfilter_arp/ netfilter_bridge/ netfilter_ipv4/ \ | 2 | header-y += dvb/ |
| 3 | netfilter_ipv6/ | 3 | header-y += hdlc/ |
| 4 | header-y += isdn/ | ||
| 5 | header-y += nfsd/ | ||
| 6 | header-y += raid/ | ||
| 7 | header-y += sunrpc/ | ||
| 8 | header-y += tc_act/ | ||
| 9 | header-y += netfilter/ | ||
| 10 | header-y += netfilter_arp/ | ||
| 11 | header-y += netfilter_bridge/ | ||
| 12 | header-y += netfilter_ipv4/ | ||
| 13 | header-y += netfilter_ipv6/ | ||
| 4 | 14 | ||
| 5 | header-y += affs_fs.h affs_hardblocks.h aio_abi.h a.out.h arcfb.h \ | 15 | header-y += affs_hardblocks.h |
| 6 | atmapi.h atmbr2684.h atmclip.h atm_eni.h atm_he.h \ | 16 | header-y += aio_abi.h |
| 7 | atm_idt77105.h atmioc.h atmlec.h atmmpc.h atm_nicstar.h \ | 17 | header-y += a.out.h |
| 8 | atmppp.h atmsap.h atmsvc.h atm_zatm.h auto_fs4.h auxvec.h \ | 18 | header-y += arcfb.h |
| 9 | awe_voice.h ax25.h b1lli.h baycom.h bfs_fs.h blkpg.h \ | 19 | header-y += atmapi.h |
| 10 | bpqether.h cdk.h chio.h coda_psdev.h coff.h comstats.h \ | 20 | header-y += atmbr2684.h |
| 11 | consolemap.h cycx_cfm.h dm-ioctl.h dn.h dqblk_v1.h \ | 21 | header-y += atmclip.h |
| 12 | dqblk_v2.h dqblk_xfs.h efs_fs_sb.h elf-fdpic.h elf.h elf-em.h \ | 22 | header-y += atm_eni.h |
| 13 | fadvise.h fd.h fdreg.h ftape-header-segment.h ftape-vendors.h \ | 23 | header-y += atm_he.h |
| 14 | fuse.h futex.h genetlink.h gen_stats.h gigaset_dev.h hdsmart.h \ | 24 | header-y += atm_idt77105.h |
| 15 | hpfs_fs.h hysdn_if.h i2c-dev.h i8k.h icmp.h \ | 25 | header-y += atmioc.h |
| 16 | if_arcnet.h if_arp.h if_bonding.h if_cablemodem.h if_fc.h \ | 26 | header-y += atmlec.h |
| 17 | if_fddi.h if.h if_hippi.h if_infiniband.h if_packet.h \ | 27 | header-y += atmmpc.h |
| 18 | if_plip.h if_ppp.h if_slip.h if_strip.h if_tunnel.h in6.h \ | 28 | header-y += atm_nicstar.h |
| 19 | in_route.h ioctl.h ip.h ipmi_msgdefs.h ip_mp_alg.h ipsec.h \ | 29 | header-y += atmppp.h |
| 20 | ipx.h irda.h isdn_divertif.h iso_fs.h ite_gpio.h ixjuser.h \ | 30 | header-y += atmsap.h |
| 21 | jffs2.h keyctl.h limits.h major.h matroxfb.h meye.h minix_fs.h \ | 31 | header-y += atmsvc.h |
| 22 | mmtimer.h mqueue.h mtio.h ncp_no.h netfilter_arp.h netrom.h \ | 32 | header-y += atm_zatm.h |
| 23 | nfs2.h nfs4_mount.h nfs_mount.h openprom_fs.h param.h \ | 33 | header-y += auto_fs4.h |
| 24 | pci_ids.h pci_regs.h personality.h pfkeyv2.h pg.h pkt_cls.h \ | 34 | header-y += auxvec.h |
| 25 | pkt_sched.h posix_types.h ppdev.h prctl.h ps2esdi.h qic117.h \ | 35 | header-y += awe_voice.h |
| 26 | qnxtypes.h quotaio_v1.h quotaio_v2.h radeonfb.h raw.h \ | 36 | header-y += ax25.h |
| 27 | resource.h rose.h sctp.h smbno.h snmp.h sockios.h som.h \ | 37 | header-y += b1lli.h |
| 28 | sound.h stddef.h synclink.h telephony.h termios.h ticable.h \ | 38 | header-y += baycom.h |
| 29 | times.h tiocl.h tipc.h toshiba.h ultrasound.h un.h utime.h \ | 39 | header-y += bfs_fs.h |
| 30 | utsname.h video_decoder.h video_encoder.h videotext.h vt.h \ | 40 | header-y += blkpg.h |
| 31 | wavefront.h wireless.h xattr.h x25.h zorro_ids.h | 41 | header-y += bpqether.h |
| 42 | header-y += cdk.h | ||
| 43 | header-y += chio.h | ||
| 44 | header-y += coda_psdev.h | ||
| 45 | header-y += coff.h | ||
| 46 | header-y += comstats.h | ||
| 47 | header-y += consolemap.h | ||
| 48 | header-y += cycx_cfm.h | ||
| 49 | header-y += dm-ioctl.h | ||
| 50 | header-y += dn.h | ||
| 51 | header-y += dqblk_v1.h | ||
| 52 | header-y += dqblk_v2.h | ||
| 53 | header-y += dqblk_xfs.h | ||
| 54 | header-y += efs_fs_sb.h | ||
| 55 | header-y += elf-fdpic.h | ||
| 56 | header-y += elf.h | ||
| 57 | header-y += elf-em.h | ||
| 58 | header-y += fadvise.h | ||
| 59 | header-y += fd.h | ||
| 60 | header-y += fdreg.h | ||
| 61 | header-y += fib_rules.h | ||
| 62 | header-y += ftape-header-segment.h | ||
| 63 | header-y += ftape-vendors.h | ||
| 64 | header-y += fuse.h | ||
| 65 | header-y += futex.h | ||
| 66 | header-y += genetlink.h | ||
| 67 | header-y += gen_stats.h | ||
| 68 | header-y += gigaset_dev.h | ||
| 69 | header-y += hdsmart.h | ||
| 70 | header-y += hysdn_if.h | ||
| 71 | header-y += i2c-dev.h | ||
| 72 | header-y += i8k.h | ||
| 73 | header-y += icmp.h | ||
| 74 | header-y += if_addr.h | ||
| 75 | header-y += if_arcnet.h | ||
| 76 | header-y += if_arp.h | ||
| 77 | header-y += if_bonding.h | ||
| 78 | header-y += if_cablemodem.h | ||
| 79 | header-y += if_fc.h | ||
| 80 | header-y += if_fddi.h | ||
| 81 | header-y += if.h | ||
| 82 | header-y += if_hippi.h | ||
| 83 | header-y += if_infiniband.h | ||
| 84 | header-y += if_link.h | ||
| 85 | header-y += if_packet.h | ||
| 86 | header-y += if_plip.h | ||
| 87 | header-y += if_ppp.h | ||
| 88 | header-y += if_slip.h | ||
| 89 | header-y += if_strip.h | ||
| 90 | header-y += if_tunnel.h | ||
| 91 | header-y += in6.h | ||
| 92 | header-y += in_route.h | ||
| 93 | header-y += ioctl.h | ||
| 94 | header-y += ip.h | ||
| 95 | header-y += ipmi_msgdefs.h | ||
| 96 | header-y += ip_mp_alg.h | ||
| 97 | header-y += ipsec.h | ||
| 98 | header-y += ipx.h | ||
| 99 | header-y += irda.h | ||
| 100 | header-y += isdn_divertif.h | ||
| 101 | header-y += iso_fs.h | ||
| 102 | header-y += ite_gpio.h | ||
| 103 | header-y += ixjuser.h | ||
| 104 | header-y += jffs2.h | ||
| 105 | header-y += keyctl.h | ||
| 106 | header-y += limits.h | ||
| 107 | header-y += magic.h | ||
| 108 | header-y += major.h | ||
| 109 | header-y += matroxfb.h | ||
| 110 | header-y += meye.h | ||
| 111 | header-y += minix_fs.h | ||
| 112 | header-y += mmtimer.h | ||
| 113 | header-y += mqueue.h | ||
| 114 | header-y += mtio.h | ||
| 115 | header-y += ncp_no.h | ||
| 116 | header-y += neighbour.h | ||
| 117 | header-y += netfilter_arp.h | ||
| 118 | header-y += netrom.h | ||
| 119 | header-y += nfs2.h | ||
| 120 | header-y += nfs4_mount.h | ||
| 121 | header-y += nfs_mount.h | ||
| 122 | header-y += param.h | ||
| 123 | header-y += pci_ids.h | ||
| 124 | header-y += pci_regs.h | ||
| 125 | header-y += personality.h | ||
| 126 | header-y += pfkeyv2.h | ||
| 127 | header-y += pg.h | ||
| 128 | header-y += pkt_cls.h | ||
| 129 | header-y += pkt_sched.h | ||
| 130 | header-y += posix_types.h | ||
| 131 | header-y += ppdev.h | ||
| 132 | header-y += prctl.h | ||
| 133 | header-y += ps2esdi.h | ||
| 134 | header-y += qic117.h | ||
| 135 | header-y += qnxtypes.h | ||
| 136 | header-y += quotaio_v1.h | ||
| 137 | header-y += quotaio_v2.h | ||
| 138 | header-y += radeonfb.h | ||
| 139 | header-y += raw.h | ||
| 140 | header-y += resource.h | ||
| 141 | header-y += rose.h | ||
| 142 | header-y += sctp.h | ||
| 143 | header-y += smbno.h | ||
| 144 | header-y += snmp.h | ||
| 145 | header-y += sockios.h | ||
| 146 | header-y += som.h | ||
| 147 | header-y += sound.h | ||
| 148 | header-y += synclink.h | ||
| 149 | header-y += telephony.h | ||
| 150 | header-y += termios.h | ||
| 151 | header-y += ticable.h | ||
| 152 | header-y += times.h | ||
| 153 | header-y += tiocl.h | ||
| 154 | header-y += tipc.h | ||
| 155 | header-y += toshiba.h | ||
| 156 | header-y += ultrasound.h | ||
| 157 | header-y += un.h | ||
| 158 | header-y += utime.h | ||
| 159 | header-y += utsname.h | ||
| 160 | header-y += video_decoder.h | ||
| 161 | header-y += video_encoder.h | ||
| 162 | header-y += videotext.h | ||
| 163 | header-y += vt.h | ||
| 164 | header-y += wavefront.h | ||
| 165 | header-y += wireless.h | ||
| 166 | header-y += xattr.h | ||
| 167 | header-y += x25.h | ||
| 168 | header-y += zorro_ids.h | ||
| 32 | 169 | ||
| 33 | unifdef-y += acct.h adb.h adfs_fs.h agpgart.h apm_bios.h atalk.h \ | 170 | unifdef-y += acct.h |
| 34 | atmarp.h atmdev.h atm.h atm_tcp.h audit.h auto_fs.h binfmts.h \ | 171 | unifdef-y += adb.h |
| 35 | capability.h capi.h cciss_ioctl.h cdrom.h cm4000_cs.h \ | 172 | unifdef-y += adfs_fs.h |
| 36 | cn_proc.h coda.h connector.h cramfs_fs.h cuda.h cyclades.h \ | 173 | unifdef-y += agpgart.h |
| 37 | dccp.h dirent.h divert.h elfcore.h errno.h errqueue.h \ | 174 | unifdef-y += apm_bios.h |
| 38 | ethtool.h eventpoll.h ext2_fs.h ext3_fs.h fb.h fcntl.h \ | 175 | unifdef-y += atalk.h |
| 39 | filter.h flat.h fs.h ftape.h gameport.h generic_serial.h \ | 176 | unifdef-y += atmarp.h |
| 40 | genhd.h hayesesp.h hdlcdrv.h hdlc.h hdreg.h hiddev.h hpet.h \ | 177 | unifdef-y += atmdev.h |
| 41 | i2c.h i2o-dev.h icmpv6.h if_bridge.h if_ec.h \ | 178 | unifdef-y += atm.h |
| 42 | if_eql.h if_ether.h if_frad.h if_ltalk.h if_pppox.h \ | 179 | unifdef-y += atm_tcp.h |
| 43 | if_shaper.h if_tr.h if_tun.h if_vlan.h if_wanpipe.h igmp.h \ | 180 | unifdef-y += audit.h |
| 44 | inet_diag.h in.h inotify.h input.h ipc.h ipmi.h ipv6.h \ | 181 | unifdef-y += auto_fs.h |
| 45 | ipv6_route.h isdn.h isdnif.h isdn_ppp.h isicom.h jbd.h \ | 182 | unifdef-y += binfmts.h |
| 46 | joystick.h kdev_t.h kd.h kernelcapi.h kernel.h keyboard.h \ | 183 | unifdef-y += capability.h |
| 47 | llc.h loop.h lp.h mempolicy.h mii.h mman.h mroute.h msdos_fs.h \ | 184 | unifdef-y += capi.h |
| 48 | msg.h nbd.h ncp_fs.h ncp.h ncp_mount.h netdevice.h \ | 185 | unifdef-y += cciss_ioctl.h |
| 49 | netfilter_bridge.h netfilter_decnet.h netfilter.h \ | 186 | unifdef-y += cdrom.h |
| 50 | netfilter_ipv4.h netfilter_ipv6.h netfilter_logging.h net.h \ | 187 | unifdef-y += cm4000_cs.h |
| 51 | netlink.h nfs3.h nfs4.h nfsacl.h nfs_fs.h nfs.h nfs_idmap.h \ | 188 | unifdef-y += cn_proc.h |
| 52 | n_r3964.h nubus.h nvram.h parport.h patchkey.h pci.h pktcdvd.h \ | 189 | unifdef-y += coda.h |
| 53 | pmu.h poll.h ppp_defs.h ppp-comp.h ptrace.h qnx4_fs.h quota.h \ | 190 | unifdef-y += connector.h |
| 54 | random.h reboot.h reiserfs_fs.h reiserfs_xattr.h romfs_fs.h \ | 191 | unifdef-y += cramfs_fs.h |
| 55 | route.h rtc.h rtnetlink.h scc.h sched.h sdla.h \ | 192 | unifdef-y += cuda.h |
| 56 | selinux_netlink.h sem.h serial_core.h serial.h serio.h shm.h \ | 193 | unifdef-y += cyclades.h |
| 57 | signal.h smb_fs.h smb.h smb_mount.h socket.h sonet.h sonypi.h \ | 194 | unifdef-y += dccp.h |
| 58 | soundcard.h stat.h sysctl.h tcp.h time.h timex.h tty.h types.h \ | 195 | unifdef-y += dirent.h |
| 59 | udf_fs_i.h udp.h uinput.h uio.h unistd.h usb_ch9.h \ | 196 | unifdef-y += divert.h |
| 60 | usbdevice_fs.h user.h videodev2.h videodev.h wait.h \ | 197 | unifdef-y += elfcore.h |
| 61 | wanrouter.h watchdog.h xfrm.h zftape.h | 198 | unifdef-y += errno.h |
| 199 | unifdef-y += errqueue.h | ||
| 200 | unifdef-y += ethtool.h | ||
| 201 | unifdef-y += eventpoll.h | ||
| 202 | unifdef-y += ext2_fs.h | ||
| 203 | unifdef-y += ext3_fs.h | ||
| 204 | unifdef-y += fb.h | ||
| 205 | unifdef-y += fcntl.h | ||
| 206 | unifdef-y += filter.h | ||
| 207 | unifdef-y += flat.h | ||
| 208 | unifdef-y += fs.h | ||
| 209 | unifdef-y += ftape.h | ||
| 210 | unifdef-y += gameport.h | ||
| 211 | unifdef-y += generic_serial.h | ||
| 212 | unifdef-y += genhd.h | ||
| 213 | unifdef-y += hayesesp.h | ||
| 214 | unifdef-y += hdlcdrv.h | ||
| 215 | unifdef-y += hdlc.h | ||
| 216 | unifdef-y += hdreg.h | ||
| 217 | unifdef-y += hiddev.h | ||
| 218 | unifdef-y += hpet.h | ||
| 219 | unifdef-y += i2c.h | ||
| 220 | unifdef-y += i2o-dev.h | ||
| 221 | unifdef-y += icmpv6.h | ||
| 222 | unifdef-y += if_bridge.h | ||
| 223 | unifdef-y += if_ec.h | ||
| 224 | unifdef-y += if_eql.h | ||
| 225 | unifdef-y += if_ether.h | ||
| 226 | unifdef-y += if_frad.h | ||
| 227 | unifdef-y += if_ltalk.h | ||
| 228 | unifdef-y += if_pppox.h | ||
| 229 | unifdef-y += if_shaper.h | ||
| 230 | unifdef-y += if_tr.h | ||
| 231 | unifdef-y += if_tun.h | ||
| 232 | unifdef-y += if_vlan.h | ||
| 233 | unifdef-y += if_wanpipe.h | ||
| 234 | unifdef-y += igmp.h | ||
| 235 | unifdef-y += inet_diag.h | ||
| 236 | unifdef-y += in.h | ||
| 237 | unifdef-y += inotify.h | ||
| 238 | unifdef-y += input.h | ||
| 239 | unifdef-y += ipc.h | ||
| 240 | unifdef-y += ipmi.h | ||
| 241 | unifdef-y += ipv6.h | ||
| 242 | unifdef-y += ipv6_route.h | ||
| 243 | unifdef-y += isdn.h | ||
| 244 | unifdef-y += isdnif.h | ||
| 245 | unifdef-y += isdn_ppp.h | ||
| 246 | unifdef-y += isicom.h | ||
| 247 | unifdef-y += jbd.h | ||
| 248 | unifdef-y += joystick.h | ||
| 249 | unifdef-y += kdev_t.h | ||
| 250 | unifdef-y += kd.h | ||
| 251 | unifdef-y += kernelcapi.h | ||
| 252 | unifdef-y += kernel.h | ||
| 253 | unifdef-y += keyboard.h | ||
| 254 | unifdef-y += llc.h | ||
| 255 | unifdef-y += loop.h | ||
| 256 | unifdef-y += lp.h | ||
| 257 | unifdef-y += mempolicy.h | ||
| 258 | unifdef-y += mii.h | ||
| 259 | unifdef-y += mman.h | ||
| 260 | unifdef-y += mroute.h | ||
| 261 | unifdef-y += msdos_fs.h | ||
| 262 | unifdef-y += msg.h | ||
| 263 | unifdef-y += nbd.h | ||
| 264 | unifdef-y += ncp_fs.h | ||
| 265 | unifdef-y += ncp.h | ||
| 266 | unifdef-y += ncp_mount.h | ||
| 267 | unifdef-y += netdevice.h | ||
| 268 | unifdef-y += netfilter_bridge.h | ||
| 269 | unifdef-y += netfilter_decnet.h | ||
| 270 | unifdef-y += netfilter.h | ||
| 271 | unifdef-y += netfilter_ipv4.h | ||
| 272 | unifdef-y += netfilter_ipv6.h | ||
| 273 | unifdef-y += net.h | ||
| 274 | unifdef-y += netlink.h | ||
| 275 | unifdef-y += nfs3.h | ||
| 276 | unifdef-y += nfs4.h | ||
| 277 | unifdef-y += nfsacl.h | ||
| 278 | unifdef-y += nfs_fs.h | ||
| 279 | unifdef-y += nfs.h | ||
| 280 | unifdef-y += nfs_idmap.h | ||
| 281 | unifdef-y += n_r3964.h | ||
| 282 | unifdef-y += nubus.h | ||
| 283 | unifdef-y += nvram.h | ||
| 284 | unifdef-y += parport.h | ||
| 285 | unifdef-y += patchkey.h | ||
| 286 | unifdef-y += pci.h | ||
| 287 | unifdef-y += pktcdvd.h | ||
| 288 | unifdef-y += pmu.h | ||
| 289 | unifdef-y += poll.h | ||
| 290 | unifdef-y += ppp_defs.h | ||
| 291 | unifdef-y += ppp-comp.h | ||
| 292 | unifdef-y += ptrace.h | ||
| 293 | unifdef-y += qnx4_fs.h | ||
| 294 | unifdef-y += quota.h | ||
| 295 | unifdef-y += random.h | ||
| 296 | unifdef-y += reboot.h | ||
| 297 | unifdef-y += reiserfs_fs.h | ||
| 298 | unifdef-y += reiserfs_xattr.h | ||
| 299 | unifdef-y += romfs_fs.h | ||
| 300 | unifdef-y += route.h | ||
| 301 | unifdef-y += rtc.h | ||
| 302 | unifdef-y += rtnetlink.h | ||
| 303 | unifdef-y += scc.h | ||
| 304 | unifdef-y += sched.h | ||
| 305 | unifdef-y += sdla.h | ||
| 306 | unifdef-y += selinux_netlink.h | ||
| 307 | unifdef-y += sem.h | ||
| 308 | unifdef-y += serial_core.h | ||
| 309 | unifdef-y += serial.h | ||
| 310 | unifdef-y += serio.h | ||
| 311 | unifdef-y += shm.h | ||
| 312 | unifdef-y += signal.h | ||
| 313 | unifdef-y += smb_fs.h | ||
| 314 | unifdef-y += smb.h | ||
| 315 | unifdef-y += smb_mount.h | ||
| 316 | unifdef-y += socket.h | ||
| 317 | unifdef-y += sonet.h | ||
| 318 | unifdef-y += sonypi.h | ||
| 319 | unifdef-y += soundcard.h | ||
| 320 | unifdef-y += stat.h | ||
| 321 | unifdef-y += stddef.h | ||
| 322 | unifdef-y += sysctl.h | ||
| 323 | unifdef-y += tcp.h | ||
| 324 | unifdef-y += time.h | ||
| 325 | unifdef-y += timex.h | ||
| 326 | unifdef-y += tty.h | ||
| 327 | unifdef-y += types.h | ||
| 328 | unifdef-y += udf_fs_i.h | ||
| 329 | unifdef-y += udp.h | ||
| 330 | unifdef-y += uinput.h | ||
| 331 | unifdef-y += uio.h | ||
| 332 | unifdef-y += unistd.h | ||
| 333 | unifdef-y += usb_ch9.h | ||
| 334 | unifdef-y += usbdevice_fs.h | ||
| 335 | unifdef-y += user.h | ||
| 336 | unifdef-y += videodev2.h | ||
| 337 | unifdef-y += videodev.h | ||
| 338 | unifdef-y += wait.h | ||
| 339 | unifdef-y += wanrouter.h | ||
| 340 | unifdef-y += watchdog.h | ||
| 341 | unifdef-y += xfrm.h | ||
| 342 | unifdef-y += zftape.h | ||
| 62 | 343 | ||
| 63 | objhdr-y := version.h | 344 | objhdr-y += version.h |
diff --git a/include/linux/acct.h b/include/linux/acct.h index e86bae7324..0496d1f099 100644 --- a/include/linux/acct.h +++ b/include/linux/acct.h | |||
| @@ -124,16 +124,12 @@ extern void acct_auto_close(struct super_block *sb); | |||
| 124 | extern void acct_init_pacct(struct pacct_struct *pacct); | 124 | extern void acct_init_pacct(struct pacct_struct *pacct); |
| 125 | extern void acct_collect(long exitcode, int group_dead); | 125 | extern void acct_collect(long exitcode, int group_dead); |
| 126 | extern void acct_process(void); | 126 | extern void acct_process(void); |
| 127 | extern void acct_update_integrals(struct task_struct *tsk); | ||
| 128 | extern void acct_clear_integrals(struct task_struct *tsk); | ||
| 129 | #else | 127 | #else |
| 130 | #define acct_auto_close_mnt(x) do { } while (0) | 128 | #define acct_auto_close_mnt(x) do { } while (0) |
| 131 | #define acct_auto_close(x) do { } while (0) | 129 | #define acct_auto_close(x) do { } while (0) |
| 132 | #define acct_init_pacct(x) do { } while (0) | 130 | #define acct_init_pacct(x) do { } while (0) |
| 133 | #define acct_collect(x,y) do { } while (0) | 131 | #define acct_collect(x,y) do { } while (0) |
| 134 | #define acct_process() do { } while (0) | 132 | #define acct_process() do { } while (0) |
| 135 | #define acct_update_integrals(x) do { } while (0) | ||
| 136 | #define acct_clear_integrals(task) do { } while (0) | ||
| 137 | #endif | 133 | #endif |
| 138 | 134 | ||
| 139 | /* | 135 | /* |
diff --git a/include/linux/adfs_fs.h b/include/linux/adfs_fs.h index 4a5d50c2bd..ef788c2085 100644 --- a/include/linux/adfs_fs.h +++ b/include/linux/adfs_fs.h | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | #define _ADFS_FS_H | 2 | #define _ADFS_FS_H |
| 3 | 3 | ||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | #include <linux/magic.h> | ||
| 5 | 6 | ||
| 6 | /* | 7 | /* |
| 7 | * Disc Record at disc address 0xc00 | 8 | * Disc Record at disc address 0xc00 |
| @@ -38,7 +39,6 @@ struct adfs_discrecord { | |||
| 38 | #define ADFS_DR_OFFSET (0x1c0) | 39 | #define ADFS_DR_OFFSET (0x1c0) |
| 39 | #define ADFS_DR_SIZE 60 | 40 | #define ADFS_DR_SIZE 60 |
| 40 | #define ADFS_DR_SIZE_BITS (ADFS_DR_SIZE << 3) | 41 | #define ADFS_DR_SIZE_BITS (ADFS_DR_SIZE << 3) |
| 41 | #define ADFS_SUPER_MAGIC 0xadf5 | ||
| 42 | 42 | ||
| 43 | #ifdef __KERNEL__ | 43 | #ifdef __KERNEL__ |
| 44 | #include <linux/adfs_fs_i.h> | 44 | #include <linux/adfs_fs_i.h> |
diff --git a/include/linux/aer.h b/include/linux/aer.h new file mode 100644 index 0000000000..402e178b38 --- /dev/null +++ b/include/linux/aer.h | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2006 Intel Corp. | ||
| 3 | * Tom Long Nguyen (tom.l.nguyen@intel.com) | ||
| 4 | * Zhang Yanmin (yanmin.zhang@intel.com) | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef _AER_H_ | ||
| 8 | #define _AER_H_ | ||
| 9 | |||
| 10 | #if defined(CONFIG_PCIEAER) | ||
| 11 | /* pci-e port driver needs this function to enable aer */ | ||
| 12 | extern int pci_enable_pcie_error_reporting(struct pci_dev *dev); | ||
| 13 | extern int pci_find_aer_capability(struct pci_dev *dev); | ||
| 14 | extern int pci_disable_pcie_error_reporting(struct pci_dev *dev); | ||
| 15 | extern int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev); | ||
| 16 | #else | ||
| 17 | #define pci_enable_pcie_error_reporting(dev) do { } while (0) | ||
| 18 | #define pci_find_aer_capability(dev) do { } while (0) | ||
| 19 | #define pci_disable_pcie_error_reporting(dev) do { } while (0) | ||
| 20 | #define pci_cleanup_aer_uncorrect_error_status(dev) do { } while (0) | ||
| 21 | #endif | ||
| 22 | |||
| 23 | #endif //_AER_H_ | ||
| 24 | |||
diff --git a/include/linux/affs_fs.h b/include/linux/affs_fs.h deleted file mode 100644 index c57b5ee87d..0000000000 --- a/include/linux/affs_fs.h +++ /dev/null | |||
| @@ -1,7 +0,0 @@ | |||
| 1 | #ifndef _AFFS_FS_H | ||
| 2 | #define _AFFS_FS_H | ||
| 3 | /* | ||
| 4 | * The affs filesystem constants/structures | ||
| 5 | */ | ||
| 6 | #define AFFS_SUPER_MAGIC 0xadff | ||
| 7 | #endif | ||
diff --git a/include/linux/aio.h b/include/linux/aio.h index 00c8efa95c..0d71c0041f 100644 --- a/include/linux/aio.h +++ b/include/linux/aio.h | |||
| @@ -4,8 +4,10 @@ | |||
| 4 | #include <linux/list.h> | 4 | #include <linux/list.h> |
| 5 | #include <linux/workqueue.h> | 5 | #include <linux/workqueue.h> |
| 6 | #include <linux/aio_abi.h> | 6 | #include <linux/aio_abi.h> |
| 7 | #include <linux/uio.h> | ||
| 7 | 8 | ||
| 8 | #include <asm/atomic.h> | 9 | #include <asm/atomic.h> |
| 10 | #include <linux/uio.h> | ||
| 9 | 11 | ||
| 10 | #define AIO_MAXSEGS 4 | 12 | #define AIO_MAXSEGS 4 |
| 11 | #define AIO_KIOGRP_NR_ATOMIC 8 | 13 | #define AIO_KIOGRP_NR_ATOMIC 8 |
| @@ -110,8 +112,10 @@ struct kiocb { | |||
| 110 | char __user *ki_buf; /* remaining iocb->aio_buf */ | 112 | char __user *ki_buf; /* remaining iocb->aio_buf */ |
| 111 | size_t ki_left; /* remaining bytes */ | 113 | size_t ki_left; /* remaining bytes */ |
| 112 | long ki_retried; /* just for testing */ | 114 | long ki_retried; /* just for testing */ |
| 113 | long ki_kicked; /* just for testing */ | 115 | struct iovec ki_inline_vec; /* inline vector */ |
| 114 | long ki_queued; /* just for testing */ | 116 | struct iovec *ki_iovec; |
| 117 | unsigned long ki_nr_segs; | ||
| 118 | unsigned long ki_cur_seg; | ||
| 115 | 119 | ||
| 116 | struct list_head ki_list; /* the aio core uses this | 120 | struct list_head ki_list; /* the aio core uses this |
| 117 | * for cancellation */ | 121 | * for cancellation */ |
| @@ -213,11 +217,11 @@ int FASTCALL(io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb, | |||
| 213 | struct iocb *iocb)); | 217 | struct iocb *iocb)); |
| 214 | 218 | ||
| 215 | #define get_ioctx(kioctx) do { \ | 219 | #define get_ioctx(kioctx) do { \ |
| 216 | BUG_ON(unlikely(atomic_read(&(kioctx)->users) <= 0)); \ | 220 | BUG_ON(atomic_read(&(kioctx)->users) <= 0); \ |
| 217 | atomic_inc(&(kioctx)->users); \ | 221 | atomic_inc(&(kioctx)->users); \ |
| 218 | } while (0) | 222 | } while (0) |
| 219 | #define put_ioctx(kioctx) do { \ | 223 | #define put_ioctx(kioctx) do { \ |
| 220 | BUG_ON(unlikely(atomic_read(&(kioctx)->users) <= 0)); \ | 224 | BUG_ON(atomic_read(&(kioctx)->users) <= 0); \ |
| 221 | if (unlikely(atomic_dec_and_test(&(kioctx)->users))) \ | 225 | if (unlikely(atomic_dec_and_test(&(kioctx)->users))) \ |
| 222 | __put_ioctx(kioctx); \ | 226 | __put_ioctx(kioctx); \ |
| 223 | } while (0) | 227 | } while (0) |
diff --git a/include/linux/aio_abi.h b/include/linux/aio_abi.h index 30fdcc89d1..3466b1d0ff 100644 --- a/include/linux/aio_abi.h +++ b/include/linux/aio_abi.h | |||
| @@ -41,6 +41,8 @@ enum { | |||
| 41 | * IOCB_CMD_POLL = 5, | 41 | * IOCB_CMD_POLL = 5, |
| 42 | */ | 42 | */ |
| 43 | IOCB_CMD_NOOP = 6, | 43 | IOCB_CMD_NOOP = 6, |
| 44 | IOCB_CMD_PREADV = 7, | ||
| 45 | IOCB_CMD_PWRITEV = 8, | ||
| 44 | }; | 46 | }; |
| 45 | 47 | ||
| 46 | /* read() from /dev/aio returns these structures. */ | 48 | /* read() from /dev/aio returns these structures. */ |
diff --git a/include/linux/ata.h b/include/linux/ata.h index 3671af8696..d894419070 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
| @@ -40,6 +40,8 @@ enum { | |||
| 40 | ATA_MAX_DEVICES = 2, /* per bus/port */ | 40 | ATA_MAX_DEVICES = 2, /* per bus/port */ |
| 41 | ATA_MAX_PRD = 256, /* we could make these 256/256 */ | 41 | ATA_MAX_PRD = 256, /* we could make these 256/256 */ |
| 42 | ATA_SECT_SIZE = 512, | 42 | ATA_SECT_SIZE = 512, |
| 43 | ATA_MAX_SECTORS = 256, | ||
| 44 | ATA_MAX_SECTORS_LBA48 = 65535,/* TODO: 65536? */ | ||
| 43 | 45 | ||
| 44 | ATA_ID_WORDS = 256, | 46 | ATA_ID_WORDS = 256, |
| 45 | ATA_ID_SERNO_OFS = 10, | 47 | ATA_ID_SERNO_OFS = 10, |
| @@ -168,12 +170,16 @@ enum { | |||
| 168 | XFER_UDMA_2 = 0x42, | 170 | XFER_UDMA_2 = 0x42, |
| 169 | XFER_UDMA_1 = 0x41, | 171 | XFER_UDMA_1 = 0x41, |
| 170 | XFER_UDMA_0 = 0x40, | 172 | XFER_UDMA_0 = 0x40, |
| 173 | XFER_MW_DMA_4 = 0x24, /* CFA only */ | ||
| 174 | XFER_MW_DMA_3 = 0x23, /* CFA only */ | ||
| 171 | XFER_MW_DMA_2 = 0x22, | 175 | XFER_MW_DMA_2 = 0x22, |
| 172 | XFER_MW_DMA_1 = 0x21, | 176 | XFER_MW_DMA_1 = 0x21, |
| 173 | XFER_MW_DMA_0 = 0x20, | 177 | XFER_MW_DMA_0 = 0x20, |
| 174 | XFER_SW_DMA_2 = 0x12, | 178 | XFER_SW_DMA_2 = 0x12, |
| 175 | XFER_SW_DMA_1 = 0x11, | 179 | XFER_SW_DMA_1 = 0x11, |
| 176 | XFER_SW_DMA_0 = 0x10, | 180 | XFER_SW_DMA_0 = 0x10, |
| 181 | XFER_PIO_6 = 0x0E, /* CFA only */ | ||
| 182 | XFER_PIO_5 = 0x0D, /* CFA only */ | ||
| 177 | XFER_PIO_4 = 0x0C, | 183 | XFER_PIO_4 = 0x0C, |
| 178 | XFER_PIO_3 = 0x0B, | 184 | XFER_PIO_3 = 0x0B, |
| 179 | XFER_PIO_2 = 0x0A, | 185 | XFER_PIO_2 = 0x0A, |
| @@ -272,7 +278,6 @@ struct ata_taskfile { | |||
| 272 | }; | 278 | }; |
| 273 | 279 | ||
| 274 | #define ata_id_is_ata(id) (((id)[0] & (1 << 15)) == 0) | 280 | #define ata_id_is_ata(id) (((id)[0] & (1 << 15)) == 0) |
| 275 | #define ata_id_is_cfa(id) ((id)[0] == 0x848A) | ||
| 276 | #define ata_id_is_sata(id) ((id)[93] == 0) | 281 | #define ata_id_is_sata(id) ((id)[93] == 0) |
| 277 | #define ata_id_rahead_enabled(id) ((id)[85] & (1 << 6)) | 282 | #define ata_id_rahead_enabled(id) ((id)[85] & (1 << 6)) |
| 278 | #define ata_id_wcache_enabled(id) ((id)[85] & (1 << 5)) | 283 | #define ata_id_wcache_enabled(id) ((id)[85] & (1 << 5)) |
| @@ -304,6 +309,9 @@ static inline unsigned int ata_id_major_version(const u16 *id) | |||
| 304 | { | 309 | { |
| 305 | unsigned int mver; | 310 | unsigned int mver; |
| 306 | 311 | ||
| 312 | if (id[ATA_ID_MAJOR_VER] == 0xFFFF) | ||
| 313 | return 0; | ||
| 314 | |||
| 307 | for (mver = 14; mver >= 1; mver--) | 315 | for (mver = 14; mver >= 1; mver--) |
| 308 | if (id[ATA_ID_MAJOR_VER] & (1 << mver)) | 316 | if (id[ATA_ID_MAJOR_VER] & (1 << mver)) |
| 309 | break; | 317 | break; |
| @@ -312,8 +320,8 @@ static inline unsigned int ata_id_major_version(const u16 *id) | |||
| 312 | 320 | ||
| 313 | static inline int ata_id_current_chs_valid(const u16 *id) | 321 | static inline int ata_id_current_chs_valid(const u16 *id) |
| 314 | { | 322 | { |
| 315 | /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command | 323 | /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command |
| 316 | has not been issued to the device then the values of | 324 | has not been issued to the device then the values of |
| 317 | id[54] to id[56] are vendor specific. */ | 325 | id[54] to id[56] are vendor specific. */ |
| 318 | return (id[53] & 0x01) && /* Current translation valid */ | 326 | return (id[53] & 0x01) && /* Current translation valid */ |
| 319 | id[54] && /* cylinders in current translation */ | 327 | id[54] && /* cylinders in current translation */ |
| @@ -322,6 +330,18 @@ static inline int ata_id_current_chs_valid(const u16 *id) | |||
| 322 | id[56]; /* sectors in current translation */ | 330 | id[56]; /* sectors in current translation */ |
| 323 | } | 331 | } |
| 324 | 332 | ||
| 333 | static inline int ata_id_is_cfa(const u16 *id) | ||
| 334 | { | ||
| 335 | u16 v = id[0]; | ||
| 336 | if (v == 0x848A) /* Standard CF */ | ||
| 337 | return 1; | ||
| 338 | /* Could be CF hiding as standard ATA */ | ||
| 339 | if (ata_id_major_version(id) >= 3 && id[82] != 0xFFFF && | ||
| 340 | (id[82] & ( 1 << 2))) | ||
| 341 | return 1; | ||
| 342 | return 0; | ||
| 343 | } | ||
| 344 | |||
| 325 | static inline int atapi_cdb_len(const u16 *dev_id) | 345 | static inline int atapi_cdb_len(const u16 *dev_id) |
| 326 | { | 346 | { |
| 327 | u16 tmp = dev_id[0] & 0x3; | 347 | u16 tmp = dev_id[0] & 0x3; |
diff --git a/include/linux/atalk.h b/include/linux/atalk.h index 6ba3aa8a81..75b8baca08 100644 --- a/include/linux/atalk.h +++ b/include/linux/atalk.h | |||
| @@ -88,15 +88,7 @@ static inline struct atalk_sock *at_sk(struct sock *sk) | |||
| 88 | #include <asm/byteorder.h> | 88 | #include <asm/byteorder.h> |
| 89 | 89 | ||
| 90 | struct ddpehdr { | 90 | struct ddpehdr { |
| 91 | #ifdef __LITTLE_ENDIAN_BITFIELD | 91 | __be16 deh_len_hops; /* lower 10 bits are length, next 4 - hops */ |
| 92 | __u16 deh_len:10, | ||
| 93 | deh_hops:4, | ||
| 94 | deh_pad:2; | ||
| 95 | #else | ||
| 96 | __u16 deh_pad:2, | ||
| 97 | deh_hops:4, | ||
| 98 | deh_len:10; | ||
| 99 | #endif | ||
| 100 | __be16 deh_sum; | 92 | __be16 deh_sum; |
| 101 | __be16 deh_dnet; | 93 | __be16 deh_dnet; |
| 102 | __be16 deh_snet; | 94 | __be16 deh_snet; |
| @@ -112,36 +104,6 @@ static __inline__ struct ddpehdr *ddp_hdr(struct sk_buff *skb) | |||
| 112 | return (struct ddpehdr *)skb->h.raw; | 104 | return (struct ddpehdr *)skb->h.raw; |
| 113 | } | 105 | } |
| 114 | 106 | ||
| 115 | /* | ||
| 116 | * Don't drop the struct into the struct above. You'll get some | ||
| 117 | * surprise padding. | ||
| 118 | */ | ||
| 119 | struct ddpebits { | ||
| 120 | #ifdef __LITTLE_ENDIAN_BITFIELD | ||
| 121 | __u16 deh_len:10, | ||
| 122 | deh_hops:4, | ||
| 123 | deh_pad:2; | ||
| 124 | #else | ||
| 125 | __u16 deh_pad:2, | ||
| 126 | deh_hops:4, | ||
| 127 | deh_len:10; | ||
| 128 | #endif | ||
| 129 | }; | ||
| 130 | |||
| 131 | /* Short form header */ | ||
| 132 | struct ddpshdr { | ||
| 133 | #ifdef __LITTLE_ENDIAN_BITFIELD | ||
| 134 | __u16 dsh_len:10, | ||
| 135 | dsh_pad:6; | ||
| 136 | #else | ||
| 137 | __u16 dsh_pad:6, | ||
| 138 | dsh_len:10; | ||
| 139 | #endif | ||
| 140 | __u8 dsh_dport; | ||
| 141 | __u8 dsh_sport; | ||
| 142 | /* And netatalk apps expect to stick the type in themselves */ | ||
| 143 | }; | ||
| 144 | |||
| 145 | /* AppleTalk AARP headers */ | 107 | /* AppleTalk AARP headers */ |
| 146 | struct elapaarp { | 108 | struct elapaarp { |
| 147 | __be16 hw_type; | 109 | __be16 hw_type; |
diff --git a/include/linux/atmlec.h b/include/linux/atmlec.h index f267f24427..6f5a1bab8f 100644 --- a/include/linux/atmlec.h +++ b/include/linux/atmlec.h | |||
| @@ -1,9 +1,7 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * | 2 | * ATM Lan Emulation Daemon driver interface |
| 3 | * ATM Lan Emulation Daemon vs. driver interface | ||
| 4 | * | ||
| 5 | * mkiiskila@yahoo.com | ||
| 6 | * | 3 | * |
| 4 | * Marko Kiiskila <mkiiskila@yahoo.com> | ||
| 7 | */ | 5 | */ |
| 8 | 6 | ||
| 9 | #ifndef _ATMLEC_H_ | 7 | #ifndef _ATMLEC_H_ |
| @@ -13,76 +11,87 @@ | |||
| 13 | #include <linux/atmioc.h> | 11 | #include <linux/atmioc.h> |
| 14 | #include <linux/atm.h> | 12 | #include <linux/atm.h> |
| 15 | #include <linux/if_ether.h> | 13 | #include <linux/if_ether.h> |
| 14 | |||
| 16 | /* ATM lec daemon control socket */ | 15 | /* ATM lec daemon control socket */ |
| 17 | #define ATMLEC_CTRL _IO('a',ATMIOC_LANE) | 16 | #define ATMLEC_CTRL _IO('a', ATMIOC_LANE) |
| 18 | #define ATMLEC_DATA _IO('a',ATMIOC_LANE+1) | 17 | #define ATMLEC_DATA _IO('a', ATMIOC_LANE+1) |
| 19 | #define ATMLEC_MCAST _IO('a',ATMIOC_LANE+2) | 18 | #define ATMLEC_MCAST _IO('a', ATMIOC_LANE+2) |
| 20 | 19 | ||
| 21 | /* Maximum number of LEC interfaces (tweakable) */ | 20 | /* Maximum number of LEC interfaces (tweakable) */ |
| 22 | #define MAX_LEC_ITF 48 | 21 | #define MAX_LEC_ITF 48 |
| 23 | 22 | ||
| 24 | /* From the total of MAX_LEC_ITF, last NUM_TR_DEVS are reserved for Token Ring. | 23 | /* |
| 24 | * From the total of MAX_LEC_ITF, last NUM_TR_DEVS are reserved for Token Ring. | ||
| 25 | * E.g. if MAX_LEC_ITF = 48 and NUM_TR_DEVS = 8, then lec0-lec39 are for | 25 | * E.g. if MAX_LEC_ITF = 48 and NUM_TR_DEVS = 8, then lec0-lec39 are for |
| 26 | * Ethernet ELANs and lec40-lec47 are for Token Ring ELANS. | 26 | * Ethernet ELANs and lec40-lec47 are for Token Ring ELANS. |
| 27 | */ | 27 | */ |
| 28 | #define NUM_TR_DEVS 8 | 28 | #define NUM_TR_DEVS 8 |
| 29 | 29 | ||
| 30 | typedef enum { | 30 | typedef enum { |
| 31 | l_set_mac_addr, l_del_mac_addr, | 31 | l_set_mac_addr, |
| 32 | l_svc_setup, | 32 | l_del_mac_addr, |
| 33 | l_addr_delete, l_topology_change, | 33 | l_svc_setup, |
| 34 | l_flush_complete, l_arp_update, | 34 | l_addr_delete, |
| 35 | l_narp_req, /* LANE2 mandates the use of this */ | 35 | l_topology_change, |
| 36 | l_config, l_flush_tran_id, | 36 | l_flush_complete, |
| 37 | l_set_lecid, l_arp_xmt, | 37 | l_arp_update, |
| 38 | l_rdesc_arp_xmt, | 38 | l_narp_req, /* LANE2 mandates the use of this */ |
| 39 | l_associate_req, | 39 | l_config, |
| 40 | l_should_bridge /* should we bridge this MAC? */ | 40 | l_flush_tran_id, |
| 41 | l_set_lecid, | ||
| 42 | l_arp_xmt, | ||
| 43 | l_rdesc_arp_xmt, | ||
| 44 | l_associate_req, | ||
| 45 | l_should_bridge /* should we bridge this MAC? */ | ||
| 41 | } atmlec_msg_type; | 46 | } atmlec_msg_type; |
| 42 | 47 | ||
| 43 | #define ATMLEC_MSG_TYPE_MAX l_should_bridge | 48 | #define ATMLEC_MSG_TYPE_MAX l_should_bridge |
| 44 | 49 | ||
| 45 | struct atmlec_config_msg { | 50 | struct atmlec_config_msg { |
| 46 | unsigned int maximum_unknown_frame_count; | 51 | unsigned int maximum_unknown_frame_count; |
| 47 | unsigned int max_unknown_frame_time; | 52 | unsigned int max_unknown_frame_time; |
| 48 | unsigned short max_retry_count; | 53 | unsigned short max_retry_count; |
| 49 | unsigned int aging_time; | 54 | unsigned int aging_time; |
| 50 | unsigned int forward_delay_time; | 55 | unsigned int forward_delay_time; |
| 51 | unsigned int arp_response_time; | 56 | unsigned int arp_response_time; |
| 52 | unsigned int flush_timeout; | 57 | unsigned int flush_timeout; |
| 53 | unsigned int path_switching_delay; | 58 | unsigned int path_switching_delay; |
| 54 | unsigned int lane_version; /* LANE2: 1 for LANEv1, 2 for LANEv2 */ | 59 | unsigned int lane_version; /* LANE2: 1 for LANEv1, 2 for LANEv2 */ |
| 55 | int mtu; | 60 | int mtu; |
| 56 | int is_proxy; | 61 | int is_proxy; |
| 57 | }; | 62 | }; |
| 58 | 63 | ||
| 59 | struct atmlec_msg { | 64 | struct atmlec_msg { |
| 60 | atmlec_msg_type type; | 65 | atmlec_msg_type type; |
| 61 | int sizeoftlvs; /* LANE2: if != 0, tlvs follow */ | 66 | int sizeoftlvs; /* LANE2: if != 0, tlvs follow */ |
| 62 | union { | 67 | union { |
| 63 | struct { | 68 | struct { |
| 64 | unsigned char mac_addr[ETH_ALEN]; | 69 | unsigned char mac_addr[ETH_ALEN]; |
| 65 | unsigned char atm_addr[ATM_ESA_LEN]; | 70 | unsigned char atm_addr[ATM_ESA_LEN]; |
| 66 | unsigned int flag;/* Topology_change flag, | 71 | unsigned int flag; /* |
| 67 | remoteflag, permanent flag, | 72 | * Topology_change flag, |
| 68 | lecid, transaction id */ | 73 | * remoteflag, permanent flag, |
| 69 | unsigned int targetless_le_arp; /* LANE2 */ | 74 | * lecid, transaction id |
| 70 | unsigned int no_source_le_narp; /* LANE2 */ | 75 | */ |
| 71 | } normal; | 76 | unsigned int targetless_le_arp; /* LANE2 */ |
| 72 | struct atmlec_config_msg config; | 77 | unsigned int no_source_le_narp; /* LANE2 */ |
| 73 | struct { | 78 | } normal; |
| 74 | uint16_t lec_id; /* requestor lec_id */ | 79 | struct atmlec_config_msg config; |
| 75 | uint32_t tran_id; /* transaction id */ | 80 | struct { |
| 76 | unsigned char mac_addr[ETH_ALEN]; /* dst mac addr */ | 81 | uint16_t lec_id; /* requestor lec_id */ |
| 77 | unsigned char atm_addr[ATM_ESA_LEN]; /* reqestor ATM addr */ | 82 | uint32_t tran_id; /* transaction id */ |
| 78 | } proxy; | 83 | unsigned char mac_addr[ETH_ALEN]; /* dst mac addr */ |
| 79 | /* For mapping LE_ARP requests to responses. Filled by */ | 84 | unsigned char atm_addr[ATM_ESA_LEN]; /* reqestor ATM addr */ |
| 80 | } content; /* zeppelin, returned by kernel. Used only when proxying */ | 85 | } proxy; /* |
| 86 | * For mapping LE_ARP requests to responses. Filled by | ||
| 87 | * zeppelin, returned by kernel. Used only when proxying | ||
| 88 | */ | ||
| 89 | } content; | ||
| 81 | } __ATM_API_ALIGN; | 90 | } __ATM_API_ALIGN; |
| 82 | 91 | ||
| 83 | struct atmlec_ioc { | 92 | struct atmlec_ioc { |
| 84 | int dev_num; | 93 | int dev_num; |
| 85 | unsigned char atm_addr[ATM_ESA_LEN]; | 94 | unsigned char atm_addr[ATM_ESA_LEN]; |
| 86 | unsigned char receive; /* 1= receive vcc, 0 = send vcc */ | 95 | unsigned char receive; /* 1= receive vcc, 0 = send vcc */ |
| 87 | }; | 96 | }; |
| 88 | #endif /* _ATMLEC_H_ */ | 97 | #endif /* _ATMLEC_H_ */ |
diff --git a/include/linux/audit.h b/include/linux/audit.h index 40a6c26294..c3aa097518 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
| @@ -95,6 +95,11 @@ | |||
| 95 | #define AUDIT_MAC_POLICY_LOAD 1403 /* Policy file load */ | 95 | #define AUDIT_MAC_POLICY_LOAD 1403 /* Policy file load */ |
| 96 | #define AUDIT_MAC_STATUS 1404 /* Changed enforcing,permissive,off */ | 96 | #define AUDIT_MAC_STATUS 1404 /* Changed enforcing,permissive,off */ |
| 97 | #define AUDIT_MAC_CONFIG_CHANGE 1405 /* Changes to booleans */ | 97 | #define AUDIT_MAC_CONFIG_CHANGE 1405 /* Changes to booleans */ |
| 98 | #define AUDIT_MAC_UNLBL_ALLOW 1406 /* NetLabel: allow unlabeled traffic */ | ||
| 99 | #define AUDIT_MAC_CIPSOV4_ADD 1407 /* NetLabel: add CIPSOv4 DOI entry */ | ||
| 100 | #define AUDIT_MAC_CIPSOV4_DEL 1408 /* NetLabel: del CIPSOv4 DOI entry */ | ||
| 101 | #define AUDIT_MAC_MAP_ADD 1409 /* NetLabel: add LSM domain mapping */ | ||
| 102 | #define AUDIT_MAC_MAP_DEL 1410 /* NetLabel: del LSM domain mapping */ | ||
| 98 | 103 | ||
| 99 | #define AUDIT_FIRST_KERN_ANOM_MSG 1700 | 104 | #define AUDIT_FIRST_KERN_ANOM_MSG 1700 |
| 100 | #define AUDIT_LAST_KERN_ANOM_MSG 1799 | 105 | #define AUDIT_LAST_KERN_ANOM_MSG 1799 |
diff --git a/include/linux/bio.h b/include/linux/bio.h index 76bdaeab6f..711c321a70 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
| @@ -148,6 +148,7 @@ struct bio { | |||
| 148 | #define BIO_RW_BARRIER 2 | 148 | #define BIO_RW_BARRIER 2 |
| 149 | #define BIO_RW_FAILFAST 3 | 149 | #define BIO_RW_FAILFAST 3 |
| 150 | #define BIO_RW_SYNC 4 | 150 | #define BIO_RW_SYNC 4 |
| 151 | #define BIO_RW_META 5 | ||
| 151 | 152 | ||
| 152 | /* | 153 | /* |
| 153 | * upper 16 bits of bi_rw define the io priority of this bio | 154 | * upper 16 bits of bi_rw define the io priority of this bio |
| @@ -178,6 +179,7 @@ struct bio { | |||
| 178 | #define bio_sync(bio) ((bio)->bi_rw & (1 << BIO_RW_SYNC)) | 179 | #define bio_sync(bio) ((bio)->bi_rw & (1 << BIO_RW_SYNC)) |
| 179 | #define bio_failfast(bio) ((bio)->bi_rw & (1 << BIO_RW_FAILFAST)) | 180 | #define bio_failfast(bio) ((bio)->bi_rw & (1 << BIO_RW_FAILFAST)) |
| 180 | #define bio_rw_ahead(bio) ((bio)->bi_rw & (1 << BIO_RW_AHEAD)) | 181 | #define bio_rw_ahead(bio) ((bio)->bi_rw & (1 << BIO_RW_AHEAD)) |
| 182 | #define bio_rw_meta(bio) ((bio)->bi_rw & (1 << BIO_RW_META)) | ||
| 181 | 183 | ||
| 182 | /* | 184 | /* |
| 183 | * will die | 185 | * will die |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index aafe82788b..1d79b8d4ca 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | #ifndef _LINUX_BLKDEV_H | 1 | #ifndef _LINUX_BLKDEV_H |
| 2 | #define _LINUX_BLKDEV_H | 2 | #define _LINUX_BLKDEV_H |
| 3 | 3 | ||
| 4 | #include <linux/sched.h> | ||
| 4 | #include <linux/major.h> | 5 | #include <linux/major.h> |
| 5 | #include <linux/genhd.h> | 6 | #include <linux/genhd.h> |
| 6 | #include <linux/list.h> | 7 | #include <linux/list.h> |
| @@ -16,6 +17,22 @@ | |||
| 16 | 17 | ||
| 17 | #include <asm/scatterlist.h> | 18 | #include <asm/scatterlist.h> |
| 18 | 19 | ||
| 20 | #ifdef CONFIG_LBD | ||
| 21 | # include <asm/div64.h> | ||
| 22 | # define sector_div(a, b) do_div(a, b) | ||
| 23 | #else | ||
| 24 | # define sector_div(n, b)( \ | ||
| 25 | { \ | ||
| 26 | int _res; \ | ||
| 27 | _res = (n) % (b); \ | ||
| 28 | (n) /= (b); \ | ||
| 29 | _res; \ | ||
| 30 | } \ | ||
| 31 | ) | ||
| 32 | #endif | ||
| 33 | |||
| 34 | #ifdef CONFIG_BLOCK | ||
| 35 | |||
| 19 | struct scsi_ioctl_command; | 36 | struct scsi_ioctl_command; |
| 20 | 37 | ||
| 21 | struct request_queue; | 38 | struct request_queue; |
| @@ -90,7 +107,7 @@ struct io_context { | |||
| 90 | atomic_t refcount; | 107 | atomic_t refcount; |
| 91 | struct task_struct *task; | 108 | struct task_struct *task; |
| 92 | 109 | ||
| 93 | int (*set_ioprio)(struct io_context *, unsigned int); | 110 | unsigned int ioprio_changed; |
| 94 | 111 | ||
| 95 | /* | 112 | /* |
| 96 | * For request batching | 113 | * For request batching |
| @@ -104,8 +121,7 @@ struct io_context { | |||
| 104 | 121 | ||
| 105 | void put_io_context(struct io_context *ioc); | 122 | void put_io_context(struct io_context *ioc); |
| 106 | void exit_io_context(void); | 123 | void exit_io_context(void); |
| 107 | struct io_context *current_io_context(gfp_t gfp_flags); | 124 | struct io_context *get_io_context(gfp_t gfp_flags, int node); |
| 108 | struct io_context *get_io_context(gfp_t gfp_flags); | ||
| 109 | void copy_io_context(struct io_context **pdst, struct io_context **psrc); | 125 | void copy_io_context(struct io_context **pdst, struct io_context **psrc); |
| 110 | void swap_io_context(struct io_context **ioc1, struct io_context **ioc2); | 126 | void swap_io_context(struct io_context **ioc1, struct io_context **ioc2); |
| 111 | 127 | ||
| @@ -120,6 +136,90 @@ struct request_list { | |||
| 120 | wait_queue_head_t wait[2]; | 136 | wait_queue_head_t wait[2]; |
| 121 | }; | 137 | }; |
| 122 | 138 | ||
| 139 | /* | ||
| 140 | * request command types | ||
| 141 | */ | ||
| 142 | enum rq_cmd_type_bits { | ||
| 143 | REQ_TYPE_FS = 1, /* fs request */ | ||
| 144 | REQ_TYPE_BLOCK_PC, /* scsi command */ | ||
| 145 | REQ_TYPE_SENSE, /* sense request */ | ||
| 146 | REQ_TYPE_PM_SUSPEND, /* suspend request */ | ||
| 147 | REQ_TYPE_PM_RESUME, /* resume request */ | ||
| 148 | REQ_TYPE_PM_SHUTDOWN, /* shutdown request */ | ||
| 149 | REQ_TYPE_FLUSH, /* flush request */ | ||
| 150 | REQ_TYPE_SPECIAL, /* driver defined type */ | ||
| 151 | REQ_TYPE_LINUX_BLOCK, /* generic block layer message */ | ||
| 152 | /* | ||
| 153 | * for ATA/ATAPI devices. this really doesn't belong here, ide should | ||
| 154 | * use REQ_TYPE_SPECIAL and use rq->cmd[0] with the range of driver | ||
| 155 | * private REQ_LB opcodes to differentiate what type of request this is | ||
| 156 | */ | ||
| 157 | REQ_TYPE_ATA_CMD, | ||
| 158 | REQ_TYPE_ATA_TASK, | ||
| 159 | REQ_TYPE_ATA_TASKFILE, | ||
| 160 | }; | ||
| 161 | |||
| 162 | /* | ||
| 163 | * For request of type REQ_TYPE_LINUX_BLOCK, rq->cmd[0] is the opcode being | ||
| 164 | * sent down (similar to how REQ_TYPE_BLOCK_PC means that ->cmd[] holds a | ||
| 165 | * SCSI cdb. | ||
| 166 | * | ||
| 167 | * 0x00 -> 0x3f are driver private, to be used for whatever purpose they need, | ||
| 168 | * typically to differentiate REQ_TYPE_SPECIAL requests. | ||
| 169 | * | ||
| 170 | */ | ||
| 171 | enum { | ||
| 172 | /* | ||
| 173 | * just examples for now | ||
| 174 | */ | ||
| 175 | REQ_LB_OP_EJECT = 0x40, /* eject request */ | ||
| 176 | REQ_LB_OP_FLUSH = 0x41, /* flush device */ | ||
| 177 | }; | ||
| 178 | |||
| 179 | /* | ||
| 180 | * request type modified bits. first three bits match BIO_RW* bits, important | ||
| 181 | */ | ||
| 182 | enum rq_flag_bits { | ||
| 183 | __REQ_RW, /* not set, read. set, write */ | ||
| 184 | __REQ_FAILFAST, /* no low level driver retries */ | ||
| 185 | __REQ_SORTED, /* elevator knows about this request */ | ||
| 186 | __REQ_SOFTBARRIER, /* may not be passed by ioscheduler */ | ||
| 187 | __REQ_HARDBARRIER, /* may not be passed by drive either */ | ||
| 188 | __REQ_FUA, /* forced unit access */ | ||
| 189 | __REQ_NOMERGE, /* don't touch this for merging */ | ||
| 190 | __REQ_STARTED, /* drive already may have started this one */ | ||
| 191 | __REQ_DONTPREP, /* don't call prep for this one */ | ||
| 192 | __REQ_QUEUED, /* uses queueing */ | ||
| 193 | __REQ_ELVPRIV, /* elevator private data attached */ | ||
| 194 | __REQ_FAILED, /* set if the request failed */ | ||
| 195 | __REQ_QUIET, /* don't worry about errors */ | ||
| 196 | __REQ_PREEMPT, /* set for "ide_preempt" requests */ | ||
| 197 | __REQ_ORDERED_COLOR, /* is before or after barrier */ | ||
| 198 | __REQ_RW_SYNC, /* request is sync (O_DIRECT) */ | ||
| 199 | __REQ_ALLOCED, /* request came from our alloc pool */ | ||
| 200 | __REQ_RW_META, /* metadata io request */ | ||
| 201 | __REQ_NR_BITS, /* stops here */ | ||
| 202 | }; | ||
| 203 | |||
| 204 | #define REQ_RW (1 << __REQ_RW) | ||
| 205 | #define REQ_FAILFAST (1 << __REQ_FAILFAST) | ||
| 206 | #define REQ_SORTED (1 << __REQ_SORTED) | ||
| 207 | #define REQ_SOFTBARRIER (1 << __REQ_SOFTBARRIER) | ||
| 208 | #define REQ_HARDBARRIER (1 << __REQ_HARDBARRIER) | ||
| 209 | #define REQ_FUA (1 << __REQ_FUA) | ||
| 210 | #define REQ_NOMERGE (1 << __REQ_NOMERGE) | ||
| 211 | #define REQ_STARTED (1 << __REQ_STARTED) | ||
| 212 | #define REQ_DONTPREP (1 << __REQ_DONTPREP) | ||
| 213 | #define REQ_QUEUED (1 << __REQ_QUEUED) | ||
| 214 | #define REQ_ELVPRIV (1 << __REQ_ELVPRIV) | ||
| 215 | #define REQ_FAILED (1 << __REQ_FAILED) | ||
| 216 | #define REQ_QUIET (1 << __REQ_QUIET) | ||
| 217 | #define REQ_PREEMPT (1 << __REQ_PREEMPT) | ||
| 218 | #define REQ_ORDERED_COLOR (1 << __REQ_ORDERED_COLOR) | ||
| 219 | #define REQ_RW_SYNC (1 << __REQ_RW_SYNC) | ||
| 220 | #define REQ_ALLOCED (1 << __REQ_ALLOCED) | ||
| 221 | #define REQ_RW_META (1 << __REQ_RW_META) | ||
| 222 | |||
| 123 | #define BLK_MAX_CDB 16 | 223 | #define BLK_MAX_CDB 16 |
| 124 | 224 | ||
| 125 | /* | 225 | /* |
| @@ -129,30 +229,46 @@ struct request { | |||
| 129 | struct list_head queuelist; | 229 | struct list_head queuelist; |
| 130 | struct list_head donelist; | 230 | struct list_head donelist; |
| 131 | 231 | ||
| 132 | unsigned long flags; /* see REQ_ bits below */ | 232 | request_queue_t *q; |
| 233 | |||
| 234 | unsigned int cmd_flags; | ||
| 235 | enum rq_cmd_type_bits cmd_type; | ||
| 133 | 236 | ||
| 134 | /* Maintain bio traversal state for part by part I/O submission. | 237 | /* Maintain bio traversal state for part by part I/O submission. |
| 135 | * hard_* are block layer internals, no driver should touch them! | 238 | * hard_* are block layer internals, no driver should touch them! |
| 136 | */ | 239 | */ |
| 137 | 240 | ||
| 138 | sector_t sector; /* next sector to submit */ | 241 | sector_t sector; /* next sector to submit */ |
| 242 | sector_t hard_sector; /* next sector to complete */ | ||
| 139 | unsigned long nr_sectors; /* no. of sectors left to submit */ | 243 | unsigned long nr_sectors; /* no. of sectors left to submit */ |
| 244 | unsigned long hard_nr_sectors; /* no. of sectors left to complete */ | ||
| 140 | /* no. of sectors left to submit in the current segment */ | 245 | /* no. of sectors left to submit in the current segment */ |
| 141 | unsigned int current_nr_sectors; | 246 | unsigned int current_nr_sectors; |
| 142 | 247 | ||
| 143 | sector_t hard_sector; /* next sector to complete */ | ||
| 144 | unsigned long hard_nr_sectors; /* no. of sectors left to complete */ | ||
| 145 | /* no. of sectors left to complete in the current segment */ | 248 | /* no. of sectors left to complete in the current segment */ |
| 146 | unsigned int hard_cur_sectors; | 249 | unsigned int hard_cur_sectors; |
| 147 | 250 | ||
| 148 | struct bio *bio; | 251 | struct bio *bio; |
| 149 | struct bio *biotail; | 252 | struct bio *biotail; |
| 150 | 253 | ||
| 254 | struct hlist_node hash; /* merge hash */ | ||
| 255 | /* | ||
| 256 | * The rb_node is only used inside the io scheduler, requests | ||
| 257 | * are pruned when moved to the dispatch queue. So let the | ||
| 258 | * completion_data share space with the rb_node. | ||
| 259 | */ | ||
| 260 | union { | ||
| 261 | struct rb_node rb_node; /* sort/lookup */ | ||
| 262 | void *completion_data; | ||
| 263 | }; | ||
| 264 | |||
| 265 | /* | ||
| 266 | * two pointers are available for the IO schedulers, if they need | ||
| 267 | * more they have to dynamically allocate it. | ||
| 268 | */ | ||
| 151 | void *elevator_private; | 269 | void *elevator_private; |
| 152 | void *completion_data; | 270 | void *elevator_private2; |
| 153 | 271 | ||
| 154 | int rq_status; /* should split this into a few status bits */ | ||
| 155 | int errors; | ||
| 156 | struct gendisk *rq_disk; | 272 | struct gendisk *rq_disk; |
| 157 | unsigned long start_time; | 273 | unsigned long start_time; |
| 158 | 274 | ||
| @@ -170,15 +286,13 @@ struct request { | |||
| 170 | 286 | ||
| 171 | unsigned short ioprio; | 287 | unsigned short ioprio; |
| 172 | 288 | ||
| 289 | void *special; | ||
| 290 | char *buffer; | ||
| 291 | |||
| 173 | int tag; | 292 | int tag; |
| 293 | int errors; | ||
| 174 | 294 | ||
| 175 | int ref_count; | 295 | int ref_count; |
| 176 | request_queue_t *q; | ||
| 177 | struct request_list *rl; | ||
| 178 | |||
| 179 | struct completion *waiting; | ||
| 180 | void *special; | ||
| 181 | char *buffer; | ||
| 182 | 296 | ||
| 183 | /* | 297 | /* |
| 184 | * when request is used as a packet command carrier | 298 | * when request is used as a packet command carrier |
| @@ -195,80 +309,14 @@ struct request { | |||
| 195 | int retries; | 309 | int retries; |
| 196 | 310 | ||
| 197 | /* | 311 | /* |
| 198 | * completion callback. end_io_data should be folded in with waiting | 312 | * completion callback. |
| 199 | */ | 313 | */ |
| 200 | rq_end_io_fn *end_io; | 314 | rq_end_io_fn *end_io; |
| 201 | void *end_io_data; | 315 | void *end_io_data; |
| 202 | }; | 316 | }; |
| 203 | 317 | ||
| 204 | /* | 318 | /* |
| 205 | * first three bits match BIO_RW* bits, important | 319 | * State information carried for REQ_TYPE_PM_SUSPEND and REQ_TYPE_PM_RESUME |
| 206 | */ | ||
| 207 | enum rq_flag_bits { | ||
| 208 | __REQ_RW, /* not set, read. set, write */ | ||
| 209 | __REQ_FAILFAST, /* no low level driver retries */ | ||
| 210 | __REQ_SORTED, /* elevator knows about this request */ | ||
| 211 | __REQ_SOFTBARRIER, /* may not be passed by ioscheduler */ | ||
| 212 | __REQ_HARDBARRIER, /* may not be passed by drive either */ | ||
| 213 | __REQ_FUA, /* forced unit access */ | ||
| 214 | __REQ_CMD, /* is a regular fs rw request */ | ||
| 215 | __REQ_NOMERGE, /* don't touch this for merging */ | ||
| 216 | __REQ_STARTED, /* drive already may have started this one */ | ||
| 217 | __REQ_DONTPREP, /* don't call prep for this one */ | ||
| 218 | __REQ_QUEUED, /* uses queueing */ | ||
| 219 | __REQ_ELVPRIV, /* elevator private data attached */ | ||
| 220 | /* | ||
| 221 | * for ATA/ATAPI devices | ||
| 222 | */ | ||
| 223 | __REQ_PC, /* packet command (special) */ | ||
| 224 | __REQ_BLOCK_PC, /* queued down pc from block layer */ | ||
| 225 | __REQ_SENSE, /* sense retrival */ | ||
| 226 | |||
| 227 | __REQ_FAILED, /* set if the request failed */ | ||
| 228 | __REQ_QUIET, /* don't worry about errors */ | ||
| 229 | __REQ_SPECIAL, /* driver suplied command */ | ||
| 230 | __REQ_DRIVE_CMD, | ||
| 231 | __REQ_DRIVE_TASK, | ||
| 232 | __REQ_DRIVE_TASKFILE, | ||
| 233 | __REQ_PREEMPT, /* set for "ide_preempt" requests */ | ||
| 234 | __REQ_PM_SUSPEND, /* suspend request */ | ||
| 235 | __REQ_PM_RESUME, /* resume request */ | ||
| 236 | __REQ_PM_SHUTDOWN, /* shutdown request */ | ||
| 237 | __REQ_ORDERED_COLOR, /* is before or after barrier */ | ||
| 238 | __REQ_RW_SYNC, /* request is sync (O_DIRECT) */ | ||
| 239 | __REQ_NR_BITS, /* stops here */ | ||
| 240 | }; | ||
| 241 | |||
| 242 | #define REQ_RW (1 << __REQ_RW) | ||
| 243 | #define REQ_FAILFAST (1 << __REQ_FAILFAST) | ||
| 244 | #define REQ_SORTED (1 << __REQ_SORTED) | ||
| 245 | #define REQ_SOFTBARRIER (1 << __REQ_SOFTBARRIER) | ||
| 246 | #define REQ_HARDBARRIER (1 << __REQ_HARDBARRIER) | ||
| 247 | #define REQ_FUA (1 << __REQ_FUA) | ||
| 248 | #define REQ_CMD (1 << __REQ_CMD) | ||
| 249 | #define REQ_NOMERGE (1 << __REQ_NOMERGE) | ||
| 250 | #define REQ_STARTED (1 << __REQ_STARTED) | ||
| 251 | #define REQ_DONTPREP (1 << __REQ_DONTPREP) | ||
| 252 | #define REQ_QUEUED (1 << __REQ_QUEUED) | ||
| 253 | #define REQ_ELVPRIV (1 << __REQ_ELVPRIV) | ||
| 254 | #define REQ_PC (1 << __REQ_PC) | ||
| 255 | #define REQ_BLOCK_PC (1 << __REQ_BLOCK_PC) | ||
| 256 | #define REQ_SENSE (1 << __REQ_SENSE) | ||
| 257 | #define REQ_FAILED (1 << __REQ_FAILED) | ||
| 258 | #define REQ_QUIET (1 << __REQ_QUIET) | ||
| 259 | #define REQ_SPECIAL (1 << __REQ_SPECIAL) | ||
| 260 | #define REQ_DRIVE_CMD (1 << __REQ_DRIVE_CMD) | ||
| 261 | #define REQ_DRIVE_TASK (1 << __REQ_DRIVE_TASK) | ||
| 262 | #define REQ_DRIVE_TASKFILE (1 << __REQ_DRIVE_TASKFILE) | ||
| 263 | #define REQ_PREEMPT (1 << __REQ_PREEMPT) | ||
| 264 | #define REQ_PM_SUSPEND (1 << __REQ_PM_SUSPEND) | ||
| 265 | #define REQ_PM_RESUME (1 << __REQ_PM_RESUME) | ||
| 266 | #define REQ_PM_SHUTDOWN (1 << __REQ_PM_SHUTDOWN) | ||
| 267 | #define REQ_ORDERED_COLOR (1 << __REQ_ORDERED_COLOR) | ||
| 268 | #define REQ_RW_SYNC (1 << __REQ_RW_SYNC) | ||
| 269 | |||
| 270 | /* | ||
| 271 | * State information carried for REQ_PM_SUSPEND and REQ_PM_RESUME | ||
| 272 | * requests. Some step values could eventually be made generic. | 320 | * requests. Some step values could eventually be made generic. |
| 273 | */ | 321 | */ |
| 274 | struct request_pm_state | 322 | struct request_pm_state |
| @@ -417,9 +465,9 @@ struct request_queue | |||
| 417 | unsigned int sg_timeout; | 465 | unsigned int sg_timeout; |
| 418 | unsigned int sg_reserved_size; | 466 | unsigned int sg_reserved_size; |
| 419 | int node; | 467 | int node; |
| 420 | 468 | #ifdef CONFIG_BLK_DEV_IO_TRACE | |
| 421 | struct blk_trace *blk_trace; | 469 | struct blk_trace *blk_trace; |
| 422 | 470 | #endif | |
| 423 | /* | 471 | /* |
| 424 | * reserved for flush operations | 472 | * reserved for flush operations |
| 425 | */ | 473 | */ |
| @@ -432,9 +480,6 @@ struct request_queue | |||
| 432 | struct mutex sysfs_lock; | 480 | struct mutex sysfs_lock; |
| 433 | }; | 481 | }; |
| 434 | 482 | ||
| 435 | #define RQ_INACTIVE (-1) | ||
| 436 | #define RQ_ACTIVE 1 | ||
| 437 | |||
| 438 | #define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */ | 483 | #define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */ |
| 439 | #define QUEUE_FLAG_QUEUED 1 /* uses generic tag queueing */ | 484 | #define QUEUE_FLAG_QUEUED 1 /* uses generic tag queueing */ |
| 440 | #define QUEUE_FLAG_STOPPED 2 /* queue is stopped */ | 485 | #define QUEUE_FLAG_STOPPED 2 /* queue is stopped */ |
| @@ -490,25 +535,34 @@ enum { | |||
| 490 | #define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags) | 535 | #define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags) |
| 491 | #define blk_queue_flushing(q) ((q)->ordseq) | 536 | #define blk_queue_flushing(q) ((q)->ordseq) |
| 492 | 537 | ||
| 493 | #define blk_fs_request(rq) ((rq)->flags & REQ_CMD) | 538 | #define blk_fs_request(rq) ((rq)->cmd_type == REQ_TYPE_FS) |
| 494 | #define blk_pc_request(rq) ((rq)->flags & REQ_BLOCK_PC) | 539 | #define blk_pc_request(rq) ((rq)->cmd_type == REQ_TYPE_BLOCK_PC) |
| 495 | #define blk_noretry_request(rq) ((rq)->flags & REQ_FAILFAST) | 540 | #define blk_special_request(rq) ((rq)->cmd_type == REQ_TYPE_SPECIAL) |
| 496 | #define blk_rq_started(rq) ((rq)->flags & REQ_STARTED) | 541 | #define blk_sense_request(rq) ((rq)->cmd_type == REQ_TYPE_SENSE) |
| 542 | |||
| 543 | #define blk_noretry_request(rq) ((rq)->cmd_flags & REQ_FAILFAST) | ||
| 544 | #define blk_rq_started(rq) ((rq)->cmd_flags & REQ_STARTED) | ||
| 497 | 545 | ||
| 498 | #define blk_account_rq(rq) (blk_rq_started(rq) && blk_fs_request(rq)) | 546 | #define blk_account_rq(rq) (blk_rq_started(rq) && blk_fs_request(rq)) |
| 499 | 547 | ||
| 500 | #define blk_pm_suspend_request(rq) ((rq)->flags & REQ_PM_SUSPEND) | 548 | #define blk_pm_suspend_request(rq) ((rq)->cmd_type == REQ_TYPE_PM_SUSPEND) |
| 501 | #define blk_pm_resume_request(rq) ((rq)->flags & REQ_PM_RESUME) | 549 | #define blk_pm_resume_request(rq) ((rq)->cmd_type == REQ_TYPE_PM_RESUME) |
| 502 | #define blk_pm_request(rq) \ | 550 | #define blk_pm_request(rq) \ |
| 503 | ((rq)->flags & (REQ_PM_SUSPEND | REQ_PM_RESUME)) | 551 | (blk_pm_suspend_request(rq) || blk_pm_resume_request(rq)) |
| 504 | 552 | ||
| 505 | #define blk_sorted_rq(rq) ((rq)->flags & REQ_SORTED) | 553 | #define blk_sorted_rq(rq) ((rq)->cmd_flags & REQ_SORTED) |
| 506 | #define blk_barrier_rq(rq) ((rq)->flags & REQ_HARDBARRIER) | 554 | #define blk_barrier_rq(rq) ((rq)->cmd_flags & REQ_HARDBARRIER) |
| 507 | #define blk_fua_rq(rq) ((rq)->flags & REQ_FUA) | 555 | #define blk_fua_rq(rq) ((rq)->cmd_flags & REQ_FUA) |
| 508 | 556 | ||
| 509 | #define list_entry_rq(ptr) list_entry((ptr), struct request, queuelist) | 557 | #define list_entry_rq(ptr) list_entry((ptr), struct request, queuelist) |
| 510 | 558 | ||
| 511 | #define rq_data_dir(rq) ((rq)->flags & 1) | 559 | #define rq_data_dir(rq) ((rq)->cmd_flags & 1) |
| 560 | |||
| 561 | /* | ||
| 562 | * We regard a request as sync, if it's a READ or a SYNC write. | ||
| 563 | */ | ||
| 564 | #define rq_is_sync(rq) (rq_data_dir((rq)) == READ || (rq)->cmd_flags & REQ_RW_SYNC) | ||
| 565 | #define rq_is_meta(rq) ((rq)->cmd_flags & REQ_RW_META) | ||
| 512 | 566 | ||
| 513 | static inline int blk_queue_full(struct request_queue *q, int rw) | 567 | static inline int blk_queue_full(struct request_queue *q, int rw) |
| 514 | { | 568 | { |
| @@ -541,13 +595,7 @@ static inline void blk_clear_queue_full(struct request_queue *q, int rw) | |||
| 541 | #define RQ_NOMERGE_FLAGS \ | 595 | #define RQ_NOMERGE_FLAGS \ |
| 542 | (REQ_NOMERGE | REQ_STARTED | REQ_HARDBARRIER | REQ_SOFTBARRIER) | 596 | (REQ_NOMERGE | REQ_STARTED | REQ_HARDBARRIER | REQ_SOFTBARRIER) |
| 543 | #define rq_mergeable(rq) \ | 597 | #define rq_mergeable(rq) \ |
| 544 | (!((rq)->flags & RQ_NOMERGE_FLAGS) && blk_fs_request((rq))) | 598 | (!((rq)->cmd_flags & RQ_NOMERGE_FLAGS) && blk_fs_request((rq))) |
| 545 | |||
| 546 | /* | ||
| 547 | * noop, requests are automagically marked as active/inactive by I/O | ||
| 548 | * scheduler -- see elv_next_request | ||
| 549 | */ | ||
| 550 | #define blk_queue_headactive(q, head_active) | ||
| 551 | 599 | ||
| 552 | /* | 600 | /* |
| 553 | * q->prep_rq_fn return values | 601 | * q->prep_rq_fn return values |
| @@ -586,11 +634,6 @@ static inline void blk_queue_bounce(request_queue_t *q, struct bio **bio) | |||
| 586 | if ((rq->bio)) \ | 634 | if ((rq->bio)) \ |
| 587 | for (_bio = (rq)->bio; _bio; _bio = _bio->bi_next) | 635 | for (_bio = (rq)->bio; _bio; _bio = _bio->bi_next) |
| 588 | 636 | ||
| 589 | struct sec_size { | ||
| 590 | unsigned block_size; | ||
| 591 | unsigned block_size_bits; | ||
| 592 | }; | ||
| 593 | |||
| 594 | extern int blk_register_queue(struct gendisk *disk); | 637 | extern int blk_register_queue(struct gendisk *disk); |
| 595 | extern void blk_unregister_queue(struct gendisk *disk); | 638 | extern void blk_unregister_queue(struct gendisk *disk); |
| 596 | extern void register_disk(struct gendisk *dev); | 639 | extern void register_disk(struct gendisk *dev); |
| @@ -612,6 +655,7 @@ extern void blk_stop_queue(request_queue_t *q); | |||
| 612 | extern void blk_sync_queue(struct request_queue *q); | 655 | extern void blk_sync_queue(struct request_queue *q); |
| 613 | extern void __blk_stop_queue(request_queue_t *q); | 656 | extern void __blk_stop_queue(request_queue_t *q); |
| 614 | extern void blk_run_queue(request_queue_t *); | 657 | extern void blk_run_queue(request_queue_t *); |
| 658 | extern void blk_start_queueing(request_queue_t *); | ||
| 615 | extern void blk_queue_activity_fn(request_queue_t *, activity_fn *, void *); | 659 | extern void blk_queue_activity_fn(request_queue_t *, activity_fn *, void *); |
| 616 | extern int blk_rq_map_user(request_queue_t *, struct request *, void __user *, unsigned int); | 660 | extern int blk_rq_map_user(request_queue_t *, struct request *, void __user *, unsigned int); |
| 617 | extern int blk_rq_unmap_user(struct bio *, unsigned int); | 661 | extern int blk_rq_unmap_user(struct bio *, unsigned int); |
| @@ -655,16 +699,6 @@ extern void end_that_request_last(struct request *, int); | |||
| 655 | extern void end_request(struct request *req, int uptodate); | 699 | extern void end_request(struct request *req, int uptodate); |
| 656 | extern void blk_complete_request(struct request *); | 700 | extern void blk_complete_request(struct request *); |
| 657 | 701 | ||
| 658 | static inline int rq_all_done(struct request *rq, unsigned int nr_bytes) | ||
| 659 | { | ||
| 660 | if (blk_fs_request(rq)) | ||
| 661 | return (nr_bytes >= (rq->hard_nr_sectors << 9)); | ||
| 662 | else if (blk_pc_request(rq)) | ||
| 663 | return nr_bytes >= rq->data_len; | ||
| 664 | |||
| 665 | return 0; | ||
| 666 | } | ||
| 667 | |||
| 668 | /* | 702 | /* |
| 669 | * end_that_request_first/chunk() takes an uptodate argument. we account | 703 | * end_that_request_first/chunk() takes an uptodate argument. we account |
| 670 | * any value <= as an io error. 0 means -EIO for compatability reasons, | 704 | * any value <= as an io error. 0 means -EIO for compatability reasons, |
| @@ -679,21 +713,6 @@ static inline void blkdev_dequeue_request(struct request *req) | |||
| 679 | } | 713 | } |
| 680 | 714 | ||
| 681 | /* | 715 | /* |
| 682 | * This should be in elevator.h, but that requires pulling in rq and q | ||
| 683 | */ | ||
| 684 | static inline void elv_dispatch_add_tail(struct request_queue *q, | ||
| 685 | struct request *rq) | ||
| 686 | { | ||
| 687 | if (q->last_merge == rq) | ||
| 688 | q->last_merge = NULL; | ||
| 689 | q->nr_sorted--; | ||
| 690 | |||
| 691 | q->end_sector = rq_end_sector(rq); | ||
| 692 | q->boundary_rq = rq; | ||
| 693 | list_add_tail(&rq->queuelist, &q->queue_head); | ||
| 694 | } | ||
| 695 | |||
| 696 | /* | ||
| 697 | * Access functions for manipulating queue properties | 716 | * Access functions for manipulating queue properties |
| 698 | */ | 717 | */ |
| 699 | extern request_queue_t *blk_init_queue_node(request_fn_proc *rfn, | 718 | extern request_queue_t *blk_init_queue_node(request_fn_proc *rfn, |
| @@ -737,7 +756,7 @@ extern void blk_put_queue(request_queue_t *); | |||
| 737 | */ | 756 | */ |
| 738 | #define blk_queue_tag_depth(q) ((q)->queue_tags->busy) | 757 | #define blk_queue_tag_depth(q) ((q)->queue_tags->busy) |
| 739 | #define blk_queue_tag_queue(q) ((q)->queue_tags->busy < (q)->queue_tags->max_depth) | 758 | #define blk_queue_tag_queue(q) ((q)->queue_tags->busy < (q)->queue_tags->max_depth) |
| 740 | #define blk_rq_tagged(rq) ((rq)->flags & REQ_QUEUED) | 759 | #define blk_rq_tagged(rq) ((rq)->cmd_flags & REQ_QUEUED) |
| 741 | extern int blk_queue_start_tag(request_queue_t *, struct request *); | 760 | extern int blk_queue_start_tag(request_queue_t *, struct request *); |
| 742 | extern struct request *blk_queue_find_tag(request_queue_t *, int); | 761 | extern struct request *blk_queue_find_tag(request_queue_t *, int); |
| 743 | extern void blk_queue_end_tag(request_queue_t *, struct request *); | 762 | extern void blk_queue_end_tag(request_queue_t *, struct request *); |
| @@ -746,6 +765,9 @@ extern void blk_queue_free_tags(request_queue_t *); | |||
| 746 | extern int blk_queue_resize_tags(request_queue_t *, int); | 765 | extern int blk_queue_resize_tags(request_queue_t *, int); |
| 747 | extern void blk_queue_invalidate_tags(request_queue_t *); | 766 | extern void blk_queue_invalidate_tags(request_queue_t *); |
| 748 | extern long blk_congestion_wait(int rw, long timeout); | 767 | extern long blk_congestion_wait(int rw, long timeout); |
| 768 | extern struct blk_queue_tag *blk_init_tags(int); | ||
| 769 | extern void blk_free_tags(struct blk_queue_tag *); | ||
| 770 | extern void blk_congestion_end(int rw); | ||
| 749 | 771 | ||
| 750 | extern void blk_rq_bio_prep(request_queue_t *, struct request *, struct bio *); | 772 | extern void blk_rq_bio_prep(request_queue_t *, struct request *, struct bio *); |
| 751 | extern int blkdev_issue_flush(struct block_device *, sector_t *); | 773 | extern int blkdev_issue_flush(struct block_device *, sector_t *); |
| @@ -784,14 +806,6 @@ static inline int queue_dma_alignment(request_queue_t *q) | |||
| 784 | return retval; | 806 | return retval; |
| 785 | } | 807 | } |
| 786 | 808 | ||
| 787 | static inline int bdev_dma_aligment(struct block_device *bdev) | ||
| 788 | { | ||
| 789 | return queue_dma_alignment(bdev_get_queue(bdev)); | ||
| 790 | } | ||
| 791 | |||
| 792 | #define blk_finished_io(nsects) do { } while (0) | ||
| 793 | #define blk_started_io(nsects) do { } while (0) | ||
| 794 | |||
| 795 | /* assumes size > 256 */ | 809 | /* assumes size > 256 */ |
| 796 | static inline unsigned int blksize_bits(unsigned int size) | 810 | static inline unsigned int blksize_bits(unsigned int size) |
| 797 | { | 811 | { |
| @@ -821,24 +835,32 @@ struct work_struct; | |||
| 821 | int kblockd_schedule_work(struct work_struct *work); | 835 | int kblockd_schedule_work(struct work_struct *work); |
| 822 | void kblockd_flush(void); | 836 | void kblockd_flush(void); |
| 823 | 837 | ||
| 824 | #ifdef CONFIG_LBD | ||
| 825 | # include <asm/div64.h> | ||
| 826 | # define sector_div(a, b) do_div(a, b) | ||
| 827 | #else | ||
| 828 | # define sector_div(n, b)( \ | ||
| 829 | { \ | ||
| 830 | int _res; \ | ||
| 831 | _res = (n) % (b); \ | ||
| 832 | (n) /= (b); \ | ||
| 833 | _res; \ | ||
| 834 | } \ | ||
| 835 | ) | ||
| 836 | #endif | ||
| 837 | |||
| 838 | #define MODULE_ALIAS_BLOCKDEV(major,minor) \ | 838 | #define MODULE_ALIAS_BLOCKDEV(major,minor) \ |
| 839 | MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor)) | 839 | MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor)) |
| 840 | #define MODULE_ALIAS_BLOCKDEV_MAJOR(major) \ | 840 | #define MODULE_ALIAS_BLOCKDEV_MAJOR(major) \ |
| 841 | MODULE_ALIAS("block-major-" __stringify(major) "-*") | 841 | MODULE_ALIAS("block-major-" __stringify(major) "-*") |
| 842 | 842 | ||
| 843 | 843 | ||
| 844 | #else /* CONFIG_BLOCK */ | ||
| 845 | /* | ||
| 846 | * stubs for when the block layer is configured out | ||
| 847 | */ | ||
| 848 | #define buffer_heads_over_limit 0 | ||
| 849 | |||
| 850 | static inline long blk_congestion_wait(int rw, long timeout) | ||
| 851 | { | ||
| 852 | return io_schedule_timeout(timeout); | ||
| 853 | } | ||
| 854 | |||
| 855 | static inline long nr_blockdev_pages(void) | ||
| 856 | { | ||
| 857 | return 0; | ||
| 858 | } | ||
| 859 | |||
| 860 | static inline void exit_io_context(void) | ||
| 861 | { | ||
| 862 | } | ||
| 863 | |||
| 864 | #endif /* CONFIG_BLOCK */ | ||
| 865 | |||
| 844 | #endif | 866 | #endif |
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h index 7520cc1ff9..b99a714fca 100644 --- a/include/linux/blktrace_api.h +++ b/include/linux/blktrace_api.h | |||
| @@ -20,6 +20,7 @@ enum blktrace_cat { | |||
| 20 | BLK_TC_PC = 1 << 9, /* pc requests */ | 20 | BLK_TC_PC = 1 << 9, /* pc requests */ |
| 21 | BLK_TC_NOTIFY = 1 << 10, /* special message */ | 21 | BLK_TC_NOTIFY = 1 << 10, /* special message */ |
| 22 | BLK_TC_AHEAD = 1 << 11, /* readahead */ | 22 | BLK_TC_AHEAD = 1 << 11, /* readahead */ |
| 23 | BLK_TC_META = 1 << 12, /* metadata */ | ||
| 23 | 24 | ||
| 24 | BLK_TC_END = 1 << 15, /* only 16-bits, reminder */ | 25 | BLK_TC_END = 1 << 15, /* only 16-bits, reminder */ |
| 25 | }; | 26 | }; |
| @@ -148,7 +149,7 @@ static inline void blk_add_trace_rq(struct request_queue *q, struct request *rq, | |||
| 148 | u32 what) | 149 | u32 what) |
| 149 | { | 150 | { |
| 150 | struct blk_trace *bt = q->blk_trace; | 151 | struct blk_trace *bt = q->blk_trace; |
| 151 | int rw = rq->flags & 0x03; | 152 | int rw = rq->cmd_flags & 0x03; |
| 152 | 153 | ||
| 153 | if (likely(!bt)) | 154 | if (likely(!bt)) |
| 154 | return; | 155 | return; |
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index 1021f508d8..31e9abb6d9 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h | |||
| @@ -4,11 +4,8 @@ | |||
| 4 | #ifndef _LINUX_BOOTMEM_H | 4 | #ifndef _LINUX_BOOTMEM_H |
| 5 | #define _LINUX_BOOTMEM_H | 5 | #define _LINUX_BOOTMEM_H |
| 6 | 6 | ||
| 7 | #include <asm/pgtable.h> | ||
| 8 | #include <asm/dma.h> | ||
| 9 | #include <linux/cache.h> | ||
| 10 | #include <linux/init.h> | ||
| 11 | #include <linux/mmzone.h> | 7 | #include <linux/mmzone.h> |
| 8 | #include <asm/dma.h> | ||
| 12 | 9 | ||
| 13 | /* | 10 | /* |
| 14 | * simple boot-time physical memory area allocator. | 11 | * simple boot-time physical memory area allocator. |
| @@ -41,45 +38,64 @@ typedef struct bootmem_data { | |||
| 41 | struct list_head list; | 38 | struct list_head list; |
| 42 | } bootmem_data_t; | 39 | } bootmem_data_t; |
| 43 | 40 | ||
| 44 | extern unsigned long __init bootmem_bootmap_pages (unsigned long); | 41 | extern unsigned long bootmem_bootmap_pages(unsigned long); |
| 45 | extern unsigned long __init init_bootmem (unsigned long addr, unsigned long memend); | 42 | extern unsigned long init_bootmem(unsigned long addr, unsigned long memend); |
| 46 | extern void __init free_bootmem (unsigned long addr, unsigned long size); | 43 | extern void free_bootmem(unsigned long addr, unsigned long size); |
| 47 | extern void * __init __alloc_bootmem (unsigned long size, unsigned long align, unsigned long goal); | 44 | extern void *__alloc_bootmem(unsigned long size, |
| 48 | extern void * __init __alloc_bootmem_nopanic (unsigned long size, unsigned long align, unsigned long goal); | 45 | unsigned long align, |
| 49 | extern void * __init __alloc_bootmem_low(unsigned long size, | 46 | unsigned long goal); |
| 50 | unsigned long align, | 47 | extern void *__alloc_bootmem_nopanic(unsigned long size, |
| 51 | unsigned long goal); | 48 | unsigned long align, |
| 52 | extern void * __init __alloc_bootmem_low_node(pg_data_t *pgdat, | 49 | unsigned long goal); |
| 53 | unsigned long size, | 50 | extern void *__alloc_bootmem_low(unsigned long size, |
| 54 | unsigned long align, | 51 | unsigned long align, |
| 55 | unsigned long goal); | 52 | unsigned long goal); |
| 56 | extern void * __init __alloc_bootmem_core(struct bootmem_data *bdata, | 53 | extern void *__alloc_bootmem_low_node(pg_data_t *pgdat, |
| 57 | unsigned long size, unsigned long align, unsigned long goal, | 54 | unsigned long size, |
| 58 | unsigned long limit); | 55 | unsigned long align, |
| 56 | unsigned long goal); | ||
| 57 | extern void *__alloc_bootmem_core(struct bootmem_data *bdata, | ||
| 58 | unsigned long size, | ||
| 59 | unsigned long align, | ||
| 60 | unsigned long goal, | ||
| 61 | unsigned long limit); | ||
| 62 | |||
| 59 | #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE | 63 | #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE |
| 60 | extern void __init reserve_bootmem (unsigned long addr, unsigned long size); | 64 | extern void reserve_bootmem(unsigned long addr, unsigned long size); |
| 61 | #define alloc_bootmem(x) \ | 65 | #define alloc_bootmem(x) \ |
| 62 | __alloc_bootmem((x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) | 66 | __alloc_bootmem(x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) |
| 63 | #define alloc_bootmem_low(x) \ | 67 | #define alloc_bootmem_low(x) \ |
| 64 | __alloc_bootmem_low((x), SMP_CACHE_BYTES, 0) | 68 | __alloc_bootmem_low(x, SMP_CACHE_BYTES, 0) |
| 65 | #define alloc_bootmem_pages(x) \ | 69 | #define alloc_bootmem_pages(x) \ |
| 66 | __alloc_bootmem((x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) | 70 | __alloc_bootmem(x, PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) |
| 67 | #define alloc_bootmem_low_pages(x) \ | 71 | #define alloc_bootmem_low_pages(x) \ |
| 68 | __alloc_bootmem_low((x), PAGE_SIZE, 0) | 72 | __alloc_bootmem_low(x, PAGE_SIZE, 0) |
| 69 | #endif /* !CONFIG_HAVE_ARCH_BOOTMEM_NODE */ | 73 | #endif /* !CONFIG_HAVE_ARCH_BOOTMEM_NODE */ |
| 70 | extern unsigned long __init free_all_bootmem (void); | 74 | |
| 71 | extern void * __init __alloc_bootmem_node (pg_data_t *pgdat, unsigned long size, unsigned long align, unsigned long goal); | 75 | extern unsigned long free_all_bootmem(void); |
| 72 | extern unsigned long __init init_bootmem_node (pg_data_t *pgdat, unsigned long freepfn, unsigned long startpfn, unsigned long endpfn); | 76 | extern unsigned long free_all_bootmem_node(pg_data_t *pgdat); |
| 73 | extern void __init reserve_bootmem_node (pg_data_t *pgdat, unsigned long physaddr, unsigned long size); | 77 | extern void *__alloc_bootmem_node(pg_data_t *pgdat, |
| 74 | extern void __init free_bootmem_node (pg_data_t *pgdat, unsigned long addr, unsigned long size); | 78 | unsigned long size, |
| 75 | extern unsigned long __init free_all_bootmem_node (pg_data_t *pgdat); | 79 | unsigned long align, |
| 80 | unsigned long goal); | ||
| 81 | extern unsigned long init_bootmem_node(pg_data_t *pgdat, | ||
| 82 | unsigned long freepfn, | ||
| 83 | unsigned long startpfn, | ||
| 84 | unsigned long endpfn); | ||
| 85 | extern void reserve_bootmem_node(pg_data_t *pgdat, | ||
| 86 | unsigned long physaddr, | ||
| 87 | unsigned long size); | ||
| 88 | extern void free_bootmem_node(pg_data_t *pgdat, | ||
| 89 | unsigned long addr, | ||
| 90 | unsigned long size); | ||
| 91 | |||
| 76 | #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE | 92 | #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE |
| 77 | #define alloc_bootmem_node(pgdat, x) \ | 93 | #define alloc_bootmem_node(pgdat, x) \ |
| 78 | __alloc_bootmem_node((pgdat), (x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) | 94 | __alloc_bootmem_node(pgdat, x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) |
| 79 | #define alloc_bootmem_pages_node(pgdat, x) \ | 95 | #define alloc_bootmem_pages_node(pgdat, x) \ |
| 80 | __alloc_bootmem_node((pgdat), (x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) | 96 | __alloc_bootmem_node(pgdat, x, PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) |
| 81 | #define alloc_bootmem_low_pages_node(pgdat, x) \ | 97 | #define alloc_bootmem_low_pages_node(pgdat, x) \ |
| 82 | __alloc_bootmem_low_node((pgdat), (x), PAGE_SIZE, 0) | 98 | __alloc_bootmem_low_node(pgdat, x, PAGE_SIZE, 0) |
| 83 | #endif /* !CONFIG_HAVE_ARCH_BOOTMEM_NODE */ | 99 | #endif /* !CONFIG_HAVE_ARCH_BOOTMEM_NODE */ |
| 84 | 100 | ||
| 85 | #ifdef CONFIG_HAVE_ARCH_ALLOC_REMAP | 101 | #ifdef CONFIG_HAVE_ARCH_ALLOC_REMAP |
| @@ -89,19 +105,19 @@ static inline void *alloc_remap(int nid, unsigned long size) | |||
| 89 | { | 105 | { |
| 90 | return NULL; | 106 | return NULL; |
| 91 | } | 107 | } |
| 92 | #endif | 108 | #endif /* CONFIG_HAVE_ARCH_ALLOC_REMAP */ |
| 93 | 109 | ||
| 94 | extern unsigned long __meminitdata nr_kernel_pages; | 110 | extern unsigned long __meminitdata nr_kernel_pages; |
| 95 | extern unsigned long nr_all_pages; | 111 | extern unsigned long nr_all_pages; |
| 96 | 112 | ||
| 97 | extern void *__init alloc_large_system_hash(const char *tablename, | 113 | extern void *alloc_large_system_hash(const char *tablename, |
| 98 | unsigned long bucketsize, | 114 | unsigned long bucketsize, |
| 99 | unsigned long numentries, | 115 | unsigned long numentries, |
| 100 | int scale, | 116 | int scale, |
| 101 | int flags, | 117 | int flags, |
| 102 | unsigned int *_hash_shift, | 118 | unsigned int *_hash_shift, |
| 103 | unsigned int *_hash_mask, | 119 | unsigned int *_hash_mask, |
| 104 | unsigned long limit); | 120 | unsigned long limit); |
| 105 | 121 | ||
| 106 | #define HASH_HIGHMEM 0x00000001 /* Consider highmem? */ | 122 | #define HASH_HIGHMEM 0x00000001 /* Consider highmem? */ |
| 107 | #define HASH_EARLY 0x00000002 /* Allocating during early boot? */ | 123 | #define HASH_EARLY 0x00000002 /* Allocating during early boot? */ |
| @@ -114,7 +130,7 @@ extern void *__init alloc_large_system_hash(const char *tablename, | |||
| 114 | #else | 130 | #else |
| 115 | #define HASHDIST_DEFAULT 0 | 131 | #define HASHDIST_DEFAULT 0 |
| 116 | #endif | 132 | #endif |
| 117 | extern int __initdata hashdist; /* Distribute hashes across NUMA nodes? */ | 133 | extern int hashdist; /* Distribute hashes across NUMA nodes? */ |
| 118 | 134 | ||
| 119 | 135 | ||
| 120 | #endif /* _LINUX_BOOTMEM_H */ | 136 | #endif /* _LINUX_BOOTMEM_H */ |
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 737e407d0c..131ffd37e7 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h | |||
| @@ -14,6 +14,8 @@ | |||
| 14 | #include <linux/wait.h> | 14 | #include <linux/wait.h> |
| 15 | #include <asm/atomic.h> | 15 | #include <asm/atomic.h> |
| 16 | 16 | ||
| 17 | #ifdef CONFIG_BLOCK | ||
| 18 | |||
| 17 | enum bh_state_bits { | 19 | enum bh_state_bits { |
| 18 | BH_Uptodate, /* Contains valid data */ | 20 | BH_Uptodate, /* Contains valid data */ |
| 19 | BH_Dirty, /* Is dirty */ | 21 | BH_Dirty, /* Is dirty */ |
| @@ -190,9 +192,7 @@ extern int buffer_heads_over_limit; | |||
| 190 | * Generic address_space_operations implementations for buffer_head-backed | 192 | * Generic address_space_operations implementations for buffer_head-backed |
| 191 | * address_spaces. | 193 | * address_spaces. |
| 192 | */ | 194 | */ |
| 193 | int try_to_release_page(struct page * page, gfp_t gfp_mask); | ||
| 194 | void block_invalidatepage(struct page *page, unsigned long offset); | 195 | void block_invalidatepage(struct page *page, unsigned long offset); |
| 195 | void do_invalidatepage(struct page *page, unsigned long offset); | ||
| 196 | int block_write_full_page(struct page *page, get_block_t *get_block, | 196 | int block_write_full_page(struct page *page, get_block_t *get_block, |
| 197 | struct writeback_control *wbc); | 197 | struct writeback_control *wbc); |
| 198 | int block_read_full_page(struct page*, get_block_t*); | 198 | int block_read_full_page(struct page*, get_block_t*); |
| @@ -302,4 +302,19 @@ static inline void lock_buffer(struct buffer_head *bh) | |||
| 302 | __lock_buffer(bh); | 302 | __lock_buffer(bh); |
| 303 | } | 303 | } |
| 304 | 304 | ||
| 305 | extern int __set_page_dirty_buffers(struct page *page); | ||
| 306 | |||
| 307 | #else /* CONFIG_BLOCK */ | ||
| 308 | |||
| 309 | static inline void buffer_init(void) {} | ||
| 310 | static inline int try_to_free_buffers(struct page *page) { return 1; } | ||
| 311 | static inline int sync_blockdev(struct block_device *bdev) { return 0; } | ||
| 312 | static inline int inode_has_buffers(struct inode *inode) { return 0; } | ||
| 313 | static inline void invalidate_inode_buffers(struct inode *inode) {} | ||
| 314 | static inline int remove_inode_buffers(struct inode *inode) { return 1; } | ||
| 315 | static inline int sync_mapping_buffers(struct address_space *mapping) { return 0; } | ||
| 316 | static inline void invalidate_bdev(struct block_device *bdev, int destroy_dirty_buffers) {} | ||
| 317 | |||
| 318 | |||
| 319 | #endif /* CONFIG_BLOCK */ | ||
| 305 | #endif /* _LINUX_BUFFER_HEAD_H */ | 320 | #endif /* _LINUX_BUFFER_HEAD_H */ |
diff --git a/include/linux/byteorder/Kbuild b/include/linux/byteorder/Kbuild index 84a57d4fb2..56499ab9e3 100644 --- a/include/linux/byteorder/Kbuild +++ b/include/linux/byteorder/Kbuild | |||
| @@ -1,2 +1,7 @@ | |||
| 1 | unifdef-y += generic.h swabb.h swab.h | 1 | header-y += big_endian.h |
| 2 | header-y += big_endian.h little_endian.h pdp_endian.h | 2 | header-y += little_endian.h |
| 3 | header-y += pdp_endian.h | ||
| 4 | |||
| 5 | unifdef-y += generic.h | ||
| 6 | unifdef-y += swabb.h | ||
| 7 | unifdef-y += swab.h | ||
diff --git a/include/linux/cdev.h b/include/linux/cdev.h index 2216638962..ee5f53f2ca 100644 --- a/include/linux/cdev.h +++ b/include/linux/cdev.h | |||
| @@ -23,5 +23,7 @@ void cdev_del(struct cdev *); | |||
| 23 | 23 | ||
| 24 | void cd_forget(struct inode *); | 24 | void cd_forget(struct inode *); |
| 25 | 25 | ||
| 26 | extern struct backing_dev_info directly_mappable_cdev_bdi; | ||
| 27 | |||
| 26 | #endif | 28 | #endif |
| 27 | #endif | 29 | #endif |
diff --git a/include/linux/coda_psdev.h b/include/linux/coda_psdev.h index 98f6c52c15..b541bb3d1f 100644 --- a/include/linux/coda_psdev.h +++ b/include/linux/coda_psdev.h | |||
| @@ -1,11 +1,11 @@ | |||
| 1 | #ifndef __CODA_PSDEV_H | 1 | #ifndef __CODA_PSDEV_H |
| 2 | #define __CODA_PSDEV_H | 2 | #define __CODA_PSDEV_H |
| 3 | 3 | ||
| 4 | #include <linux/magic.h> | ||
| 5 | |||
| 4 | #define CODA_PSDEV_MAJOR 67 | 6 | #define CODA_PSDEV_MAJOR 67 |
| 5 | #define MAX_CODADEVS 5 /* how many do we allow */ | 7 | #define MAX_CODADEVS 5 /* how many do we allow */ |
| 6 | 8 | ||
| 7 | #define CODA_SUPER_MAGIC 0x73757245 | ||
| 8 | |||
| 9 | struct kstatfs; | 9 | struct kstatfs; |
| 10 | 10 | ||
| 11 | struct coda_sb_info | 11 | struct coda_sb_info |
diff --git a/include/linux/compat_ioctl.h b/include/linux/compat_ioctl.h index bea0255196..d5b7abc4f4 100644 --- a/include/linux/compat_ioctl.h +++ b/include/linux/compat_ioctl.h | |||
| @@ -90,6 +90,7 @@ COMPATIBLE_IOCTL(FDTWADDLE) | |||
| 90 | COMPATIBLE_IOCTL(FDFMTTRK) | 90 | COMPATIBLE_IOCTL(FDFMTTRK) |
| 91 | COMPATIBLE_IOCTL(FDRAWCMD) | 91 | COMPATIBLE_IOCTL(FDRAWCMD) |
| 92 | /* 0x12 */ | 92 | /* 0x12 */ |
| 93 | #ifdef CONFIG_BLOCK | ||
| 93 | COMPATIBLE_IOCTL(BLKRASET) | 94 | COMPATIBLE_IOCTL(BLKRASET) |
| 94 | COMPATIBLE_IOCTL(BLKROSET) | 95 | COMPATIBLE_IOCTL(BLKROSET) |
| 95 | COMPATIBLE_IOCTL(BLKROGET) | 96 | COMPATIBLE_IOCTL(BLKROGET) |
| @@ -103,6 +104,7 @@ COMPATIBLE_IOCTL(BLKTRACESETUP) | |||
| 103 | COMPATIBLE_IOCTL(BLKTRACETEARDOWN) | 104 | COMPATIBLE_IOCTL(BLKTRACETEARDOWN) |
| 104 | ULONG_IOCTL(BLKRASET) | 105 | ULONG_IOCTL(BLKRASET) |
| 105 | ULONG_IOCTL(BLKFRASET) | 106 | ULONG_IOCTL(BLKFRASET) |
| 107 | #endif | ||
| 106 | /* RAID */ | 108 | /* RAID */ |
| 107 | COMPATIBLE_IOCTL(RAID_VERSION) | 109 | COMPATIBLE_IOCTL(RAID_VERSION) |
| 108 | COMPATIBLE_IOCTL(GET_ARRAY_INFO) | 110 | COMPATIBLE_IOCTL(GET_ARRAY_INFO) |
| @@ -395,12 +397,6 @@ COMPATIBLE_IOCTL(DVD_WRITE_STRUCT) | |||
| 395 | COMPATIBLE_IOCTL(DVD_AUTH) | 397 | COMPATIBLE_IOCTL(DVD_AUTH) |
| 396 | /* pktcdvd */ | 398 | /* pktcdvd */ |
| 397 | COMPATIBLE_IOCTL(PACKET_CTRL_CMD) | 399 | COMPATIBLE_IOCTL(PACKET_CTRL_CMD) |
| 398 | /* Big L */ | ||
| 399 | ULONG_IOCTL(LOOP_SET_FD) | ||
| 400 | ULONG_IOCTL(LOOP_CHANGE_FD) | ||
| 401 | COMPATIBLE_IOCTL(LOOP_CLR_FD) | ||
| 402 | COMPATIBLE_IOCTL(LOOP_GET_STATUS64) | ||
| 403 | COMPATIBLE_IOCTL(LOOP_SET_STATUS64) | ||
| 404 | /* Big A */ | 400 | /* Big A */ |
| 405 | /* sparc only */ | 401 | /* sparc only */ |
| 406 | /* Big Q for sound/OSS */ | 402 | /* Big Q for sound/OSS */ |
| @@ -573,18 +569,6 @@ COMPATIBLE_IOCTL(RAW_SETBIND) | |||
| 573 | COMPATIBLE_IOCTL(RAW_GETBIND) | 569 | COMPATIBLE_IOCTL(RAW_GETBIND) |
| 574 | /* SMB ioctls which do not need any translations */ | 570 | /* SMB ioctls which do not need any translations */ |
| 575 | COMPATIBLE_IOCTL(SMB_IOC_NEWCONN) | 571 | COMPATIBLE_IOCTL(SMB_IOC_NEWCONN) |
| 576 | /* NCP ioctls which do not need any translations */ | ||
| 577 | COMPATIBLE_IOCTL(NCP_IOC_CONN_LOGGED_IN) | ||
| 578 | COMPATIBLE_IOCTL(NCP_IOC_SIGN_INIT) | ||
| 579 | COMPATIBLE_IOCTL(NCP_IOC_SIGN_WANTED) | ||
| 580 | COMPATIBLE_IOCTL(NCP_IOC_SET_SIGN_WANTED) | ||
| 581 | COMPATIBLE_IOCTL(NCP_IOC_LOCKUNLOCK) | ||
| 582 | COMPATIBLE_IOCTL(NCP_IOC_GETROOT) | ||
| 583 | COMPATIBLE_IOCTL(NCP_IOC_SETROOT) | ||
| 584 | COMPATIBLE_IOCTL(NCP_IOC_GETCHARSETS) | ||
| 585 | COMPATIBLE_IOCTL(NCP_IOC_SETCHARSETS) | ||
| 586 | COMPATIBLE_IOCTL(NCP_IOC_GETDENTRYTTL) | ||
| 587 | COMPATIBLE_IOCTL(NCP_IOC_SETDENTRYTTL) | ||
| 588 | /* Little a */ | 572 | /* Little a */ |
| 589 | COMPATIBLE_IOCTL(ATMSIGD_CTRL) | 573 | COMPATIBLE_IOCTL(ATMSIGD_CTRL) |
| 590 | COMPATIBLE_IOCTL(ATMARPD_CTRL) | 574 | COMPATIBLE_IOCTL(ATMARPD_CTRL) |
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 9b4f110949..538423d4a8 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
| @@ -10,11 +10,11 @@ | |||
| 10 | # define __force __attribute__((force)) | 10 | # define __force __attribute__((force)) |
| 11 | # define __nocast __attribute__((nocast)) | 11 | # define __nocast __attribute__((nocast)) |
| 12 | # define __iomem __attribute__((noderef, address_space(2))) | 12 | # define __iomem __attribute__((noderef, address_space(2))) |
| 13 | # define __acquires(x) __attribute__((context(0,1))) | 13 | # define __acquires(x) __attribute__((context(x,0,1))) |
| 14 | # define __releases(x) __attribute__((context(1,0))) | 14 | # define __releases(x) __attribute__((context(x,1,0))) |
| 15 | # define __acquire(x) __context__(1) | 15 | # define __acquire(x) __context__(x,1) |
| 16 | # define __release(x) __context__(-1) | 16 | # define __release(x) __context__(x,-1) |
| 17 | # define __cond_lock(x) ((x) ? ({ __context__(1); 1; }) : 0) | 17 | # define __cond_lock(x,c) ((c) ? ({ __acquire(x); 1; }) : 0) |
| 18 | extern void __chk_user_ptr(void __user *); | 18 | extern void __chk_user_ptr(void __user *); |
| 19 | extern void __chk_io_ptr(void __iomem *); | 19 | extern void __chk_io_ptr(void __iomem *); |
| 20 | #else | 20 | #else |
| @@ -31,7 +31,7 @@ extern void __chk_io_ptr(void __iomem *); | |||
| 31 | # define __releases(x) | 31 | # define __releases(x) |
| 32 | # define __acquire(x) (void)0 | 32 | # define __acquire(x) (void)0 |
| 33 | # define __release(x) (void)0 | 33 | # define __release(x) (void)0 |
| 34 | # define __cond_lock(x) (x) | 34 | # define __cond_lock(x,c) (c) |
| 35 | #endif | 35 | #endif |
| 36 | 36 | ||
| 37 | #ifdef __KERNEL__ | 37 | #ifdef __KERNEL__ |
| @@ -99,6 +99,11 @@ extern void __chk_io_ptr(void __iomem *); | |||
| 99 | #define __must_check | 99 | #define __must_check |
| 100 | #endif | 100 | #endif |
| 101 | 101 | ||
| 102 | #ifndef CONFIG_ENABLE_MUST_CHECK | ||
| 103 | #undef __must_check | ||
| 104 | #define __must_check | ||
| 105 | #endif | ||
| 106 | |||
| 102 | /* | 107 | /* |
| 103 | * Allow us to avoid 'defined but not used' warnings on functions and data, | 108 | * Allow us to avoid 'defined but not used' warnings on functions and data, |
| 104 | * as well as force them to be emitted to the assembly file. | 109 | * as well as force them to be emitted to the assembly file. |
diff --git a/include/linux/console.h b/include/linux/console.h index 3bdf2155e5..76a1807726 100644 --- a/include/linux/console.h +++ b/include/linux/console.h | |||
| @@ -120,9 +120,14 @@ extern void console_stop(struct console *); | |||
| 120 | extern void console_start(struct console *); | 120 | extern void console_start(struct console *); |
| 121 | extern int is_console_locked(void); | 121 | extern int is_console_locked(void); |
| 122 | 122 | ||
| 123 | #ifndef CONFIG_DISABLE_CONSOLE_SUSPEND | ||
| 123 | /* Suspend and resume console messages over PM events */ | 124 | /* Suspend and resume console messages over PM events */ |
| 124 | extern void suspend_console(void); | 125 | extern void suspend_console(void); |
| 125 | extern void resume_console(void); | 126 | extern void resume_console(void); |
| 127 | #else | ||
| 128 | static inline void suspend_console(void) {} | ||
| 129 | static inline void resume_console(void) {} | ||
| 130 | #endif /* CONFIG_DISABLE_CONSOLE_SUSPEND */ | ||
| 126 | 131 | ||
| 127 | /* Some debug stub to catch some of the obvious races in the VT code */ | 132 | /* Some debug stub to catch some of the obvious races in the VT code */ |
| 128 | #if 1 | 133 | #if 1 |
diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 8fb344a9ab..3fef7d67ae 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h | |||
| @@ -89,4 +89,12 @@ int cpu_down(unsigned int cpu); | |||
| 89 | static inline int cpu_is_offline(int cpu) { return 0; } | 89 | static inline int cpu_is_offline(int cpu) { return 0; } |
| 90 | #endif | 90 | #endif |
| 91 | 91 | ||
| 92 | #ifdef CONFIG_SUSPEND_SMP | ||
| 93 | extern int disable_nonboot_cpus(void); | ||
| 94 | extern void enable_nonboot_cpus(void); | ||
| 95 | #else | ||
| 96 | static inline int disable_nonboot_cpus(void) { return 0; } | ||
| 97 | static inline void enable_nonboot_cpus(void) {} | ||
| 98 | #endif | ||
| 99 | |||
| 92 | #endif /* _LINUX_CPU_H_ */ | 100 | #endif /* _LINUX_CPU_H_ */ |
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h index 9354722a92..4d8adf6636 100644 --- a/include/linux/cpuset.h +++ b/include/linux/cpuset.h | |||
| @@ -63,6 +63,8 @@ static inline int cpuset_do_slab_mem_spread(void) | |||
| 63 | return current->flags & PF_SPREAD_SLAB; | 63 | return current->flags & PF_SPREAD_SLAB; |
| 64 | } | 64 | } |
| 65 | 65 | ||
| 66 | extern void cpuset_track_online_nodes(void); | ||
| 67 | |||
| 66 | #else /* !CONFIG_CPUSETS */ | 68 | #else /* !CONFIG_CPUSETS */ |
| 67 | 69 | ||
| 68 | static inline int cpuset_init_early(void) { return 0; } | 70 | static inline int cpuset_init_early(void) { return 0; } |
| @@ -126,6 +128,8 @@ static inline int cpuset_do_slab_mem_spread(void) | |||
| 126 | return 0; | 128 | return 0; |
| 127 | } | 129 | } |
| 128 | 130 | ||
| 131 | static inline void cpuset_track_online_nodes(void) {} | ||
| 132 | |||
| 129 | #endif /* !CONFIG_CPUSETS */ | 133 | #endif /* !CONFIG_CPUSETS */ |
| 130 | 134 | ||
| 131 | #endif /* _LINUX_CPUSET_H */ | 135 | #endif /* _LINUX_CPUSET_H */ |
diff --git a/include/linux/cramfs_fs.h b/include/linux/cramfs_fs.h index a41f38428c..1dba681e42 100644 --- a/include/linux/cramfs_fs.h +++ b/include/linux/cramfs_fs.h | |||
| @@ -87,6 +87,6 @@ struct cramfs_super { | |||
| 87 | /* Uncompression interfaces to the underlying zlib */ | 87 | /* Uncompression interfaces to the underlying zlib */ |
| 88 | int cramfs_uncompress_block(void *dst, int dstlen, void *src, int srclen); | 88 | int cramfs_uncompress_block(void *dst, int dstlen, void *src, int srclen); |
| 89 | int cramfs_uncompress_init(void); | 89 | int cramfs_uncompress_init(void); |
| 90 | int cramfs_uncompress_exit(void); | 90 | void cramfs_uncompress_exit(void); |
| 91 | 91 | ||
| 92 | #endif | 92 | #endif |
diff --git a/include/linux/crypto.h b/include/linux/crypto.h index 7f946241b8..8f2ffa4caa 100644 --- a/include/linux/crypto.h +++ b/include/linux/crypto.h | |||
| @@ -17,20 +17,36 @@ | |||
| 17 | #ifndef _LINUX_CRYPTO_H | 17 | #ifndef _LINUX_CRYPTO_H |
| 18 | #define _LINUX_CRYPTO_H | 18 | #define _LINUX_CRYPTO_H |
| 19 | 19 | ||
| 20 | #include <asm/atomic.h> | ||
| 20 | #include <linux/module.h> | 21 | #include <linux/module.h> |
| 21 | #include <linux/kernel.h> | 22 | #include <linux/kernel.h> |
| 22 | #include <linux/types.h> | ||
| 23 | #include <linux/list.h> | 23 | #include <linux/list.h> |
| 24 | #include <linux/slab.h> | ||
| 24 | #include <linux/string.h> | 25 | #include <linux/string.h> |
| 25 | #include <asm/page.h> | 26 | #include <linux/uaccess.h> |
| 26 | 27 | ||
| 27 | /* | 28 | /* |
| 28 | * Algorithm masks and types. | 29 | * Algorithm masks and types. |
| 29 | */ | 30 | */ |
| 30 | #define CRYPTO_ALG_TYPE_MASK 0x000000ff | 31 | #define CRYPTO_ALG_TYPE_MASK 0x0000000f |
| 31 | #define CRYPTO_ALG_TYPE_CIPHER 0x00000001 | 32 | #define CRYPTO_ALG_TYPE_CIPHER 0x00000001 |
| 32 | #define CRYPTO_ALG_TYPE_DIGEST 0x00000002 | 33 | #define CRYPTO_ALG_TYPE_DIGEST 0x00000002 |
| 33 | #define CRYPTO_ALG_TYPE_COMPRESS 0x00000004 | 34 | #define CRYPTO_ALG_TYPE_HASH 0x00000003 |
| 35 | #define CRYPTO_ALG_TYPE_BLKCIPHER 0x00000004 | ||
| 36 | #define CRYPTO_ALG_TYPE_COMPRESS 0x00000005 | ||
| 37 | |||
| 38 | #define CRYPTO_ALG_TYPE_HASH_MASK 0x0000000e | ||
| 39 | |||
| 40 | #define CRYPTO_ALG_LARVAL 0x00000010 | ||
| 41 | #define CRYPTO_ALG_DEAD 0x00000020 | ||
| 42 | #define CRYPTO_ALG_DYING 0x00000040 | ||
| 43 | #define CRYPTO_ALG_ASYNC 0x00000080 | ||
| 44 | |||
| 45 | /* | ||
| 46 | * Set this bit if and only if the algorithm requires another algorithm of | ||
| 47 | * the same type to handle corner cases. | ||
| 48 | */ | ||
| 49 | #define CRYPTO_ALG_NEED_FALLBACK 0x00000100 | ||
| 34 | 50 | ||
| 35 | /* | 51 | /* |
| 36 | * Transform masks and values (for crt_flags). | 52 | * Transform masks and values (for crt_flags). |
| @@ -61,8 +77,37 @@ | |||
| 61 | #define CRYPTO_DIR_ENCRYPT 1 | 77 | #define CRYPTO_DIR_ENCRYPT 1 |
| 62 | #define CRYPTO_DIR_DECRYPT 0 | 78 | #define CRYPTO_DIR_DECRYPT 0 |
| 63 | 79 | ||
| 80 | /* | ||
| 81 | * The macro CRYPTO_MINALIGN_ATTR (along with the void * type in the actual | ||
| 82 | * declaration) is used to ensure that the crypto_tfm context structure is | ||
| 83 | * aligned correctly for the given architecture so that there are no alignment | ||
| 84 | * faults for C data types. In particular, this is required on platforms such | ||
| 85 | * as arm where pointers are 32-bit aligned but there are data types such as | ||
| 86 | * u64 which require 64-bit alignment. | ||
| 87 | */ | ||
| 88 | #if defined(ARCH_KMALLOC_MINALIGN) | ||
| 89 | #define CRYPTO_MINALIGN ARCH_KMALLOC_MINALIGN | ||
| 90 | #elif defined(ARCH_SLAB_MINALIGN) | ||
| 91 | #define CRYPTO_MINALIGN ARCH_SLAB_MINALIGN | ||
| 92 | #endif | ||
| 93 | |||
| 94 | #ifdef CRYPTO_MINALIGN | ||
| 95 | #define CRYPTO_MINALIGN_ATTR __attribute__ ((__aligned__(CRYPTO_MINALIGN))) | ||
| 96 | #else | ||
| 97 | #define CRYPTO_MINALIGN_ATTR | ||
| 98 | #endif | ||
| 99 | |||
| 64 | struct scatterlist; | 100 | struct scatterlist; |
| 101 | struct crypto_blkcipher; | ||
| 102 | struct crypto_hash; | ||
| 65 | struct crypto_tfm; | 103 | struct crypto_tfm; |
| 104 | struct crypto_type; | ||
| 105 | |||
| 106 | struct blkcipher_desc { | ||
| 107 | struct crypto_blkcipher *tfm; | ||
| 108 | void *info; | ||
| 109 | u32 flags; | ||
| 110 | }; | ||
| 66 | 111 | ||
| 67 | struct cipher_desc { | 112 | struct cipher_desc { |
| 68 | struct crypto_tfm *tfm; | 113 | struct crypto_tfm *tfm; |
| @@ -72,30 +117,50 @@ struct cipher_desc { | |||
| 72 | void *info; | 117 | void *info; |
| 73 | }; | 118 | }; |
| 74 | 119 | ||
| 120 | struct hash_desc { | ||
| 121 | struct crypto_hash *tfm; | ||
| 122 | u32 flags; | ||
| 123 | }; | ||
| 124 | |||
| 75 | /* | 125 | /* |
| 76 | * Algorithms: modular crypto algorithm implementations, managed | 126 | * Algorithms: modular crypto algorithm implementations, managed |
| 77 | * via crypto_register_alg() and crypto_unregister_alg(). | 127 | * via crypto_register_alg() and crypto_unregister_alg(). |
| 78 | */ | 128 | */ |
| 129 | struct blkcipher_alg { | ||
| 130 | int (*setkey)(struct crypto_tfm *tfm, const u8 *key, | ||
| 131 | unsigned int keylen); | ||
| 132 | int (*encrypt)(struct blkcipher_desc *desc, | ||
| 133 | struct scatterlist *dst, struct scatterlist *src, | ||
| 134 | unsigned int nbytes); | ||
| 135 | int (*decrypt)(struct blkcipher_desc *desc, | ||
| 136 | struct scatterlist *dst, struct scatterlist *src, | ||
| 137 | unsigned int nbytes); | ||
| 138 | |||
| 139 | unsigned int min_keysize; | ||
| 140 | unsigned int max_keysize; | ||
| 141 | unsigned int ivsize; | ||
| 142 | }; | ||
| 143 | |||
| 79 | struct cipher_alg { | 144 | struct cipher_alg { |
| 80 | unsigned int cia_min_keysize; | 145 | unsigned int cia_min_keysize; |
| 81 | unsigned int cia_max_keysize; | 146 | unsigned int cia_max_keysize; |
| 82 | int (*cia_setkey)(struct crypto_tfm *tfm, const u8 *key, | 147 | int (*cia_setkey)(struct crypto_tfm *tfm, const u8 *key, |
| 83 | unsigned int keylen, u32 *flags); | 148 | unsigned int keylen); |
| 84 | void (*cia_encrypt)(struct crypto_tfm *tfm, u8 *dst, const u8 *src); | 149 | void (*cia_encrypt)(struct crypto_tfm *tfm, u8 *dst, const u8 *src); |
| 85 | void (*cia_decrypt)(struct crypto_tfm *tfm, u8 *dst, const u8 *src); | 150 | void (*cia_decrypt)(struct crypto_tfm *tfm, u8 *dst, const u8 *src); |
| 86 | 151 | ||
| 87 | unsigned int (*cia_encrypt_ecb)(const struct cipher_desc *desc, | 152 | unsigned int (*cia_encrypt_ecb)(const struct cipher_desc *desc, |
| 88 | u8 *dst, const u8 *src, | 153 | u8 *dst, const u8 *src, |
| 89 | unsigned int nbytes); | 154 | unsigned int nbytes) __deprecated; |
| 90 | unsigned int (*cia_decrypt_ecb)(const struct cipher_desc *desc, | 155 | unsigned int (*cia_decrypt_ecb)(const struct cipher_desc *desc, |
| 91 | u8 *dst, const u8 *src, | 156 | u8 *dst, const u8 *src, |
| 92 | unsigned int nbytes); | 157 | unsigned int nbytes) __deprecated; |
| 93 | unsigned int (*cia_encrypt_cbc)(const struct cipher_desc *desc, | 158 | unsigned int (*cia_encrypt_cbc)(const struct cipher_desc *desc, |
| 94 | u8 *dst, const u8 *src, | 159 | u8 *dst, const u8 *src, |
| 95 | unsigned int nbytes); | 160 | unsigned int nbytes) __deprecated; |
| 96 | unsigned int (*cia_decrypt_cbc)(const struct cipher_desc *desc, | 161 | unsigned int (*cia_decrypt_cbc)(const struct cipher_desc *desc, |
| 97 | u8 *dst, const u8 *src, | 162 | u8 *dst, const u8 *src, |
| 98 | unsigned int nbytes); | 163 | unsigned int nbytes) __deprecated; |
| 99 | }; | 164 | }; |
| 100 | 165 | ||
| 101 | struct digest_alg { | 166 | struct digest_alg { |
| @@ -105,7 +170,20 @@ struct digest_alg { | |||
| 105 | unsigned int len); | 170 | unsigned int len); |
| 106 | void (*dia_final)(struct crypto_tfm *tfm, u8 *out); | 171 | void (*dia_final)(struct crypto_tfm *tfm, u8 *out); |
| 107 | int (*dia_setkey)(struct crypto_tfm *tfm, const u8 *key, | 172 | int (*dia_setkey)(struct crypto_tfm *tfm, const u8 *key, |
| 108 | unsigned int keylen, u32 *flags); | 173 | unsigned int keylen); |
| 174 | }; | ||
| 175 | |||
| 176 | struct hash_alg { | ||
| 177 | int (*init)(struct hash_desc *desc); | ||
| 178 | int (*update)(struct hash_desc *desc, struct scatterlist *sg, | ||
| 179 | unsigned int nbytes); | ||
| 180 | int (*final)(struct hash_desc *desc, u8 *out); | ||
| 181 | int (*digest)(struct hash_desc *desc, struct scatterlist *sg, | ||
| 182 | unsigned int nbytes, u8 *out); | ||
| 183 | int (*setkey)(struct crypto_hash *tfm, const u8 *key, | ||
| 184 | unsigned int keylen); | ||
| 185 | |||
| 186 | unsigned int digestsize; | ||
| 109 | }; | 187 | }; |
| 110 | 188 | ||
| 111 | struct compress_alg { | 189 | struct compress_alg { |
| @@ -115,30 +193,40 @@ struct compress_alg { | |||
| 115 | unsigned int slen, u8 *dst, unsigned int *dlen); | 193 | unsigned int slen, u8 *dst, unsigned int *dlen); |
| 116 | }; | 194 | }; |
| 117 | 195 | ||
| 196 | #define cra_blkcipher cra_u.blkcipher | ||
| 118 | #define cra_cipher cra_u.cipher | 197 | #define cra_cipher cra_u.cipher |
| 119 | #define cra_digest cra_u.digest | 198 | #define cra_digest cra_u.digest |
| 199 | #define cra_hash cra_u.hash | ||
| 120 | #define cra_compress cra_u.compress | 200 | #define cra_compress cra_u.compress |
| 121 | 201 | ||
| 122 | struct crypto_alg { | 202 | struct crypto_alg { |
| 123 | struct list_head cra_list; | 203 | struct list_head cra_list; |
| 204 | struct list_head cra_users; | ||
| 205 | |||
| 124 | u32 cra_flags; | 206 | u32 cra_flags; |
| 125 | unsigned int cra_blocksize; | 207 | unsigned int cra_blocksize; |
| 126 | unsigned int cra_ctxsize; | 208 | unsigned int cra_ctxsize; |
| 127 | unsigned int cra_alignmask; | 209 | unsigned int cra_alignmask; |
| 128 | 210 | ||
| 129 | int cra_priority; | 211 | int cra_priority; |
| 212 | atomic_t cra_refcnt; | ||
| 130 | 213 | ||
| 131 | char cra_name[CRYPTO_MAX_ALG_NAME]; | 214 | char cra_name[CRYPTO_MAX_ALG_NAME]; |
| 132 | char cra_driver_name[CRYPTO_MAX_ALG_NAME]; | 215 | char cra_driver_name[CRYPTO_MAX_ALG_NAME]; |
| 133 | 216 | ||
| 217 | const struct crypto_type *cra_type; | ||
| 218 | |||
| 134 | union { | 219 | union { |
| 220 | struct blkcipher_alg blkcipher; | ||
| 135 | struct cipher_alg cipher; | 221 | struct cipher_alg cipher; |
| 136 | struct digest_alg digest; | 222 | struct digest_alg digest; |
| 223 | struct hash_alg hash; | ||
| 137 | struct compress_alg compress; | 224 | struct compress_alg compress; |
| 138 | } cra_u; | 225 | } cra_u; |
| 139 | 226 | ||
| 140 | int (*cra_init)(struct crypto_tfm *tfm); | 227 | int (*cra_init)(struct crypto_tfm *tfm); |
| 141 | void (*cra_exit)(struct crypto_tfm *tfm); | 228 | void (*cra_exit)(struct crypto_tfm *tfm); |
| 229 | void (*cra_destroy)(struct crypto_alg *alg); | ||
| 142 | 230 | ||
| 143 | struct module *cra_module; | 231 | struct module *cra_module; |
| 144 | }; | 232 | }; |
| @@ -153,20 +241,39 @@ int crypto_unregister_alg(struct crypto_alg *alg); | |||
| 153 | * Algorithm query interface. | 241 | * Algorithm query interface. |
| 154 | */ | 242 | */ |
| 155 | #ifdef CONFIG_CRYPTO | 243 | #ifdef CONFIG_CRYPTO |
| 156 | int crypto_alg_available(const char *name, u32 flags); | 244 | int crypto_alg_available(const char *name, u32 flags) |
| 245 | __deprecated_for_modules; | ||
| 246 | int crypto_has_alg(const char *name, u32 type, u32 mask); | ||
| 157 | #else | 247 | #else |
| 248 | static int crypto_alg_available(const char *name, u32 flags); | ||
| 249 | __deprecated_for_modules; | ||
| 158 | static inline int crypto_alg_available(const char *name, u32 flags) | 250 | static inline int crypto_alg_available(const char *name, u32 flags) |
| 159 | { | 251 | { |
| 160 | return 0; | 252 | return 0; |
| 161 | } | 253 | } |
| 254 | |||
| 255 | static inline int crypto_has_alg(const char *name, u32 type, u32 mask) | ||
| 256 | { | ||
| 257 | return 0; | ||
| 258 | } | ||
| 162 | #endif | 259 | #endif |
| 163 | 260 | ||
| 164 | /* | 261 | /* |
| 165 | * Transforms: user-instantiated objects which encapsulate algorithms | 262 | * Transforms: user-instantiated objects which encapsulate algorithms |
| 166 | * and core processing logic. Managed via crypto_alloc_tfm() and | 263 | * and core processing logic. Managed via crypto_alloc_*() and |
| 167 | * crypto_free_tfm(), as well as the various helpers below. | 264 | * crypto_free_*(), as well as the various helpers below. |
| 168 | */ | 265 | */ |
| 169 | 266 | ||
| 267 | struct blkcipher_tfm { | ||
| 268 | void *iv; | ||
| 269 | int (*setkey)(struct crypto_tfm *tfm, const u8 *key, | ||
| 270 | unsigned int keylen); | ||
| 271 | int (*encrypt)(struct blkcipher_desc *desc, struct scatterlist *dst, | ||
| 272 | struct scatterlist *src, unsigned int nbytes); | ||
| 273 | int (*decrypt)(struct blkcipher_desc *desc, struct scatterlist *dst, | ||
| 274 | struct scatterlist *src, unsigned int nbytes); | ||
| 275 | }; | ||
| 276 | |||
| 170 | struct cipher_tfm { | 277 | struct cipher_tfm { |
| 171 | void *cit_iv; | 278 | void *cit_iv; |
| 172 | unsigned int cit_ivsize; | 279 | unsigned int cit_ivsize; |
| @@ -190,20 +297,20 @@ struct cipher_tfm { | |||
| 190 | struct scatterlist *src, | 297 | struct scatterlist *src, |
| 191 | unsigned int nbytes, u8 *iv); | 298 | unsigned int nbytes, u8 *iv); |
| 192 | void (*cit_xor_block)(u8 *dst, const u8 *src); | 299 | void (*cit_xor_block)(u8 *dst, const u8 *src); |
| 300 | void (*cit_encrypt_one)(struct crypto_tfm *tfm, u8 *dst, const u8 *src); | ||
| 301 | void (*cit_decrypt_one)(struct crypto_tfm *tfm, u8 *dst, const u8 *src); | ||
| 193 | }; | 302 | }; |
| 194 | 303 | ||
| 195 | struct digest_tfm { | 304 | struct hash_tfm { |
| 196 | void (*dit_init)(struct crypto_tfm *tfm); | 305 | int (*init)(struct hash_desc *desc); |
| 197 | void (*dit_update)(struct crypto_tfm *tfm, | 306 | int (*update)(struct hash_desc *desc, |
| 198 | struct scatterlist *sg, unsigned int nsg); | 307 | struct scatterlist *sg, unsigned int nsg); |
| 199 | void (*dit_final)(struct crypto_tfm *tfm, u8 *out); | 308 | int (*final)(struct hash_desc *desc, u8 *out); |
| 200 | void (*dit_digest)(struct crypto_tfm *tfm, struct scatterlist *sg, | 309 | int (*digest)(struct hash_desc *desc, struct scatterlist *sg, |
| 201 | unsigned int nsg, u8 *out); | 310 | unsigned int nsg, u8 *out); |
| 202 | int (*dit_setkey)(struct crypto_tfm *tfm, | 311 | int (*setkey)(struct crypto_hash *tfm, const u8 *key, |
| 203 | const u8 *key, unsigned int keylen); | 312 | unsigned int keylen); |
| 204 | #ifdef CONFIG_CRYPTO_HMAC | 313 | unsigned int digestsize; |
| 205 | void *dit_hmac_block; | ||
| 206 | #endif | ||
| 207 | }; | 314 | }; |
| 208 | 315 | ||
| 209 | struct compress_tfm { | 316 | struct compress_tfm { |
| @@ -215,8 +322,9 @@ struct compress_tfm { | |||
| 215 | u8 *dst, unsigned int *dlen); | 322 | u8 *dst, unsigned int *dlen); |
| 216 | }; | 323 | }; |
| 217 | 324 | ||
| 325 | #define crt_blkcipher crt_u.blkcipher | ||
| 218 | #define crt_cipher crt_u.cipher | 326 | #define crt_cipher crt_u.cipher |
| 219 | #define crt_digest crt_u.digest | 327 | #define crt_hash crt_u.hash |
| 220 | #define crt_compress crt_u.compress | 328 | #define crt_compress crt_u.compress |
| 221 | 329 | ||
| 222 | struct crypto_tfm { | 330 | struct crypto_tfm { |
| @@ -224,30 +332,43 @@ struct crypto_tfm { | |||
| 224 | u32 crt_flags; | 332 | u32 crt_flags; |
| 225 | 333 | ||
| 226 | union { | 334 | union { |
| 335 | struct blkcipher_tfm blkcipher; | ||
| 227 | struct cipher_tfm cipher; | 336 | struct cipher_tfm cipher; |
| 228 | struct digest_tfm digest; | 337 | struct hash_tfm hash; |
| 229 | struct compress_tfm compress; | 338 | struct compress_tfm compress; |
| 230 | } crt_u; | 339 | } crt_u; |
| 231 | 340 | ||
| 232 | struct crypto_alg *__crt_alg; | 341 | struct crypto_alg *__crt_alg; |
| 233 | 342 | ||
| 234 | char __crt_ctx[] __attribute__ ((__aligned__)); | 343 | void *__crt_ctx[] CRYPTO_MINALIGN_ATTR; |
| 344 | }; | ||
| 345 | |||
| 346 | #define crypto_cipher crypto_tfm | ||
| 347 | #define crypto_comp crypto_tfm | ||
| 348 | |||
| 349 | struct crypto_blkcipher { | ||
| 350 | struct crypto_tfm base; | ||
| 351 | }; | ||
| 352 | |||
| 353 | struct crypto_hash { | ||
| 354 | struct crypto_tfm base; | ||
| 355 | }; | ||
| 356 | |||
| 357 | enum { | ||
| 358 | CRYPTOA_UNSPEC, | ||
| 359 | CRYPTOA_ALG, | ||
| 360 | }; | ||
| 361 | |||
| 362 | struct crypto_attr_alg { | ||
| 363 | char name[CRYPTO_MAX_ALG_NAME]; | ||
| 235 | }; | 364 | }; |
| 236 | 365 | ||
| 237 | /* | 366 | /* |
| 238 | * Transform user interface. | 367 | * Transform user interface. |
| 239 | */ | 368 | */ |
| 240 | 369 | ||
| 241 | /* | ||
| 242 | * crypto_alloc_tfm() will first attempt to locate an already loaded algorithm. | ||
| 243 | * If that fails and the kernel supports dynamically loadable modules, it | ||
| 244 | * will then attempt to load a module of the same name or alias. A refcount | ||
| 245 | * is grabbed on the algorithm which is then associated with the new transform. | ||
| 246 | * | ||
| 247 | * crypto_free_tfm() frees up the transform and any associated resources, | ||
| 248 | * then drops the refcount on the associated algorithm. | ||
| 249 | */ | ||
| 250 | struct crypto_tfm *crypto_alloc_tfm(const char *alg_name, u32 tfm_flags); | 370 | struct crypto_tfm *crypto_alloc_tfm(const char *alg_name, u32 tfm_flags); |
| 371 | struct crypto_tfm *crypto_alloc_base(const char *alg_name, u32 type, u32 mask); | ||
| 251 | void crypto_free_tfm(struct crypto_tfm *tfm); | 372 | void crypto_free_tfm(struct crypto_tfm *tfm); |
| 252 | 373 | ||
| 253 | /* | 374 | /* |
| @@ -258,6 +379,16 @@ static inline const char *crypto_tfm_alg_name(struct crypto_tfm *tfm) | |||
| 258 | return tfm->__crt_alg->cra_name; | 379 | return tfm->__crt_alg->cra_name; |
| 259 | } | 380 | } |
| 260 | 381 | ||
| 382 | static inline const char *crypto_tfm_alg_driver_name(struct crypto_tfm *tfm) | ||
| 383 | { | ||
| 384 | return tfm->__crt_alg->cra_driver_name; | ||
| 385 | } | ||
| 386 | |||
| 387 | static inline int crypto_tfm_alg_priority(struct crypto_tfm *tfm) | ||
| 388 | { | ||
| 389 | return tfm->__crt_alg->cra_priority; | ||
| 390 | } | ||
| 391 | |||
| 261 | static inline const char *crypto_tfm_alg_modname(struct crypto_tfm *tfm) | 392 | static inline const char *crypto_tfm_alg_modname(struct crypto_tfm *tfm) |
| 262 | { | 393 | { |
| 263 | return module_name(tfm->__crt_alg->cra_module); | 394 | return module_name(tfm->__crt_alg->cra_module); |
| @@ -268,18 +399,23 @@ static inline u32 crypto_tfm_alg_type(struct crypto_tfm *tfm) | |||
| 268 | return tfm->__crt_alg->cra_flags & CRYPTO_ALG_TYPE_MASK; | 399 | return tfm->__crt_alg->cra_flags & CRYPTO_ALG_TYPE_MASK; |
| 269 | } | 400 | } |
| 270 | 401 | ||
| 402 | static unsigned int crypto_tfm_alg_min_keysize(struct crypto_tfm *tfm) | ||
| 403 | __deprecated; | ||
| 271 | static inline unsigned int crypto_tfm_alg_min_keysize(struct crypto_tfm *tfm) | 404 | static inline unsigned int crypto_tfm_alg_min_keysize(struct crypto_tfm *tfm) |
| 272 | { | 405 | { |
| 273 | BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); | 406 | BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); |
| 274 | return tfm->__crt_alg->cra_cipher.cia_min_keysize; | 407 | return tfm->__crt_alg->cra_cipher.cia_min_keysize; |
| 275 | } | 408 | } |
| 276 | 409 | ||
| 410 | static unsigned int crypto_tfm_alg_max_keysize(struct crypto_tfm *tfm) | ||
| 411 | __deprecated; | ||
| 277 | static inline unsigned int crypto_tfm_alg_max_keysize(struct crypto_tfm *tfm) | 412 | static inline unsigned int crypto_tfm_alg_max_keysize(struct crypto_tfm *tfm) |
| 278 | { | 413 | { |
| 279 | BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); | 414 | BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); |
| 280 | return tfm->__crt_alg->cra_cipher.cia_max_keysize; | 415 | return tfm->__crt_alg->cra_cipher.cia_max_keysize; |
| 281 | } | 416 | } |
| 282 | 417 | ||
| 418 | static unsigned int crypto_tfm_alg_ivsize(struct crypto_tfm *tfm) __deprecated; | ||
| 283 | static inline unsigned int crypto_tfm_alg_ivsize(struct crypto_tfm *tfm) | 419 | static inline unsigned int crypto_tfm_alg_ivsize(struct crypto_tfm *tfm) |
| 284 | { | 420 | { |
| 285 | BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); | 421 | BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); |
| @@ -302,6 +438,21 @@ static inline unsigned int crypto_tfm_alg_alignmask(struct crypto_tfm *tfm) | |||
| 302 | return tfm->__crt_alg->cra_alignmask; | 438 | return tfm->__crt_alg->cra_alignmask; |
| 303 | } | 439 | } |
| 304 | 440 | ||
| 441 | static inline u32 crypto_tfm_get_flags(struct crypto_tfm *tfm) | ||
| 442 | { | ||
| 443 | return tfm->crt_flags; | ||
| 444 | } | ||
| 445 | |||
| 446 | static inline void crypto_tfm_set_flags(struct crypto_tfm *tfm, u32 flags) | ||
| 447 | { | ||
| 448 | tfm->crt_flags |= flags; | ||
| 449 | } | ||
| 450 | |||
| 451 | static inline void crypto_tfm_clear_flags(struct crypto_tfm *tfm, u32 flags) | ||
| 452 | { | ||
| 453 | tfm->crt_flags &= ~flags; | ||
| 454 | } | ||
| 455 | |||
| 305 | static inline void *crypto_tfm_ctx(struct crypto_tfm *tfm) | 456 | static inline void *crypto_tfm_ctx(struct crypto_tfm *tfm) |
| 306 | { | 457 | { |
| 307 | return tfm->__crt_ctx; | 458 | return tfm->__crt_ctx; |
| @@ -316,50 +467,374 @@ static inline unsigned int crypto_tfm_ctx_alignment(void) | |||
| 316 | /* | 467 | /* |
| 317 | * API wrappers. | 468 | * API wrappers. |
| 318 | */ | 469 | */ |
| 319 | static inline void crypto_digest_init(struct crypto_tfm *tfm) | 470 | static inline struct crypto_blkcipher *__crypto_blkcipher_cast( |
| 471 | struct crypto_tfm *tfm) | ||
| 320 | { | 472 | { |
| 321 | BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_DIGEST); | 473 | return (struct crypto_blkcipher *)tfm; |
| 322 | tfm->crt_digest.dit_init(tfm); | ||
| 323 | } | 474 | } |
| 324 | 475 | ||
| 325 | static inline void crypto_digest_update(struct crypto_tfm *tfm, | 476 | static inline struct crypto_blkcipher *crypto_blkcipher_cast( |
| 326 | struct scatterlist *sg, | 477 | struct crypto_tfm *tfm) |
| 327 | unsigned int nsg) | ||
| 328 | { | 478 | { |
| 329 | BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_DIGEST); | 479 | BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_BLKCIPHER); |
| 330 | tfm->crt_digest.dit_update(tfm, sg, nsg); | 480 | return __crypto_blkcipher_cast(tfm); |
| 331 | } | 481 | } |
| 332 | 482 | ||
| 333 | static inline void crypto_digest_final(struct crypto_tfm *tfm, u8 *out) | 483 | static inline struct crypto_blkcipher *crypto_alloc_blkcipher( |
| 484 | const char *alg_name, u32 type, u32 mask) | ||
| 334 | { | 485 | { |
| 335 | BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_DIGEST); | 486 | type &= ~CRYPTO_ALG_TYPE_MASK; |
| 336 | tfm->crt_digest.dit_final(tfm, out); | 487 | type |= CRYPTO_ALG_TYPE_BLKCIPHER; |
| 488 | mask |= CRYPTO_ALG_TYPE_MASK; | ||
| 489 | |||
| 490 | return __crypto_blkcipher_cast(crypto_alloc_base(alg_name, type, mask)); | ||
| 337 | } | 491 | } |
| 338 | 492 | ||
| 339 | static inline void crypto_digest_digest(struct crypto_tfm *tfm, | 493 | static inline struct crypto_tfm *crypto_blkcipher_tfm( |
| 340 | struct scatterlist *sg, | 494 | struct crypto_blkcipher *tfm) |
| 341 | unsigned int nsg, u8 *out) | ||
| 342 | { | 495 | { |
| 343 | BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_DIGEST); | 496 | return &tfm->base; |
| 344 | tfm->crt_digest.dit_digest(tfm, sg, nsg, out); | ||
| 345 | } | 497 | } |
| 346 | 498 | ||
| 347 | static inline int crypto_digest_setkey(struct crypto_tfm *tfm, | 499 | static inline void crypto_free_blkcipher(struct crypto_blkcipher *tfm) |
| 500 | { | ||
| 501 | crypto_free_tfm(crypto_blkcipher_tfm(tfm)); | ||
| 502 | } | ||
| 503 | |||
| 504 | static inline int crypto_has_blkcipher(const char *alg_name, u32 type, u32 mask) | ||
| 505 | { | ||
| 506 | type &= ~CRYPTO_ALG_TYPE_MASK; | ||
| 507 | type |= CRYPTO_ALG_TYPE_BLKCIPHER; | ||
| 508 | mask |= CRYPTO_ALG_TYPE_MASK; | ||
| 509 | |||
| 510 | return crypto_has_alg(alg_name, type, mask); | ||
| 511 | } | ||
| 512 | |||
| 513 | static inline const char *crypto_blkcipher_name(struct crypto_blkcipher *tfm) | ||
| 514 | { | ||
| 515 | return crypto_tfm_alg_name(crypto_blkcipher_tfm(tfm)); | ||
| 516 | } | ||
| 517 | |||
| 518 | static inline struct blkcipher_tfm *crypto_blkcipher_crt( | ||
| 519 | struct crypto_blkcipher *tfm) | ||
| 520 | { | ||
| 521 | return &crypto_blkcipher_tfm(tfm)->crt_blkcipher; | ||
| 522 | } | ||
| 523 | |||
| 524 | static inline struct blkcipher_alg *crypto_blkcipher_alg( | ||
| 525 | struct crypto_blkcipher *tfm) | ||
| 526 | { | ||
| 527 | return &crypto_blkcipher_tfm(tfm)->__crt_alg->cra_blkcipher; | ||
| 528 | } | ||
| 529 | |||
| 530 | static inline unsigned int crypto_blkcipher_ivsize(struct crypto_blkcipher *tfm) | ||
| 531 | { | ||
| 532 | return crypto_blkcipher_alg(tfm)->ivsize; | ||
| 533 | } | ||
| 534 | |||
| 535 | static inline unsigned int crypto_blkcipher_blocksize( | ||
| 536 | struct crypto_blkcipher *tfm) | ||
| 537 | { | ||
| 538 | return crypto_tfm_alg_blocksize(crypto_blkcipher_tfm(tfm)); | ||
| 539 | } | ||
| 540 | |||
| 541 | static inline unsigned int crypto_blkcipher_alignmask( | ||
| 542 | struct crypto_blkcipher *tfm) | ||
| 543 | { | ||
| 544 | return crypto_tfm_alg_alignmask(crypto_blkcipher_tfm(tfm)); | ||
| 545 | } | ||
| 546 | |||
| 547 | static inline u32 crypto_blkcipher_get_flags(struct crypto_blkcipher *tfm) | ||
| 548 | { | ||
| 549 | return crypto_tfm_get_flags(crypto_blkcipher_tfm(tfm)); | ||
| 550 | } | ||
| 551 | |||
| 552 | static inline void crypto_blkcipher_set_flags(struct crypto_blkcipher *tfm, | ||
| 553 | u32 flags) | ||
| 554 | { | ||
| 555 | crypto_tfm_set_flags(crypto_blkcipher_tfm(tfm), flags); | ||
| 556 | } | ||
| 557 | |||
| 558 | static inline void crypto_blkcipher_clear_flags(struct crypto_blkcipher *tfm, | ||
| 559 | u32 flags) | ||
| 560 | { | ||
| 561 | crypto_tfm_clear_flags(crypto_blkcipher_tfm(tfm), flags); | ||
| 562 | } | ||
| 563 | |||
| 564 | static inline int crypto_blkcipher_setkey(struct crypto_blkcipher *tfm, | ||
| 565 | const u8 *key, unsigned int keylen) | ||
| 566 | { | ||
| 567 | return crypto_blkcipher_crt(tfm)->setkey(crypto_blkcipher_tfm(tfm), | ||
| 568 | key, keylen); | ||
| 569 | } | ||
| 570 | |||
| 571 | static inline int crypto_blkcipher_encrypt(struct blkcipher_desc *desc, | ||
| 572 | struct scatterlist *dst, | ||
| 573 | struct scatterlist *src, | ||
| 574 | unsigned int nbytes) | ||
| 575 | { | ||
| 576 | desc->info = crypto_blkcipher_crt(desc->tfm)->iv; | ||
| 577 | return crypto_blkcipher_crt(desc->tfm)->encrypt(desc, dst, src, nbytes); | ||
| 578 | } | ||
| 579 | |||
| 580 | static inline int crypto_blkcipher_encrypt_iv(struct blkcipher_desc *desc, | ||
| 581 | struct scatterlist *dst, | ||
| 582 | struct scatterlist *src, | ||
| 583 | unsigned int nbytes) | ||
| 584 | { | ||
| 585 | return crypto_blkcipher_crt(desc->tfm)->encrypt(desc, dst, src, nbytes); | ||
| 586 | } | ||
| 587 | |||
| 588 | static inline int crypto_blkcipher_decrypt(struct blkcipher_desc *desc, | ||
| 589 | struct scatterlist *dst, | ||
| 590 | struct scatterlist *src, | ||
| 591 | unsigned int nbytes) | ||
| 592 | { | ||
| 593 | desc->info = crypto_blkcipher_crt(desc->tfm)->iv; | ||
| 594 | return crypto_blkcipher_crt(desc->tfm)->decrypt(desc, dst, src, nbytes); | ||
| 595 | } | ||
| 596 | |||
| 597 | static inline int crypto_blkcipher_decrypt_iv(struct blkcipher_desc *desc, | ||
| 598 | struct scatterlist *dst, | ||
| 599 | struct scatterlist *src, | ||
| 600 | unsigned int nbytes) | ||
| 601 | { | ||
| 602 | return crypto_blkcipher_crt(desc->tfm)->decrypt(desc, dst, src, nbytes); | ||
| 603 | } | ||
| 604 | |||
| 605 | static inline void crypto_blkcipher_set_iv(struct crypto_blkcipher *tfm, | ||
| 606 | const u8 *src, unsigned int len) | ||
| 607 | { | ||
| 608 | memcpy(crypto_blkcipher_crt(tfm)->iv, src, len); | ||
| 609 | } | ||
| 610 | |||
| 611 | static inline void crypto_blkcipher_get_iv(struct crypto_blkcipher *tfm, | ||
| 612 | u8 *dst, unsigned int len) | ||
| 613 | { | ||
| 614 | memcpy(dst, crypto_blkcipher_crt(tfm)->iv, len); | ||
| 615 | } | ||
| 616 | |||
| 617 | static inline struct crypto_cipher *__crypto_cipher_cast(struct crypto_tfm *tfm) | ||
| 618 | { | ||
| 619 | return (struct crypto_cipher *)tfm; | ||
| 620 | } | ||
| 621 | |||
| 622 | static inline struct crypto_cipher *crypto_cipher_cast(struct crypto_tfm *tfm) | ||
| 623 | { | ||
| 624 | BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); | ||
| 625 | return __crypto_cipher_cast(tfm); | ||
| 626 | } | ||
| 627 | |||
| 628 | static inline struct crypto_cipher *crypto_alloc_cipher(const char *alg_name, | ||
| 629 | u32 type, u32 mask) | ||
| 630 | { | ||
| 631 | type &= ~CRYPTO_ALG_TYPE_MASK; | ||
| 632 | type |= CRYPTO_ALG_TYPE_CIPHER; | ||
| 633 | mask |= CRYPTO_ALG_TYPE_MASK; | ||
| 634 | |||
| 635 | return __crypto_cipher_cast(crypto_alloc_base(alg_name, type, mask)); | ||
| 636 | } | ||
| 637 | |||
| 638 | static inline struct crypto_tfm *crypto_cipher_tfm(struct crypto_cipher *tfm) | ||
| 639 | { | ||
| 640 | return tfm; | ||
| 641 | } | ||
| 642 | |||
| 643 | static inline void crypto_free_cipher(struct crypto_cipher *tfm) | ||
| 644 | { | ||
| 645 | crypto_free_tfm(crypto_cipher_tfm(tfm)); | ||
| 646 | } | ||
| 647 | |||
| 648 | static inline int crypto_has_cipher(const char *alg_name, u32 type, u32 mask) | ||
| 649 | { | ||
| 650 | type &= ~CRYPTO_ALG_TYPE_MASK; | ||
| 651 | type |= CRYPTO_ALG_TYPE_CIPHER; | ||
| 652 | mask |= CRYPTO_ALG_TYPE_MASK; | ||
| 653 | |||
| 654 | return crypto_has_alg(alg_name, type, mask); | ||
| 655 | } | ||
| 656 | |||
| 657 | static inline struct cipher_tfm *crypto_cipher_crt(struct crypto_cipher *tfm) | ||
| 658 | { | ||
| 659 | return &crypto_cipher_tfm(tfm)->crt_cipher; | ||
| 660 | } | ||
| 661 | |||
| 662 | static inline unsigned int crypto_cipher_blocksize(struct crypto_cipher *tfm) | ||
| 663 | { | ||
| 664 | return crypto_tfm_alg_blocksize(crypto_cipher_tfm(tfm)); | ||
| 665 | } | ||
| 666 | |||
| 667 | static inline unsigned int crypto_cipher_alignmask(struct crypto_cipher *tfm) | ||
| 668 | { | ||
| 669 | return crypto_tfm_alg_alignmask(crypto_cipher_tfm(tfm)); | ||
| 670 | } | ||
| 671 | |||
| 672 | static inline u32 crypto_cipher_get_flags(struct crypto_cipher *tfm) | ||
| 673 | { | ||
| 674 | return crypto_tfm_get_flags(crypto_cipher_tfm(tfm)); | ||
| 675 | } | ||
| 676 | |||
| 677 | static inline void crypto_cipher_set_flags(struct crypto_cipher *tfm, | ||
| 678 | u32 flags) | ||
| 679 | { | ||
| 680 | crypto_tfm_set_flags(crypto_cipher_tfm(tfm), flags); | ||
| 681 | } | ||
| 682 | |||
| 683 | static inline void crypto_cipher_clear_flags(struct crypto_cipher *tfm, | ||
| 684 | u32 flags) | ||
| 685 | { | ||
| 686 | crypto_tfm_clear_flags(crypto_cipher_tfm(tfm), flags); | ||
| 687 | } | ||
| 688 | |||
| 689 | static inline int crypto_cipher_setkey(struct crypto_cipher *tfm, | ||
| 348 | const u8 *key, unsigned int keylen) | 690 | const u8 *key, unsigned int keylen) |
| 349 | { | 691 | { |
| 350 | BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_DIGEST); | 692 | return crypto_cipher_crt(tfm)->cit_setkey(crypto_cipher_tfm(tfm), |
| 351 | if (tfm->crt_digest.dit_setkey == NULL) | 693 | key, keylen); |
| 352 | return -ENOSYS; | 694 | } |
| 353 | return tfm->crt_digest.dit_setkey(tfm, key, keylen); | 695 | |
| 696 | static inline void crypto_cipher_encrypt_one(struct crypto_cipher *tfm, | ||
| 697 | u8 *dst, const u8 *src) | ||
| 698 | { | ||
| 699 | crypto_cipher_crt(tfm)->cit_encrypt_one(crypto_cipher_tfm(tfm), | ||
| 700 | dst, src); | ||
| 701 | } | ||
| 702 | |||
| 703 | static inline void crypto_cipher_decrypt_one(struct crypto_cipher *tfm, | ||
| 704 | u8 *dst, const u8 *src) | ||
| 705 | { | ||
| 706 | crypto_cipher_crt(tfm)->cit_decrypt_one(crypto_cipher_tfm(tfm), | ||
| 707 | dst, src); | ||
| 708 | } | ||
| 709 | |||
| 710 | void crypto_digest_init(struct crypto_tfm *tfm) __deprecated_for_modules; | ||
| 711 | void crypto_digest_update(struct crypto_tfm *tfm, | ||
| 712 | struct scatterlist *sg, unsigned int nsg) | ||
| 713 | __deprecated_for_modules; | ||
| 714 | void crypto_digest_final(struct crypto_tfm *tfm, u8 *out) | ||
| 715 | __deprecated_for_modules; | ||
| 716 | void crypto_digest_digest(struct crypto_tfm *tfm, | ||
| 717 | struct scatterlist *sg, unsigned int nsg, u8 *out) | ||
| 718 | __deprecated_for_modules; | ||
| 719 | |||
| 720 | static inline struct crypto_hash *__crypto_hash_cast(struct crypto_tfm *tfm) | ||
| 721 | { | ||
| 722 | return (struct crypto_hash *)tfm; | ||
| 723 | } | ||
| 724 | |||
| 725 | static inline struct crypto_hash *crypto_hash_cast(struct crypto_tfm *tfm) | ||
| 726 | { | ||
| 727 | BUG_ON((crypto_tfm_alg_type(tfm) ^ CRYPTO_ALG_TYPE_HASH) & | ||
| 728 | CRYPTO_ALG_TYPE_HASH_MASK); | ||
| 729 | return __crypto_hash_cast(tfm); | ||
| 354 | } | 730 | } |
| 355 | 731 | ||
| 356 | static inline int crypto_cipher_setkey(struct crypto_tfm *tfm, | 732 | static int crypto_digest_setkey(struct crypto_tfm *tfm, const u8 *key, |
| 733 | unsigned int keylen) __deprecated; | ||
| 734 | static inline int crypto_digest_setkey(struct crypto_tfm *tfm, | ||
| 357 | const u8 *key, unsigned int keylen) | 735 | const u8 *key, unsigned int keylen) |
| 358 | { | 736 | { |
| 359 | BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); | 737 | return tfm->crt_hash.setkey(crypto_hash_cast(tfm), key, keylen); |
| 360 | return tfm->crt_cipher.cit_setkey(tfm, key, keylen); | 738 | } |
| 739 | |||
| 740 | static inline struct crypto_hash *crypto_alloc_hash(const char *alg_name, | ||
| 741 | u32 type, u32 mask) | ||
| 742 | { | ||
| 743 | type &= ~CRYPTO_ALG_TYPE_MASK; | ||
| 744 | type |= CRYPTO_ALG_TYPE_HASH; | ||
| 745 | mask |= CRYPTO_ALG_TYPE_HASH_MASK; | ||
| 746 | |||
| 747 | return __crypto_hash_cast(crypto_alloc_base(alg_name, type, mask)); | ||
| 748 | } | ||
| 749 | |||
| 750 | static inline struct crypto_tfm *crypto_hash_tfm(struct crypto_hash *tfm) | ||
| 751 | { | ||
| 752 | return &tfm->base; | ||
| 753 | } | ||
| 754 | |||
| 755 | static inline void crypto_free_hash(struct crypto_hash *tfm) | ||
| 756 | { | ||
| 757 | crypto_free_tfm(crypto_hash_tfm(tfm)); | ||
| 758 | } | ||
| 759 | |||
| 760 | static inline int crypto_has_hash(const char *alg_name, u32 type, u32 mask) | ||
| 761 | { | ||
| 762 | type &= ~CRYPTO_ALG_TYPE_MASK; | ||
| 763 | type |= CRYPTO_ALG_TYPE_HASH; | ||
| 764 | mask |= CRYPTO_ALG_TYPE_HASH_MASK; | ||
| 765 | |||
| 766 | return crypto_has_alg(alg_name, type, mask); | ||
| 767 | } | ||
| 768 | |||
| 769 | static inline struct hash_tfm *crypto_hash_crt(struct crypto_hash *tfm) | ||
| 770 | { | ||
| 771 | return &crypto_hash_tfm(tfm)->crt_hash; | ||
| 772 | } | ||
| 773 | |||
| 774 | static inline unsigned int crypto_hash_blocksize(struct crypto_hash *tfm) | ||
| 775 | { | ||
| 776 | return crypto_tfm_alg_blocksize(crypto_hash_tfm(tfm)); | ||
| 777 | } | ||
| 778 | |||
| 779 | static inline unsigned int crypto_hash_alignmask(struct crypto_hash *tfm) | ||
| 780 | { | ||
| 781 | return crypto_tfm_alg_alignmask(crypto_hash_tfm(tfm)); | ||
| 782 | } | ||
| 783 | |||
| 784 | static inline unsigned int crypto_hash_digestsize(struct crypto_hash *tfm) | ||
| 785 | { | ||
| 786 | return crypto_hash_crt(tfm)->digestsize; | ||
| 787 | } | ||
| 788 | |||
| 789 | static inline u32 crypto_hash_get_flags(struct crypto_hash *tfm) | ||
| 790 | { | ||
| 791 | return crypto_tfm_get_flags(crypto_hash_tfm(tfm)); | ||
| 792 | } | ||
| 793 | |||
| 794 | static inline void crypto_hash_set_flags(struct crypto_hash *tfm, u32 flags) | ||
| 795 | { | ||
| 796 | crypto_tfm_set_flags(crypto_hash_tfm(tfm), flags); | ||
| 361 | } | 797 | } |
| 362 | 798 | ||
| 799 | static inline void crypto_hash_clear_flags(struct crypto_hash *tfm, u32 flags) | ||
| 800 | { | ||
| 801 | crypto_tfm_clear_flags(crypto_hash_tfm(tfm), flags); | ||
| 802 | } | ||
| 803 | |||
| 804 | static inline int crypto_hash_init(struct hash_desc *desc) | ||
| 805 | { | ||
| 806 | return crypto_hash_crt(desc->tfm)->init(desc); | ||
| 807 | } | ||
| 808 | |||
| 809 | static inline int crypto_hash_update(struct hash_desc *desc, | ||
| 810 | struct scatterlist *sg, | ||
| 811 | unsigned int nbytes) | ||
| 812 | { | ||
| 813 | return crypto_hash_crt(desc->tfm)->update(desc, sg, nbytes); | ||
| 814 | } | ||
| 815 | |||
| 816 | static inline int crypto_hash_final(struct hash_desc *desc, u8 *out) | ||
| 817 | { | ||
| 818 | return crypto_hash_crt(desc->tfm)->final(desc, out); | ||
| 819 | } | ||
| 820 | |||
| 821 | static inline int crypto_hash_digest(struct hash_desc *desc, | ||
| 822 | struct scatterlist *sg, | ||
| 823 | unsigned int nbytes, u8 *out) | ||
| 824 | { | ||
| 825 | return crypto_hash_crt(desc->tfm)->digest(desc, sg, nbytes, out); | ||
| 826 | } | ||
| 827 | |||
| 828 | static inline int crypto_hash_setkey(struct crypto_hash *hash, | ||
| 829 | const u8 *key, unsigned int keylen) | ||
| 830 | { | ||
| 831 | return crypto_hash_crt(hash)->setkey(hash, key, keylen); | ||
| 832 | } | ||
| 833 | |||
| 834 | static int crypto_cipher_encrypt(struct crypto_tfm *tfm, | ||
| 835 | struct scatterlist *dst, | ||
| 836 | struct scatterlist *src, | ||
| 837 | unsigned int nbytes) __deprecated; | ||
| 363 | static inline int crypto_cipher_encrypt(struct crypto_tfm *tfm, | 838 | static inline int crypto_cipher_encrypt(struct crypto_tfm *tfm, |
| 364 | struct scatterlist *dst, | 839 | struct scatterlist *dst, |
| 365 | struct scatterlist *src, | 840 | struct scatterlist *src, |
| @@ -369,16 +844,23 @@ static inline int crypto_cipher_encrypt(struct crypto_tfm *tfm, | |||
| 369 | return tfm->crt_cipher.cit_encrypt(tfm, dst, src, nbytes); | 844 | return tfm->crt_cipher.cit_encrypt(tfm, dst, src, nbytes); |
| 370 | } | 845 | } |
| 371 | 846 | ||
| 847 | static int crypto_cipher_encrypt_iv(struct crypto_tfm *tfm, | ||
| 848 | struct scatterlist *dst, | ||
| 849 | struct scatterlist *src, | ||
| 850 | unsigned int nbytes, u8 *iv) __deprecated; | ||
| 372 | static inline int crypto_cipher_encrypt_iv(struct crypto_tfm *tfm, | 851 | static inline int crypto_cipher_encrypt_iv(struct crypto_tfm *tfm, |
| 373 | struct scatterlist *dst, | 852 | struct scatterlist *dst, |
| 374 | struct scatterlist *src, | 853 | struct scatterlist *src, |
| 375 | unsigned int nbytes, u8 *iv) | 854 | unsigned int nbytes, u8 *iv) |
| 376 | { | 855 | { |
| 377 | BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); | 856 | BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); |
| 378 | BUG_ON(tfm->crt_cipher.cit_mode == CRYPTO_TFM_MODE_ECB); | ||
| 379 | return tfm->crt_cipher.cit_encrypt_iv(tfm, dst, src, nbytes, iv); | 857 | return tfm->crt_cipher.cit_encrypt_iv(tfm, dst, src, nbytes, iv); |
| 380 | } | 858 | } |
| 381 | 859 | ||
| 860 | static int crypto_cipher_decrypt(struct crypto_tfm *tfm, | ||
| 861 | struct scatterlist *dst, | ||
| 862 | struct scatterlist *src, | ||
| 863 | unsigned int nbytes) __deprecated; | ||
| 382 | static inline int crypto_cipher_decrypt(struct crypto_tfm *tfm, | 864 | static inline int crypto_cipher_decrypt(struct crypto_tfm *tfm, |
| 383 | struct scatterlist *dst, | 865 | struct scatterlist *dst, |
| 384 | struct scatterlist *src, | 866 | struct scatterlist *src, |
| @@ -388,16 +870,21 @@ static inline int crypto_cipher_decrypt(struct crypto_tfm *tfm, | |||
| 388 | return tfm->crt_cipher.cit_decrypt(tfm, dst, src, nbytes); | 870 | return tfm->crt_cipher.cit_decrypt(tfm, dst, src, nbytes); |
| 389 | } | 871 | } |
| 390 | 872 | ||
| 873 | static int crypto_cipher_decrypt_iv(struct crypto_tfm *tfm, | ||
| 874 | struct scatterlist *dst, | ||
| 875 | struct scatterlist *src, | ||
| 876 | unsigned int nbytes, u8 *iv) __deprecated; | ||
| 391 | static inline int crypto_cipher_decrypt_iv(struct crypto_tfm *tfm, | 877 | static inline int crypto_cipher_decrypt_iv(struct crypto_tfm *tfm, |
| 392 | struct scatterlist *dst, | 878 | struct scatterlist *dst, |
| 393 | struct scatterlist *src, | 879 | struct scatterlist *src, |
| 394 | unsigned int nbytes, u8 *iv) | 880 | unsigned int nbytes, u8 *iv) |
| 395 | { | 881 | { |
| 396 | BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); | 882 | BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); |
| 397 | BUG_ON(tfm->crt_cipher.cit_mode == CRYPTO_TFM_MODE_ECB); | ||
| 398 | return tfm->crt_cipher.cit_decrypt_iv(tfm, dst, src, nbytes, iv); | 883 | return tfm->crt_cipher.cit_decrypt_iv(tfm, dst, src, nbytes, iv); |
| 399 | } | 884 | } |
| 400 | 885 | ||
| 886 | static void crypto_cipher_set_iv(struct crypto_tfm *tfm, | ||
| 887 | const u8 *src, unsigned int len) __deprecated; | ||
| 401 | static inline void crypto_cipher_set_iv(struct crypto_tfm *tfm, | 888 | static inline void crypto_cipher_set_iv(struct crypto_tfm *tfm, |
| 402 | const u8 *src, unsigned int len) | 889 | const u8 *src, unsigned int len) |
| 403 | { | 890 | { |
| @@ -405,6 +892,8 @@ static inline void crypto_cipher_set_iv(struct crypto_tfm *tfm, | |||
| 405 | memcpy(tfm->crt_cipher.cit_iv, src, len); | 892 | memcpy(tfm->crt_cipher.cit_iv, src, len); |
| 406 | } | 893 | } |
| 407 | 894 | ||
| 895 | static void crypto_cipher_get_iv(struct crypto_tfm *tfm, | ||
| 896 | u8 *dst, unsigned int len) __deprecated; | ||
| 408 | static inline void crypto_cipher_get_iv(struct crypto_tfm *tfm, | 897 | static inline void crypto_cipher_get_iv(struct crypto_tfm *tfm, |
| 409 | u8 *dst, unsigned int len) | 898 | u8 *dst, unsigned int len) |
| 410 | { | 899 | { |
| @@ -412,34 +901,70 @@ static inline void crypto_cipher_get_iv(struct crypto_tfm *tfm, | |||
| 412 | memcpy(dst, tfm->crt_cipher.cit_iv, len); | 901 | memcpy(dst, tfm->crt_cipher.cit_iv, len); |
| 413 | } | 902 | } |
| 414 | 903 | ||
| 415 | static inline int crypto_comp_compress(struct crypto_tfm *tfm, | 904 | static inline struct crypto_comp *__crypto_comp_cast(struct crypto_tfm *tfm) |
| 905 | { | ||
| 906 | return (struct crypto_comp *)tfm; | ||
| 907 | } | ||
| 908 | |||
| 909 | static inline struct crypto_comp *crypto_comp_cast(struct crypto_tfm *tfm) | ||
| 910 | { | ||
| 911 | BUG_ON((crypto_tfm_alg_type(tfm) ^ CRYPTO_ALG_TYPE_COMPRESS) & | ||
| 912 | CRYPTO_ALG_TYPE_MASK); | ||
| 913 | return __crypto_comp_cast(tfm); | ||
| 914 | } | ||
| 915 | |||
| 916 | static inline struct crypto_comp *crypto_alloc_comp(const char *alg_name, | ||
| 917 | u32 type, u32 mask) | ||
| 918 | { | ||
| 919 | type &= ~CRYPTO_ALG_TYPE_MASK; | ||
| 920 | type |= CRYPTO_ALG_TYPE_COMPRESS; | ||
| 921 | mask |= CRYPTO_ALG_TYPE_MASK; | ||
| 922 | |||
| 923 | return __crypto_comp_cast(crypto_alloc_base(alg_name, type, mask)); | ||
| 924 | } | ||
| 925 | |||
| 926 | static inline struct crypto_tfm *crypto_comp_tfm(struct crypto_comp *tfm) | ||
| 927 | { | ||
| 928 | return tfm; | ||
| 929 | } | ||
| 930 | |||
| 931 | static inline void crypto_free_comp(struct crypto_comp *tfm) | ||
| 932 | { | ||
| 933 | crypto_free_tfm(crypto_comp_tfm(tfm)); | ||
| 934 | } | ||
| 935 | |||
| 936 | static inline int crypto_has_comp(const char *alg_name, u32 type, u32 mask) | ||
| 937 | { | ||
| 938 | type &= ~CRYPTO_ALG_TYPE_MASK; | ||
| 939 | type |= CRYPTO_ALG_TYPE_COMPRESS; | ||
| 940 | mask |= CRYPTO_ALG_TYPE_MASK; | ||
| 941 | |||
| 942 | return crypto_has_alg(alg_name, type, mask); | ||
| 943 | } | ||
| 944 | |||
| 945 | static inline const char *crypto_comp_name(struct crypto_comp *tfm) | ||
| 946 | { | ||
| 947 | return crypto_tfm_alg_name(crypto_comp_tfm(tfm)); | ||
| 948 | } | ||
| 949 | |||
| 950 | static inline struct compress_tfm *crypto_comp_crt(struct crypto_comp *tfm) | ||
| 951 | { | ||
| 952 | return &crypto_comp_tfm(tfm)->crt_compress; | ||
| 953 | } | ||
| 954 | |||
| 955 | static inline int crypto_comp_compress(struct crypto_comp *tfm, | ||
| 416 | const u8 *src, unsigned int slen, | 956 | const u8 *src, unsigned int slen, |
| 417 | u8 *dst, unsigned int *dlen) | 957 | u8 *dst, unsigned int *dlen) |
| 418 | { | 958 | { |
| 419 | BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_COMPRESS); | 959 | return crypto_comp_crt(tfm)->cot_compress(tfm, src, slen, dst, dlen); |
| 420 | return tfm->crt_compress.cot_compress(tfm, src, slen, dst, dlen); | ||
| 421 | } | 960 | } |
| 422 | 961 | ||
| 423 | static inline int crypto_comp_decompress(struct crypto_tfm *tfm, | 962 | static inline int crypto_comp_decompress(struct crypto_comp *tfm, |
| 424 | const u8 *src, unsigned int slen, | 963 | const u8 *src, unsigned int slen, |
| 425 | u8 *dst, unsigned int *dlen) | 964 | u8 *dst, unsigned int *dlen) |
| 426 | { | 965 | { |
| 427 | BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_COMPRESS); | 966 | return crypto_comp_crt(tfm)->cot_decompress(tfm, src, slen, dst, dlen); |
| 428 | return tfm->crt_compress.cot_decompress(tfm, src, slen, dst, dlen); | ||
| 429 | } | 967 | } |
| 430 | 968 | ||
| 431 | /* | ||
| 432 | * HMAC support. | ||
| 433 | */ | ||
| 434 | #ifdef CONFIG_CRYPTO_HMAC | ||
| 435 | void crypto_hmac_init(struct crypto_tfm *tfm, u8 *key, unsigned int *keylen); | ||
| 436 | void crypto_hmac_update(struct crypto_tfm *tfm, | ||
| 437 | struct scatterlist *sg, unsigned int nsg); | ||
| 438 | void crypto_hmac_final(struct crypto_tfm *tfm, u8 *key, | ||
| 439 | unsigned int *keylen, u8 *out); | ||
| 440 | void crypto_hmac(struct crypto_tfm *tfm, u8 *key, unsigned int *keylen, | ||
| 441 | struct scatterlist *sg, unsigned int nsg, u8 *out); | ||
| 442 | #endif /* CONFIG_CRYPTO_HMAC */ | ||
| 443 | |||
| 444 | #endif /* _LINUX_CRYPTO_H */ | 969 | #endif /* _LINUX_CRYPTO_H */ |
| 445 | 970 | ||
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 471781ffea..44605be594 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h | |||
| @@ -221,6 +221,7 @@ static inline int dname_external(struct dentry *dentry) | |||
| 221 | */ | 221 | */ |
| 222 | extern void d_instantiate(struct dentry *, struct inode *); | 222 | extern void d_instantiate(struct dentry *, struct inode *); |
| 223 | extern struct dentry * d_instantiate_unique(struct dentry *, struct inode *); | 223 | extern struct dentry * d_instantiate_unique(struct dentry *, struct inode *); |
| 224 | extern struct dentry * d_materialise_unique(struct dentry *, struct inode *); | ||
| 224 | extern void d_delete(struct dentry *); | 225 | extern void d_delete(struct dentry *); |
| 225 | 226 | ||
| 226 | /* allocate/de-allocate */ | 227 | /* allocate/de-allocate */ |
diff --git a/include/linux/dccp.h b/include/linux/dccp.h index 676333b9fa..d6f4ec467a 100644 --- a/include/linux/dccp.h +++ b/include/linux/dccp.h | |||
| @@ -169,6 +169,12 @@ enum { | |||
| 169 | DCCPO_MAX_CCID_SPECIFIC = 255, | 169 | DCCPO_MAX_CCID_SPECIFIC = 255, |
| 170 | }; | 170 | }; |
| 171 | 171 | ||
| 172 | /* DCCP CCIDS */ | ||
| 173 | enum { | ||
| 174 | DCCPC_CCID2 = 2, | ||
| 175 | DCCPC_CCID3 = 3, | ||
| 176 | }; | ||
| 177 | |||
| 172 | /* DCCP features */ | 178 | /* DCCP features */ |
| 173 | enum { | 179 | enum { |
| 174 | DCCPF_RESERVED = 0, | 180 | DCCPF_RESERVED = 0, |
| @@ -320,7 +326,7 @@ static inline unsigned int dccp_hdr_len(const struct sk_buff *skb) | |||
| 320 | /* initial values for each feature */ | 326 | /* initial values for each feature */ |
| 321 | #define DCCPF_INITIAL_SEQUENCE_WINDOW 100 | 327 | #define DCCPF_INITIAL_SEQUENCE_WINDOW 100 |
| 322 | #define DCCPF_INITIAL_ACK_RATIO 2 | 328 | #define DCCPF_INITIAL_ACK_RATIO 2 |
| 323 | #define DCCPF_INITIAL_CCID 2 | 329 | #define DCCPF_INITIAL_CCID DCCPC_CCID2 |
| 324 | #define DCCPF_INITIAL_SEND_ACK_VECTOR 1 | 330 | #define DCCPF_INITIAL_SEND_ACK_VECTOR 1 |
| 325 | /* FIXME: for now we're default to 1 but it should really be 0 */ | 331 | /* FIXME: for now we're default to 1 but it should really be 0 */ |
| 326 | #define DCCPF_INITIAL_SEND_NDP_COUNT 1 | 332 | #define DCCPF_INITIAL_SEND_NDP_COUNT 1 |
| @@ -404,6 +410,7 @@ struct dccp_service_list { | |||
| 404 | }; | 410 | }; |
| 405 | 411 | ||
| 406 | #define DCCP_SERVICE_INVALID_VALUE htonl((__u32)-1) | 412 | #define DCCP_SERVICE_INVALID_VALUE htonl((__u32)-1) |
| 413 | #define DCCP_SERVICE_CODE_IS_ABSENT 0 | ||
| 407 | 414 | ||
| 408 | static inline int dccp_list_has_service(const struct dccp_service_list *sl, | 415 | static inline int dccp_list_has_service(const struct dccp_service_list *sl, |
| 409 | const __be32 service) | 416 | const __be32 service) |
| @@ -438,6 +445,7 @@ struct dccp_ackvec; | |||
| 438 | * @dccps_role - Role of this sock, one of %dccp_role | 445 | * @dccps_role - Role of this sock, one of %dccp_role |
| 439 | * @dccps_ndp_count - number of Non Data Packets since last data packet | 446 | * @dccps_ndp_count - number of Non Data Packets since last data packet |
| 440 | * @dccps_hc_rx_ackvec - rx half connection ack vector | 447 | * @dccps_hc_rx_ackvec - rx half connection ack vector |
| 448 | * @dccps_xmit_timer - timer for when CCID is not ready to send | ||
| 441 | */ | 449 | */ |
| 442 | struct dccp_sock { | 450 | struct dccp_sock { |
| 443 | /* inet_connection_sock has to be the first member of dccp_sock */ | 451 | /* inet_connection_sock has to be the first member of dccp_sock */ |
| @@ -470,6 +478,7 @@ struct dccp_sock { | |||
| 470 | enum dccp_role dccps_role:2; | 478 | enum dccp_role dccps_role:2; |
| 471 | __u8 dccps_hc_rx_insert_options:1; | 479 | __u8 dccps_hc_rx_insert_options:1; |
| 472 | __u8 dccps_hc_tx_insert_options:1; | 480 | __u8 dccps_hc_tx_insert_options:1; |
| 481 | struct timer_list dccps_xmit_timer; | ||
| 473 | }; | 482 | }; |
| 474 | 483 | ||
| 475 | static inline struct dccp_sock *dccp_sk(const struct sock *sk) | 484 | static inline struct dccp_sock *dccp_sk(const struct sock *sk) |
| @@ -482,11 +491,6 @@ static inline struct dccp_minisock *dccp_msk(const struct sock *sk) | |||
| 482 | return (struct dccp_minisock *)&dccp_sk(sk)->dccps_minisock; | 491 | return (struct dccp_minisock *)&dccp_sk(sk)->dccps_minisock; |
| 483 | } | 492 | } |
| 484 | 493 | ||
| 485 | static inline int dccp_service_not_initialized(const struct sock *sk) | ||
| 486 | { | ||
| 487 | return dccp_sk(sk)->dccps_service == DCCP_SERVICE_INVALID_VALUE; | ||
| 488 | } | ||
| 489 | |||
| 490 | static inline const char *dccp_role(const struct sock *sk) | 494 | static inline const char *dccp_role(const struct sock *sk) |
| 491 | { | 495 | { |
| 492 | switch (dccp_sk(sk)->dccps_role) { | 496 | switch (dccp_sk(sk)->dccps_role) { |
diff --git a/include/linux/device.h b/include/linux/device.h index 1e5f30da98..662e6a1014 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | #include <linux/kobject.h> | 15 | #include <linux/kobject.h> |
| 16 | #include <linux/klist.h> | 16 | #include <linux/klist.h> |
| 17 | #include <linux/list.h> | 17 | #include <linux/list.h> |
| 18 | #include <linux/compiler.h> | ||
| 18 | #include <linux/types.h> | 19 | #include <linux/types.h> |
| 19 | #include <linux/module.h> | 20 | #include <linux/module.h> |
| 20 | #include <linux/pm.h> | 21 | #include <linux/pm.h> |
| @@ -51,14 +52,17 @@ struct bus_type { | |||
| 51 | int (*probe)(struct device * dev); | 52 | int (*probe)(struct device * dev); |
| 52 | int (*remove)(struct device * dev); | 53 | int (*remove)(struct device * dev); |
| 53 | void (*shutdown)(struct device * dev); | 54 | void (*shutdown)(struct device * dev); |
| 54 | int (*suspend)(struct device * dev, pm_message_t state); | 55 | |
| 55 | int (*resume)(struct device * dev); | 56 | int (*suspend)(struct device * dev, pm_message_t state); |
| 57 | int (*suspend_late)(struct device * dev, pm_message_t state); | ||
| 58 | int (*resume_early)(struct device * dev); | ||
| 59 | int (*resume)(struct device * dev); | ||
| 56 | }; | 60 | }; |
| 57 | 61 | ||
| 58 | extern int bus_register(struct bus_type * bus); | 62 | extern int __must_check bus_register(struct bus_type * bus); |
| 59 | extern void bus_unregister(struct bus_type * bus); | 63 | extern void bus_unregister(struct bus_type * bus); |
| 60 | 64 | ||
| 61 | extern void bus_rescan_devices(struct bus_type * bus); | 65 | extern int __must_check bus_rescan_devices(struct bus_type * bus); |
| 62 | 66 | ||
| 63 | /* iterator helpers for buses */ | 67 | /* iterator helpers for buses */ |
| 64 | 68 | ||
| @@ -67,9 +71,9 @@ int bus_for_each_dev(struct bus_type * bus, struct device * start, void * data, | |||
| 67 | struct device * bus_find_device(struct bus_type *bus, struct device *start, | 71 | struct device * bus_find_device(struct bus_type *bus, struct device *start, |
| 68 | void *data, int (*match)(struct device *, void *)); | 72 | void *data, int (*match)(struct device *, void *)); |
| 69 | 73 | ||
| 70 | int bus_for_each_drv(struct bus_type * bus, struct device_driver * start, | 74 | int __must_check bus_for_each_drv(struct bus_type *bus, |
| 71 | void * data, int (*fn)(struct device_driver *, void *)); | 75 | struct device_driver *start, void *data, |
| 72 | 76 | int (*fn)(struct device_driver *, void *)); | |
| 73 | 77 | ||
| 74 | /* driverfs interface for exporting bus attributes */ | 78 | /* driverfs interface for exporting bus attributes */ |
| 75 | 79 | ||
| @@ -82,7 +86,8 @@ struct bus_attribute { | |||
| 82 | #define BUS_ATTR(_name,_mode,_show,_store) \ | 86 | #define BUS_ATTR(_name,_mode,_show,_store) \ |
| 83 | struct bus_attribute bus_attr_##_name = __ATTR(_name,_mode,_show,_store) | 87 | struct bus_attribute bus_attr_##_name = __ATTR(_name,_mode,_show,_store) |
| 84 | 88 | ||
| 85 | extern int bus_create_file(struct bus_type *, struct bus_attribute *); | 89 | extern int __must_check bus_create_file(struct bus_type *, |
| 90 | struct bus_attribute *); | ||
| 86 | extern void bus_remove_file(struct bus_type *, struct bus_attribute *); | 91 | extern void bus_remove_file(struct bus_type *, struct bus_attribute *); |
| 87 | 92 | ||
| 88 | struct device_driver { | 93 | struct device_driver { |
| @@ -101,16 +106,18 @@ struct device_driver { | |||
| 101 | void (*shutdown) (struct device * dev); | 106 | void (*shutdown) (struct device * dev); |
| 102 | int (*suspend) (struct device * dev, pm_message_t state); | 107 | int (*suspend) (struct device * dev, pm_message_t state); |
| 103 | int (*resume) (struct device * dev); | 108 | int (*resume) (struct device * dev); |
| 109 | |||
| 110 | unsigned int multithread_probe:1; | ||
| 104 | }; | 111 | }; |
| 105 | 112 | ||
| 106 | 113 | ||
| 107 | extern int driver_register(struct device_driver * drv); | 114 | extern int __must_check driver_register(struct device_driver * drv); |
| 108 | extern void driver_unregister(struct device_driver * drv); | 115 | extern void driver_unregister(struct device_driver * drv); |
| 109 | 116 | ||
| 110 | extern struct device_driver * get_driver(struct device_driver * drv); | 117 | extern struct device_driver * get_driver(struct device_driver * drv); |
| 111 | extern void put_driver(struct device_driver * drv); | 118 | extern void put_driver(struct device_driver * drv); |
| 112 | extern struct device_driver *driver_find(const char *name, struct bus_type *bus); | 119 | extern struct device_driver *driver_find(const char *name, struct bus_type *bus); |
| 113 | 120 | extern int driver_probe_done(void); | |
| 114 | 121 | ||
| 115 | /* driverfs interface for exporting driver attributes */ | 122 | /* driverfs interface for exporting driver attributes */ |
| 116 | 123 | ||
| @@ -123,16 +130,17 @@ struct driver_attribute { | |||
| 123 | #define DRIVER_ATTR(_name,_mode,_show,_store) \ | 130 | #define DRIVER_ATTR(_name,_mode,_show,_store) \ |
| 124 | struct driver_attribute driver_attr_##_name = __ATTR(_name,_mode,_show,_store) | 131 | struct driver_attribute driver_attr_##_name = __ATTR(_name,_mode,_show,_store) |
| 125 | 132 | ||
| 126 | extern int driver_create_file(struct device_driver *, struct driver_attribute *); | 133 | extern int __must_check driver_create_file(struct device_driver *, |
| 134 | struct driver_attribute *); | ||
| 127 | extern void driver_remove_file(struct device_driver *, struct driver_attribute *); | 135 | extern void driver_remove_file(struct device_driver *, struct driver_attribute *); |
| 128 | 136 | ||
| 129 | extern int driver_for_each_device(struct device_driver * drv, struct device * start, | 137 | extern int __must_check driver_for_each_device(struct device_driver * drv, |
| 130 | void * data, int (*fn)(struct device *, void *)); | 138 | struct device *start, void *data, |
| 139 | int (*fn)(struct device *, void *)); | ||
| 131 | struct device * driver_find_device(struct device_driver *drv, | 140 | struct device * driver_find_device(struct device_driver *drv, |
| 132 | struct device *start, void *data, | 141 | struct device *start, void *data, |
| 133 | int (*match)(struct device *, void *)); | 142 | int (*match)(struct device *, void *)); |
| 134 | 143 | ||
| 135 | |||
| 136 | /* | 144 | /* |
| 137 | * device classes | 145 | * device classes |
| 138 | */ | 146 | */ |
| @@ -146,17 +154,26 @@ struct class { | |||
| 146 | struct list_head interfaces; | 154 | struct list_head interfaces; |
| 147 | struct semaphore sem; /* locks both the children and interfaces lists */ | 155 | struct semaphore sem; /* locks both the children and interfaces lists */ |
| 148 | 156 | ||
| 157 | struct kobject *virtual_dir; | ||
| 158 | |||
| 149 | struct class_attribute * class_attrs; | 159 | struct class_attribute * class_attrs; |
| 150 | struct class_device_attribute * class_dev_attrs; | 160 | struct class_device_attribute * class_dev_attrs; |
| 161 | struct device_attribute * dev_attrs; | ||
| 151 | 162 | ||
| 152 | int (*uevent)(struct class_device *dev, char **envp, | 163 | int (*uevent)(struct class_device *dev, char **envp, |
| 153 | int num_envp, char *buffer, int buffer_size); | 164 | int num_envp, char *buffer, int buffer_size); |
| 165 | int (*dev_uevent)(struct device *dev, char **envp, int num_envp, | ||
| 166 | char *buffer, int buffer_size); | ||
| 154 | 167 | ||
| 155 | void (*release)(struct class_device *dev); | 168 | void (*release)(struct class_device *dev); |
| 156 | void (*class_release)(struct class *class); | 169 | void (*class_release)(struct class *class); |
| 170 | void (*dev_release)(struct device *dev); | ||
| 171 | |||
| 172 | int (*suspend)(struct device *, pm_message_t state); | ||
| 173 | int (*resume)(struct device *); | ||
| 157 | }; | 174 | }; |
| 158 | 175 | ||
| 159 | extern int class_register(struct class *); | 176 | extern int __must_check class_register(struct class *); |
| 160 | extern void class_unregister(struct class *); | 177 | extern void class_unregister(struct class *); |
| 161 | 178 | ||
| 162 | 179 | ||
| @@ -169,7 +186,8 @@ struct class_attribute { | |||
| 169 | #define CLASS_ATTR(_name,_mode,_show,_store) \ | 186 | #define CLASS_ATTR(_name,_mode,_show,_store) \ |
| 170 | struct class_attribute class_attr_##_name = __ATTR(_name,_mode,_show,_store) | 187 | struct class_attribute class_attr_##_name = __ATTR(_name,_mode,_show,_store) |
| 171 | 188 | ||
| 172 | extern int class_create_file(struct class *, const struct class_attribute *); | 189 | extern int __must_check class_create_file(struct class *, |
| 190 | const struct class_attribute *); | ||
| 173 | extern void class_remove_file(struct class *, const struct class_attribute *); | 191 | extern void class_remove_file(struct class *, const struct class_attribute *); |
| 174 | 192 | ||
| 175 | struct class_device_attribute { | 193 | struct class_device_attribute { |
| @@ -182,7 +200,7 @@ struct class_device_attribute { | |||
| 182 | struct class_device_attribute class_device_attr_##_name = \ | 200 | struct class_device_attribute class_device_attr_##_name = \ |
| 183 | __ATTR(_name,_mode,_show,_store) | 201 | __ATTR(_name,_mode,_show,_store) |
| 184 | 202 | ||
| 185 | extern int class_device_create_file(struct class_device *, | 203 | extern int __must_check class_device_create_file(struct class_device *, |
| 186 | const struct class_device_attribute *); | 204 | const struct class_device_attribute *); |
| 187 | 205 | ||
| 188 | /** | 206 | /** |
| @@ -242,10 +260,10 @@ class_set_devdata (struct class_device *dev, void *data) | |||
| 242 | } | 260 | } |
| 243 | 261 | ||
| 244 | 262 | ||
| 245 | extern int class_device_register(struct class_device *); | 263 | extern int __must_check class_device_register(struct class_device *); |
| 246 | extern void class_device_unregister(struct class_device *); | 264 | extern void class_device_unregister(struct class_device *); |
| 247 | extern void class_device_initialize(struct class_device *); | 265 | extern void class_device_initialize(struct class_device *); |
| 248 | extern int class_device_add(struct class_device *); | 266 | extern int __must_check class_device_add(struct class_device *); |
| 249 | extern void class_device_del(struct class_device *); | 267 | extern void class_device_del(struct class_device *); |
| 250 | 268 | ||
| 251 | extern int class_device_rename(struct class_device *, char *); | 269 | extern int class_device_rename(struct class_device *, char *); |
| @@ -255,7 +273,7 @@ extern void class_device_put(struct class_device *); | |||
| 255 | 273 | ||
| 256 | extern void class_device_remove_file(struct class_device *, | 274 | extern void class_device_remove_file(struct class_device *, |
| 257 | const struct class_device_attribute *); | 275 | const struct class_device_attribute *); |
| 258 | extern int class_device_create_bin_file(struct class_device *, | 276 | extern int __must_check class_device_create_bin_file(struct class_device *, |
| 259 | struct bin_attribute *); | 277 | struct bin_attribute *); |
| 260 | extern void class_device_remove_bin_file(struct class_device *, | 278 | extern void class_device_remove_bin_file(struct class_device *, |
| 261 | struct bin_attribute *); | 279 | struct bin_attribute *); |
| @@ -266,22 +284,23 @@ struct class_interface { | |||
| 266 | 284 | ||
| 267 | int (*add) (struct class_device *, struct class_interface *); | 285 | int (*add) (struct class_device *, struct class_interface *); |
| 268 | void (*remove) (struct class_device *, struct class_interface *); | 286 | void (*remove) (struct class_device *, struct class_interface *); |
| 287 | int (*add_dev) (struct device *, struct class_interface *); | ||
| 288 | void (*remove_dev) (struct device *, struct class_interface *); | ||
| 269 | }; | 289 | }; |
| 270 | 290 | ||
| 271 | extern int class_interface_register(struct class_interface *); | 291 | extern int __must_check class_interface_register(struct class_interface *); |
| 272 | extern void class_interface_unregister(struct class_interface *); | 292 | extern void class_interface_unregister(struct class_interface *); |
| 273 | 293 | ||
| 274 | extern struct class *class_create(struct module *owner, char *name); | 294 | extern struct class *class_create(struct module *owner, const char *name); |
| 275 | extern void class_destroy(struct class *cls); | 295 | extern void class_destroy(struct class *cls); |
| 276 | extern struct class_device *class_device_create(struct class *cls, | 296 | extern struct class_device *class_device_create(struct class *cls, |
| 277 | struct class_device *parent, | 297 | struct class_device *parent, |
| 278 | dev_t devt, | 298 | dev_t devt, |
| 279 | struct device *device, | 299 | struct device *device, |
| 280 | char *fmt, ...) | 300 | const char *fmt, ...) |
| 281 | __attribute__((format(printf,5,6))); | 301 | __attribute__((format(printf,5,6))); |
| 282 | extern void class_device_destroy(struct class *cls, dev_t devt); | 302 | extern void class_device_destroy(struct class *cls, dev_t devt); |
| 283 | 303 | ||
| 284 | |||
| 285 | /* interface for exporting device attributes */ | 304 | /* interface for exporting device attributes */ |
| 286 | struct device_attribute { | 305 | struct device_attribute { |
| 287 | struct attribute attr; | 306 | struct attribute attr; |
| @@ -294,8 +313,13 @@ struct device_attribute { | |||
| 294 | #define DEVICE_ATTR(_name,_mode,_show,_store) \ | 313 | #define DEVICE_ATTR(_name,_mode,_show,_store) \ |
| 295 | struct device_attribute dev_attr_##_name = __ATTR(_name,_mode,_show,_store) | 314 | struct device_attribute dev_attr_##_name = __ATTR(_name,_mode,_show,_store) |
| 296 | 315 | ||
| 297 | extern int device_create_file(struct device *device, struct device_attribute * entry); | 316 | extern int __must_check device_create_file(struct device *device, |
| 317 | struct device_attribute * entry); | ||
| 298 | extern void device_remove_file(struct device * dev, struct device_attribute * attr); | 318 | extern void device_remove_file(struct device * dev, struct device_attribute * attr); |
| 319 | extern int __must_check device_create_bin_file(struct device *dev, | ||
| 320 | struct bin_attribute *attr); | ||
| 321 | extern void device_remove_bin_file(struct device *dev, | ||
| 322 | struct bin_attribute *attr); | ||
| 299 | struct device { | 323 | struct device { |
| 300 | struct klist klist_children; | 324 | struct klist klist_children; |
| 301 | struct klist_node knode_parent; /* node in sibling list */ | 325 | struct klist_node knode_parent; /* node in sibling list */ |
| @@ -305,6 +329,7 @@ struct device { | |||
| 305 | 329 | ||
| 306 | struct kobject kobj; | 330 | struct kobject kobj; |
| 307 | char bus_id[BUS_ID_SIZE]; /* position on parent bus */ | 331 | char bus_id[BUS_ID_SIZE]; /* position on parent bus */ |
| 332 | unsigned is_registered:1; | ||
| 308 | struct device_attribute uevent_attr; | 333 | struct device_attribute uevent_attr; |
| 309 | struct device_attribute *devt_attr; | 334 | struct device_attribute *devt_attr; |
| 310 | 335 | ||
| @@ -338,6 +363,7 @@ struct device { | |||
| 338 | struct list_head node; | 363 | struct list_head node; |
| 339 | struct class *class; /* optional*/ | 364 | struct class *class; /* optional*/ |
| 340 | dev_t devt; /* dev_t, creates the sysfs "dev" */ | 365 | dev_t devt; /* dev_t, creates the sysfs "dev" */ |
| 366 | struct attribute_group **groups; /* optional groups */ | ||
| 341 | 367 | ||
| 342 | void (*release)(struct device * dev); | 368 | void (*release)(struct device * dev); |
| 343 | }; | 369 | }; |
| @@ -356,38 +382,41 @@ dev_set_drvdata (struct device *dev, void *data) | |||
| 356 | 382 | ||
| 357 | static inline int device_is_registered(struct device *dev) | 383 | static inline int device_is_registered(struct device *dev) |
| 358 | { | 384 | { |
| 359 | return klist_node_attached(&dev->knode_bus); | 385 | return dev->is_registered; |
| 360 | } | 386 | } |
| 361 | 387 | ||
| 362 | /* | 388 | /* |
| 363 | * High level routines for use by the bus drivers | 389 | * High level routines for use by the bus drivers |
| 364 | */ | 390 | */ |
| 365 | extern int device_register(struct device * dev); | 391 | extern int __must_check device_register(struct device * dev); |
| 366 | extern void device_unregister(struct device * dev); | 392 | extern void device_unregister(struct device * dev); |
| 367 | extern void device_initialize(struct device * dev); | 393 | extern void device_initialize(struct device * dev); |
| 368 | extern int device_add(struct device * dev); | 394 | extern int __must_check device_add(struct device * dev); |
| 369 | extern void device_del(struct device * dev); | 395 | extern void device_del(struct device * dev); |
| 370 | extern int device_for_each_child(struct device *, void *, | 396 | extern int __must_check device_for_each_child(struct device *, void *, |
| 371 | int (*fn)(struct device *, void *)); | 397 | int (*fn)(struct device *, void *)); |
| 398 | extern int device_rename(struct device *dev, char *new_name); | ||
| 372 | 399 | ||
| 373 | /* | 400 | /* |
| 374 | * Manual binding of a device to driver. See drivers/base/bus.c | 401 | * Manual binding of a device to driver. See drivers/base/bus.c |
| 375 | * for information on use. | 402 | * for information on use. |
| 376 | */ | 403 | */ |
| 377 | extern void device_bind_driver(struct device * dev); | 404 | extern int __must_check device_bind_driver(struct device *dev); |
| 378 | extern void device_release_driver(struct device * dev); | 405 | extern void device_release_driver(struct device * dev); |
| 379 | extern int device_attach(struct device * dev); | 406 | extern int __must_check device_attach(struct device * dev); |
| 380 | extern void driver_attach(struct device_driver * drv); | 407 | extern int __must_check driver_attach(struct device_driver *drv); |
| 381 | extern void device_reprobe(struct device *dev); | 408 | extern int __must_check device_reprobe(struct device *dev); |
| 382 | 409 | ||
| 383 | /* | 410 | /* |
| 384 | * Easy functions for dynamically creating devices on the fly | 411 | * Easy functions for dynamically creating devices on the fly |
| 385 | */ | 412 | */ |
| 386 | extern struct device *device_create(struct class *cls, struct device *parent, | 413 | extern struct device *device_create(struct class *cls, struct device *parent, |
| 387 | dev_t devt, char *fmt, ...) | 414 | dev_t devt, const char *fmt, ...) |
| 388 | __attribute__((format(printf,4,5))); | 415 | __attribute__((format(printf,4,5))); |
| 389 | extern void device_destroy(struct class *cls, dev_t devt); | 416 | extern void device_destroy(struct class *cls, dev_t devt); |
| 390 | 417 | ||
| 418 | extern int virtual_device_parent(struct device *dev); | ||
| 419 | |||
| 391 | /* | 420 | /* |
| 392 | * Platform "fixup" functions - allow the platform to have their say | 421 | * Platform "fixup" functions - allow the platform to have their say |
| 393 | * about devices and actions that the general device layer doesn't | 422 | * about devices and actions that the general device layer doesn't |
| @@ -412,7 +441,7 @@ extern void device_shutdown(void); | |||
| 412 | 441 | ||
| 413 | 442 | ||
| 414 | /* drivers/base/firmware.c */ | 443 | /* drivers/base/firmware.c */ |
| 415 | extern int firmware_register(struct subsystem *); | 444 | extern int __must_check firmware_register(struct subsystem *); |
| 416 | extern void firmware_unregister(struct subsystem *); | 445 | extern void firmware_unregister(struct subsystem *); |
| 417 | 446 | ||
| 418 | /* debugging and troubleshooting/diagnostic helpers. */ | 447 | /* debugging and troubleshooting/diagnostic helpers. */ |
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index 635690cf3e..ff203c465f 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h | |||
| @@ -24,6 +24,13 @@ enum dma_data_direction { | |||
| 24 | #define DMA_28BIT_MASK 0x000000000fffffffULL | 24 | #define DMA_28BIT_MASK 0x000000000fffffffULL |
| 25 | #define DMA_24BIT_MASK 0x0000000000ffffffULL | 25 | #define DMA_24BIT_MASK 0x0000000000ffffffULL |
| 26 | 26 | ||
| 27 | static inline int valid_dma_direction(int dma_direction) | ||
| 28 | { | ||
| 29 | return ((dma_direction == DMA_BIDIRECTIONAL) || | ||
| 30 | (dma_direction == DMA_TO_DEVICE) || | ||
| 31 | (dma_direction == DMA_FROM_DEVICE)); | ||
| 32 | } | ||
| 33 | |||
| 27 | #include <asm/dma-mapping.h> | 34 | #include <asm/dma-mapping.h> |
| 28 | 35 | ||
| 29 | /* Backwards compat, remove in 2.7.x */ | 36 | /* Backwards compat, remove in 2.7.x */ |
diff --git a/include/linux/dmi.h b/include/linux/dmi.h index b2cd2071d4..38dc403be7 100644 --- a/include/linux/dmi.h +++ b/include/linux/dmi.h | |||
| @@ -27,7 +27,8 @@ enum dmi_device_type { | |||
| 27 | DMI_DEV_TYPE_ETHERNET, | 27 | DMI_DEV_TYPE_ETHERNET, |
| 28 | DMI_DEV_TYPE_TOKENRING, | 28 | DMI_DEV_TYPE_TOKENRING, |
| 29 | DMI_DEV_TYPE_SOUND, | 29 | DMI_DEV_TYPE_SOUND, |
| 30 | DMI_DEV_TYPE_IPMI = -1 | 30 | DMI_DEV_TYPE_IPMI = -1, |
| 31 | DMI_DEV_TYPE_OEM_STRING = -2 | ||
| 31 | }; | 32 | }; |
| 32 | 33 | ||
| 33 | struct dmi_header { | 34 | struct dmi_header { |
diff --git a/include/linux/dvb/Kbuild b/include/linux/dvb/Kbuild index 63973af72f..d97b3a51e2 100644 --- a/include/linux/dvb/Kbuild +++ b/include/linux/dvb/Kbuild | |||
| @@ -1,2 +1,9 @@ | |||
| 1 | header-y += ca.h frontend.h net.h osd.h version.h | 1 | header-y += ca.h |
| 2 | unifdef-y := audio.h dmx.h video.h | 2 | header-y += frontend.h |
| 3 | header-y += net.h | ||
| 4 | header-y += osd.h | ||
| 5 | header-y += version.h | ||
| 6 | |||
| 7 | unifdef-y += audio.h | ||
| 8 | unifdef-y += dmx.h | ||
| 9 | unifdef-y += video.h | ||
diff --git a/include/linux/edd.h b/include/linux/edd.h index 162512b886..b2b3e68aa5 100644 --- a/include/linux/edd.h +++ b/include/linux/edd.h | |||
| @@ -52,6 +52,7 @@ | |||
| 52 | #define EDD_CL_EQUALS 0x3d646465 /* "edd=" */ | 52 | #define EDD_CL_EQUALS 0x3d646465 /* "edd=" */ |
| 53 | #define EDD_CL_OFF 0x666f /* "of" for off */ | 53 | #define EDD_CL_OFF 0x666f /* "of" for off */ |
| 54 | #define EDD_CL_SKIP 0x6b73 /* "sk" for skipmbr */ | 54 | #define EDD_CL_SKIP 0x6b73 /* "sk" for skipmbr */ |
| 55 | #define EDD_CL_ON 0x6e6f /* "on" for on */ | ||
| 55 | 56 | ||
| 56 | #ifndef __ASSEMBLY__ | 57 | #ifndef __ASSEMBLY__ |
| 57 | 58 | ||
diff --git a/include/linux/efs_fs_sb.h b/include/linux/efs_fs_sb.h index c76088baef..ff1945e377 100644 --- a/include/linux/efs_fs_sb.h +++ b/include/linux/efs_fs_sb.h | |||
| @@ -9,8 +9,7 @@ | |||
| 9 | #ifndef __EFS_FS_SB_H__ | 9 | #ifndef __EFS_FS_SB_H__ |
| 10 | #define __EFS_FS_SB_H__ | 10 | #define __EFS_FS_SB_H__ |
| 11 | 11 | ||
| 12 | /* statfs() magic number for EFS */ | 12 | #include <linux/magic.h> |
| 13 | #define EFS_SUPER_MAGIC 0x414A53 | ||
| 14 | 13 | ||
| 15 | /* EFS superblock magic numbers */ | 14 | /* EFS superblock magic numbers */ |
| 16 | #define EFS_MAGIC 0x072959 | 15 | #define EFS_MAGIC 0x072959 |
diff --git a/include/linux/eisa.h b/include/linux/eisa.h index 4079242dce..1ff7c13925 100644 --- a/include/linux/eisa.h +++ b/include/linux/eisa.h | |||
| @@ -3,8 +3,8 @@ | |||
| 3 | 3 | ||
| 4 | #include <linux/ioport.h> | 4 | #include <linux/ioport.h> |
| 5 | #include <linux/device.h> | 5 | #include <linux/device.h> |
| 6 | #include <linux/mod_devicetable.h> | ||
| 6 | 7 | ||
| 7 | #define EISA_SIG_LEN 8 | ||
| 8 | #define EISA_MAX_SLOTS 8 | 8 | #define EISA_MAX_SLOTS 8 |
| 9 | 9 | ||
| 10 | #define EISA_MAX_RESOURCES 4 | 10 | #define EISA_MAX_RESOURCES 4 |
| @@ -27,12 +27,6 @@ | |||
| 27 | #define EISA_CONFIG_ENABLED 1 | 27 | #define EISA_CONFIG_ENABLED 1 |
| 28 | #define EISA_CONFIG_FORCED 2 | 28 | #define EISA_CONFIG_FORCED 2 |
| 29 | 29 | ||
| 30 | /* The EISA signature, in ASCII form, null terminated */ | ||
| 31 | struct eisa_device_id { | ||
| 32 | char sig[EISA_SIG_LEN]; | ||
| 33 | unsigned long driver_data; | ||
| 34 | }; | ||
| 35 | |||
| 36 | /* There is not much we can say about an EISA device, apart from | 30 | /* There is not much we can say about an EISA device, apart from |
| 37 | * signature, slot number, and base address. dma_mask is set by | 31 | * signature, slot number, and base address. dma_mask is set by |
| 38 | * default to parent device mask..*/ | 32 | * default to parent device mask..*/ |
diff --git a/include/linux/elevator.h b/include/linux/elevator.h index 1713ace808..b3370ef516 100644 --- a/include/linux/elevator.h +++ b/include/linux/elevator.h | |||
| @@ -1,12 +1,16 @@ | |||
| 1 | #ifndef _LINUX_ELEVATOR_H | 1 | #ifndef _LINUX_ELEVATOR_H |
| 2 | #define _LINUX_ELEVATOR_H | 2 | #define _LINUX_ELEVATOR_H |
| 3 | 3 | ||
| 4 | #include <linux/percpu.h> | ||
| 5 | |||
| 6 | #ifdef CONFIG_BLOCK | ||
| 7 | |||
| 4 | typedef int (elevator_merge_fn) (request_queue_t *, struct request **, | 8 | typedef int (elevator_merge_fn) (request_queue_t *, struct request **, |
| 5 | struct bio *); | 9 | struct bio *); |
| 6 | 10 | ||
| 7 | typedef void (elevator_merge_req_fn) (request_queue_t *, struct request *, struct request *); | 11 | typedef void (elevator_merge_req_fn) (request_queue_t *, struct request *, struct request *); |
| 8 | 12 | ||
| 9 | typedef void (elevator_merged_fn) (request_queue_t *, struct request *); | 13 | typedef void (elevator_merged_fn) (request_queue_t *, struct request *, int); |
| 10 | 14 | ||
| 11 | typedef int (elevator_dispatch_fn) (request_queue_t *, int); | 15 | typedef int (elevator_dispatch_fn) (request_queue_t *, int); |
| 12 | 16 | ||
| @@ -14,9 +18,9 @@ typedef void (elevator_add_req_fn) (request_queue_t *, struct request *); | |||
| 14 | typedef int (elevator_queue_empty_fn) (request_queue_t *); | 18 | typedef int (elevator_queue_empty_fn) (request_queue_t *); |
| 15 | typedef struct request *(elevator_request_list_fn) (request_queue_t *, struct request *); | 19 | typedef struct request *(elevator_request_list_fn) (request_queue_t *, struct request *); |
| 16 | typedef void (elevator_completed_req_fn) (request_queue_t *, struct request *); | 20 | typedef void (elevator_completed_req_fn) (request_queue_t *, struct request *); |
| 17 | typedef int (elevator_may_queue_fn) (request_queue_t *, int, struct bio *); | 21 | typedef int (elevator_may_queue_fn) (request_queue_t *, int); |
| 18 | 22 | ||
| 19 | typedef int (elevator_set_req_fn) (request_queue_t *, struct request *, struct bio *, gfp_t); | 23 | typedef int (elevator_set_req_fn) (request_queue_t *, struct request *, gfp_t); |
| 20 | typedef void (elevator_put_req_fn) (request_queue_t *, struct request *); | 24 | typedef void (elevator_put_req_fn) (request_queue_t *, struct request *); |
| 21 | typedef void (elevator_activate_req_fn) (request_queue_t *, struct request *); | 25 | typedef void (elevator_activate_req_fn) (request_queue_t *, struct request *); |
| 22 | typedef void (elevator_deactivate_req_fn) (request_queue_t *, struct request *); | 26 | typedef void (elevator_deactivate_req_fn) (request_queue_t *, struct request *); |
| @@ -82,19 +86,21 @@ struct elevator_queue | |||
| 82 | struct kobject kobj; | 86 | struct kobject kobj; |
| 83 | struct elevator_type *elevator_type; | 87 | struct elevator_type *elevator_type; |
| 84 | struct mutex sysfs_lock; | 88 | struct mutex sysfs_lock; |
| 89 | struct hlist_head *hash; | ||
| 85 | }; | 90 | }; |
| 86 | 91 | ||
| 87 | /* | 92 | /* |
| 88 | * block elevator interface | 93 | * block elevator interface |
| 89 | */ | 94 | */ |
| 90 | extern void elv_dispatch_sort(request_queue_t *, struct request *); | 95 | extern void elv_dispatch_sort(request_queue_t *, struct request *); |
| 96 | extern void elv_dispatch_add_tail(request_queue_t *, struct request *); | ||
| 91 | extern void elv_add_request(request_queue_t *, struct request *, int, int); | 97 | extern void elv_add_request(request_queue_t *, struct request *, int, int); |
| 92 | extern void __elv_add_request(request_queue_t *, struct request *, int, int); | 98 | extern void __elv_add_request(request_queue_t *, struct request *, int, int); |
| 93 | extern void elv_insert(request_queue_t *, struct request *, int); | 99 | extern void elv_insert(request_queue_t *, struct request *, int); |
| 94 | extern int elv_merge(request_queue_t *, struct request **, struct bio *); | 100 | extern int elv_merge(request_queue_t *, struct request **, struct bio *); |
| 95 | extern void elv_merge_requests(request_queue_t *, struct request *, | 101 | extern void elv_merge_requests(request_queue_t *, struct request *, |
| 96 | struct request *); | 102 | struct request *); |
| 97 | extern void elv_merged_request(request_queue_t *, struct request *); | 103 | extern void elv_merged_request(request_queue_t *, struct request *, int); |
| 98 | extern void elv_dequeue_request(request_queue_t *, struct request *); | 104 | extern void elv_dequeue_request(request_queue_t *, struct request *); |
| 99 | extern void elv_requeue_request(request_queue_t *, struct request *); | 105 | extern void elv_requeue_request(request_queue_t *, struct request *); |
| 100 | extern int elv_queue_empty(request_queue_t *); | 106 | extern int elv_queue_empty(request_queue_t *); |
| @@ -103,9 +109,9 @@ extern struct request *elv_former_request(request_queue_t *, struct request *); | |||
| 103 | extern struct request *elv_latter_request(request_queue_t *, struct request *); | 109 | extern struct request *elv_latter_request(request_queue_t *, struct request *); |
| 104 | extern int elv_register_queue(request_queue_t *q); | 110 | extern int elv_register_queue(request_queue_t *q); |
| 105 | extern void elv_unregister_queue(request_queue_t *q); | 111 | extern void elv_unregister_queue(request_queue_t *q); |
| 106 | extern int elv_may_queue(request_queue_t *, int, struct bio *); | 112 | extern int elv_may_queue(request_queue_t *, int); |
| 107 | extern void elv_completed_request(request_queue_t *, struct request *); | 113 | extern void elv_completed_request(request_queue_t *, struct request *); |
| 108 | extern int elv_set_request(request_queue_t *, struct request *, struct bio *, gfp_t); | 114 | extern int elv_set_request(request_queue_t *, struct request *, gfp_t); |
| 109 | extern void elv_put_request(request_queue_t *, struct request *); | 115 | extern void elv_put_request(request_queue_t *, struct request *); |
| 110 | 116 | ||
| 111 | /* | 117 | /* |
| @@ -125,6 +131,19 @@ extern void elevator_exit(elevator_t *); | |||
| 125 | extern int elv_rq_merge_ok(struct request *, struct bio *); | 131 | extern int elv_rq_merge_ok(struct request *, struct bio *); |
| 126 | 132 | ||
| 127 | /* | 133 | /* |
| 134 | * Helper functions. | ||
| 135 | */ | ||
| 136 | extern struct request *elv_rb_former_request(request_queue_t *, struct request *); | ||
| 137 | extern struct request *elv_rb_latter_request(request_queue_t *, struct request *); | ||
| 138 | |||
| 139 | /* | ||
| 140 | * rb support functions. | ||
| 141 | */ | ||
| 142 | extern struct request *elv_rb_add(struct rb_root *, struct request *); | ||
| 143 | extern void elv_rb_del(struct rb_root *, struct request *); | ||
| 144 | extern struct request *elv_rb_find(struct rb_root *, sector_t); | ||
| 145 | |||
| 146 | /* | ||
| 128 | * Return values from elevator merger | 147 | * Return values from elevator merger |
| 129 | */ | 148 | */ |
| 130 | #define ELEVATOR_NO_MERGE 0 | 149 | #define ELEVATOR_NO_MERGE 0 |
| @@ -149,5 +168,42 @@ enum { | |||
| 149 | }; | 168 | }; |
| 150 | 169 | ||
| 151 | #define rq_end_sector(rq) ((rq)->sector + (rq)->nr_sectors) | 170 | #define rq_end_sector(rq) ((rq)->sector + (rq)->nr_sectors) |
| 171 | #define rb_entry_rq(node) rb_entry((node), struct request, rb_node) | ||
| 172 | |||
| 173 | /* | ||
| 174 | * Hack to reuse the donelist list_head as the fifo time holder while | ||
| 175 | * the request is in the io scheduler. Saves an unsigned long in rq. | ||
| 176 | */ | ||
| 177 | #define rq_fifo_time(rq) ((unsigned long) (rq)->donelist.next) | ||
| 178 | #define rq_set_fifo_time(rq,exp) ((rq)->donelist.next = (void *) (exp)) | ||
| 179 | #define rq_entry_fifo(ptr) list_entry((ptr), struct request, queuelist) | ||
| 180 | #define rq_fifo_clear(rq) do { \ | ||
| 181 | list_del_init(&(rq)->queuelist); \ | ||
| 182 | INIT_LIST_HEAD(&(rq)->donelist); \ | ||
| 183 | } while (0) | ||
| 152 | 184 | ||
| 185 | /* | ||
| 186 | * io context count accounting | ||
| 187 | */ | ||
| 188 | #define elv_ioc_count_mod(name, __val) \ | ||
| 189 | do { \ | ||
| 190 | preempt_disable(); \ | ||
| 191 | __get_cpu_var(name) += (__val); \ | ||
| 192 | preempt_enable(); \ | ||
| 193 | } while (0) | ||
| 194 | |||
| 195 | #define elv_ioc_count_inc(name) elv_ioc_count_mod(name, 1) | ||
| 196 | #define elv_ioc_count_dec(name) elv_ioc_count_mod(name, -1) | ||
| 197 | |||
| 198 | #define elv_ioc_count_read(name) \ | ||
| 199 | ({ \ | ||
| 200 | unsigned long __val = 0; \ | ||
| 201 | int __cpu; \ | ||
| 202 | smp_wmb(); \ | ||
| 203 | for_each_possible_cpu(__cpu) \ | ||
| 204 | __val += per_cpu(name, __cpu); \ | ||
| 205 | __val; \ | ||
| 206 | }) | ||
| 207 | |||
| 208 | #endif /* CONFIG_BLOCK */ | ||
| 153 | #endif | 209 | #endif |
diff --git a/include/linux/elf-em.h b/include/linux/elf-em.h index 6a5796c81c..666e0a5f00 100644 --- a/include/linux/elf-em.h +++ b/include/linux/elf-em.h | |||
| @@ -31,6 +31,7 @@ | |||
| 31 | #define EM_M32R 88 /* Renesas M32R */ | 31 | #define EM_M32R 88 /* Renesas M32R */ |
| 32 | #define EM_H8_300 46 /* Renesas H8/300,300H,H8S */ | 32 | #define EM_H8_300 46 /* Renesas H8/300,300H,H8S */ |
| 33 | #define EM_FRV 0x5441 /* Fujitsu FR-V */ | 33 | #define EM_FRV 0x5441 /* Fujitsu FR-V */ |
| 34 | #define EM_AVR32 0x18ad /* Atmel AVR32 */ | ||
| 34 | 35 | ||
| 35 | /* | 36 | /* |
| 36 | * This is an interim value that we will use until the committee comes | 37 | * This is an interim value that we will use until the committee comes |
diff --git a/include/linux/elfnote.h b/include/linux/elfnote.h new file mode 100644 index 0000000000..67396db141 --- /dev/null +++ b/include/linux/elfnote.h | |||
| @@ -0,0 +1,90 @@ | |||
| 1 | #ifndef _LINUX_ELFNOTE_H | ||
| 2 | #define _LINUX_ELFNOTE_H | ||
| 3 | /* | ||
| 4 | * Helper macros to generate ELF Note structures, which are put into a | ||
| 5 | * PT_NOTE segment of the final vmlinux image. These are useful for | ||
| 6 | * including name-value pairs of metadata into the kernel binary (or | ||
| 7 | * modules?) for use by external programs. | ||
| 8 | * | ||
| 9 | * Each note has three parts: a name, a type and a desc. The name is | ||
| 10 | * intended to distinguish the note's originator, so it would be a | ||
| 11 | * company, project, subsystem, etc; it must be in a suitable form for | ||
| 12 | * use in a section name. The type is an integer which is used to tag | ||
| 13 | * the data, and is considered to be within the "name" namespace (so | ||
| 14 | * "FooCo"'s type 42 is distinct from "BarProj"'s type 42). The | ||
| 15 | * "desc" field is the actual data. There are no constraints on the | ||
| 16 | * desc field's contents, though typically they're fairly small. | ||
| 17 | * | ||
| 18 | * All notes from a given NAME are put into a section named | ||
| 19 | * .note.NAME. When the kernel image is finally linked, all the notes | ||
| 20 | * are packed into a single .notes section, which is mapped into the | ||
| 21 | * PT_NOTE segment. Because notes for a given name are grouped into | ||
| 22 | * the same section, they'll all be adjacent the output file. | ||
| 23 | * | ||
| 24 | * This file defines macros for both C and assembler use. Their | ||
| 25 | * syntax is slightly different, but they're semantically similar. | ||
| 26 | * | ||
| 27 | * See the ELF specification for more detail about ELF notes. | ||
| 28 | */ | ||
| 29 | |||
| 30 | #ifdef __ASSEMBLER__ | ||
| 31 | /* | ||
| 32 | * Generate a structure with the same shape as Elf{32,64}_Nhdr (which | ||
| 33 | * turn out to be the same size and shape), followed by the name and | ||
| 34 | * desc data with appropriate padding. The 'desctype' argument is the | ||
| 35 | * assembler pseudo op defining the type of the data e.g. .asciz while | ||
| 36 | * 'descdata' is the data itself e.g. "hello, world". | ||
| 37 | * | ||
| 38 | * e.g. ELFNOTE(XYZCo, 42, .asciz, "forty-two") | ||
| 39 | * ELFNOTE(XYZCo, 12, .long, 0xdeadbeef) | ||
| 40 | */ | ||
| 41 | #define ELFNOTE(name, type, desctype, descdata) \ | ||
| 42 | .pushsection .note.name ; \ | ||
| 43 | .align 4 ; \ | ||
| 44 | .long 2f - 1f /* namesz */ ; \ | ||
| 45 | .long 4f - 3f /* descsz */ ; \ | ||
| 46 | .long type ; \ | ||
| 47 | 1:.asciz "name" ; \ | ||
| 48 | 2:.align 4 ; \ | ||
| 49 | 3:desctype descdata ; \ | ||
| 50 | 4:.align 4 ; \ | ||
| 51 | .popsection ; | ||
| 52 | #else /* !__ASSEMBLER__ */ | ||
| 53 | #include <linux/elf.h> | ||
| 54 | /* | ||
| 55 | * Use an anonymous structure which matches the shape of | ||
| 56 | * Elf{32,64}_Nhdr, but includes the name and desc data. The size and | ||
| 57 | * type of name and desc depend on the macro arguments. "name" must | ||
| 58 | * be a literal string, and "desc" must be passed by value. You may | ||
| 59 | * only define one note per line, since __LINE__ is used to generate | ||
| 60 | * unique symbols. | ||
| 61 | */ | ||
| 62 | #define _ELFNOTE_PASTE(a,b) a##b | ||
| 63 | #define _ELFNOTE(size, name, unique, type, desc) \ | ||
| 64 | static const struct { \ | ||
| 65 | struct elf##size##_note _nhdr; \ | ||
| 66 | unsigned char _name[sizeof(name)] \ | ||
| 67 | __attribute__((aligned(sizeof(Elf##size##_Word)))); \ | ||
| 68 | typeof(desc) _desc \ | ||
| 69 | __attribute__((aligned(sizeof(Elf##size##_Word)))); \ | ||
| 70 | } _ELFNOTE_PASTE(_note_, unique) \ | ||
| 71 | __attribute_used__ \ | ||
| 72 | __attribute__((section(".note." name), \ | ||
| 73 | aligned(sizeof(Elf##size##_Word)), \ | ||
| 74 | unused)) = { \ | ||
| 75 | { \ | ||
| 76 | sizeof(name), \ | ||
| 77 | sizeof(desc), \ | ||
| 78 | type, \ | ||
| 79 | }, \ | ||
| 80 | name, \ | ||
| 81 | desc \ | ||
| 82 | } | ||
| 83 | #define ELFNOTE(size, name, type, desc) \ | ||
| 84 | _ELFNOTE(size, name, __LINE__, type, desc) | ||
| 85 | |||
| 86 | #define ELFNOTE32(name, type, desc) ELFNOTE(32, name, type, desc) | ||
| 87 | #define ELFNOTE64(name, type, desc) ELFNOTE(64, name, type, desc) | ||
| 88 | #endif /* __ASSEMBLER__ */ | ||
| 89 | |||
| 90 | #endif /* _LINUX_ELFNOTE_H */ | ||
diff --git a/include/linux/err.h b/include/linux/err.h index cd3b367f74..1ab1d44f8d 100644 --- a/include/linux/err.h +++ b/include/linux/err.h | |||
| @@ -15,6 +15,8 @@ | |||
| 15 | */ | 15 | */ |
| 16 | #define MAX_ERRNO 4095 | 16 | #define MAX_ERRNO 4095 |
| 17 | 17 | ||
| 18 | #ifndef __ASSEMBLY__ | ||
| 19 | |||
| 18 | #define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO) | 20 | #define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO) |
| 19 | 21 | ||
| 20 | static inline void *ERR_PTR(long error) | 22 | static inline void *ERR_PTR(long error) |
| @@ -32,4 +34,6 @@ static inline long IS_ERR(const void *ptr) | |||
| 32 | return IS_ERR_VALUE((unsigned long)ptr); | 34 | return IS_ERR_VALUE((unsigned long)ptr); |
| 33 | } | 35 | } |
| 34 | 36 | ||
| 37 | #endif | ||
| 38 | |||
| 35 | #endif /* _LINUX_ERR_H */ | 39 | #endif /* _LINUX_ERR_H */ |
diff --git a/include/linux/errqueue.h b/include/linux/errqueue.h index 408118a077..92f8d4fab3 100644 --- a/include/linux/errqueue.h +++ b/include/linux/errqueue.h | |||
| @@ -38,7 +38,7 @@ struct sock_exterr_skb | |||
| 38 | } header; | 38 | } header; |
| 39 | struct sock_extended_err ee; | 39 | struct sock_extended_err ee; |
| 40 | u16 addr_offset; | 40 | u16 addr_offset; |
| 41 | u16 port; | 41 | __be16 port; |
| 42 | }; | 42 | }; |
| 43 | 43 | ||
| 44 | #endif | 44 | #endif |
diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h index facf34e989..153d755376 100644 --- a/include/linux/ext2_fs.h +++ b/include/linux/ext2_fs.h | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | #define _LINUX_EXT2_FS_H | 17 | #define _LINUX_EXT2_FS_H |
| 18 | 18 | ||
| 19 | #include <linux/types.h> | 19 | #include <linux/types.h> |
| 20 | #include <linux/magic.h> | ||
| 20 | 21 | ||
| 21 | /* | 22 | /* |
| 22 | * The second extended filesystem constants/structures | 23 | * The second extended filesystem constants/structures |
| @@ -63,11 +64,6 @@ | |||
| 63 | /* First non-reserved inode for old ext2 filesystems */ | 64 | /* First non-reserved inode for old ext2 filesystems */ |
| 64 | #define EXT2_GOOD_OLD_FIRST_INO 11 | 65 | #define EXT2_GOOD_OLD_FIRST_INO 11 |
| 65 | 66 | ||
| 66 | /* | ||
| 67 | * The second extended file system magic number | ||
| 68 | */ | ||
| 69 | #define EXT2_SUPER_MAGIC 0xEF53 | ||
| 70 | |||
| 71 | #ifdef __KERNEL__ | 67 | #ifdef __KERNEL__ |
| 72 | #include <linux/ext2_fs_sb.h> | 68 | #include <linux/ext2_fs_sb.h> |
| 73 | static inline struct ext2_sb_info *EXT2_SB(struct super_block *sb) | 69 | static inline struct ext2_sb_info *EXT2_SB(struct super_block *sb) |
| @@ -169,41 +165,49 @@ struct ext2_group_desc | |||
| 169 | #define EXT2_N_BLOCKS (EXT2_TIND_BLOCK + 1) | 165 | #define EXT2_N_BLOCKS (EXT2_TIND_BLOCK + 1) |
| 170 | 166 | ||
| 171 | /* | 167 | /* |
| 172 | * Inode flags | 168 | * Inode flags (GETFLAGS/SETFLAGS) |
| 173 | */ | 169 | */ |
| 174 | #define EXT2_SECRM_FL 0x00000001 /* Secure deletion */ | 170 | #define EXT2_SECRM_FL FS_SECRM_FL /* Secure deletion */ |
| 175 | #define EXT2_UNRM_FL 0x00000002 /* Undelete */ | 171 | #define EXT2_UNRM_FL FS_UNRM_FL /* Undelete */ |
| 176 | #define EXT2_COMPR_FL 0x00000004 /* Compress file */ | 172 | #define EXT2_COMPR_FL FS_COMPR_FL /* Compress file */ |
| 177 | #define EXT2_SYNC_FL 0x00000008 /* Synchronous updates */ | 173 | #define EXT2_SYNC_FL FS_SYNC_FL /* Synchronous updates */ |
| 178 | #define EXT2_IMMUTABLE_FL 0x00000010 /* Immutable file */ | 174 | #define EXT2_IMMUTABLE_FL FS_IMMUTABLE_FL /* Immutable file */ |
| 179 | #define EXT2_APPEND_FL 0x00000020 /* writes to file may only append */ | 175 | #define EXT2_APPEND_FL FS_APPEND_FL /* writes to file may only append */ |
| 180 | #define EXT2_NODUMP_FL 0x00000040 /* do not dump file */ | 176 | #define EXT2_NODUMP_FL FS_NODUMP_FL /* do not dump file */ |
| 181 | #define EXT2_NOATIME_FL 0x00000080 /* do not update atime */ | 177 | #define EXT2_NOATIME_FL FS_NOATIME_FL /* do not update atime */ |
| 182 | /* Reserved for compression usage... */ | 178 | /* Reserved for compression usage... */ |
| 183 | #define EXT2_DIRTY_FL 0x00000100 | 179 | #define EXT2_DIRTY_FL FS_DIRTY_FL |
| 184 | #define EXT2_COMPRBLK_FL 0x00000200 /* One or more compressed clusters */ | 180 | #define EXT2_COMPRBLK_FL FS_COMPRBLK_FL /* One or more compressed clusters */ |
| 185 | #define EXT2_NOCOMP_FL 0x00000400 /* Don't compress */ | 181 | #define EXT2_NOCOMP_FL FS_NOCOMP_FL /* Don't compress */ |
| 186 | #define EXT2_ECOMPR_FL 0x00000800 /* Compression error */ | 182 | #define EXT2_ECOMPR_FL FS_ECOMPR_FL /* Compression error */ |
| 187 | /* End compression flags --- maybe not all used */ | 183 | /* End compression flags --- maybe not all used */ |
| 188 | #define EXT2_BTREE_FL 0x00001000 /* btree format dir */ | 184 | #define EXT2_BTREE_FL FS_BTREE_FL /* btree format dir */ |
| 189 | #define EXT2_INDEX_FL 0x00001000 /* hash-indexed directory */ | 185 | #define EXT2_INDEX_FL FS_INDEX_FL /* hash-indexed directory */ |
| 190 | #define EXT2_IMAGIC_FL 0x00002000 /* AFS directory */ | 186 | #define EXT2_IMAGIC_FL FS_IMAGIC_FL /* AFS directory */ |
| 191 | #define EXT2_JOURNAL_DATA_FL 0x00004000 /* Reserved for ext3 */ | 187 | #define EXT2_JOURNAL_DATA_FL FS_JOURNAL_DATA_FL /* Reserved for ext3 */ |
| 192 | #define EXT2_NOTAIL_FL 0x00008000 /* file tail should not be merged */ | 188 | #define EXT2_NOTAIL_FL FS_NOTAIL_FL /* file tail should not be merged */ |
| 193 | #define EXT2_DIRSYNC_FL 0x00010000 /* dirsync behaviour (directories only) */ | 189 | #define EXT2_DIRSYNC_FL FS_DIRSYNC_FL /* dirsync behaviour (directories only) */ |
| 194 | #define EXT2_TOPDIR_FL 0x00020000 /* Top of directory hierarchies*/ | 190 | #define EXT2_TOPDIR_FL FS_TOPDIR_FL /* Top of directory hierarchies*/ |
| 195 | #define EXT2_RESERVED_FL 0x80000000 /* reserved for ext2 lib */ | 191 | #define EXT2_RESERVED_FL FS_RESERVED_FL /* reserved for ext2 lib */ |
| 196 | 192 | ||
| 197 | #define EXT2_FL_USER_VISIBLE 0x0003DFFF /* User visible flags */ | 193 | #define EXT2_FL_USER_VISIBLE FS_FL_USER_VISIBLE /* User visible flags */ |
| 198 | #define EXT2_FL_USER_MODIFIABLE 0x000380FF /* User modifiable flags */ | 194 | #define EXT2_FL_USER_MODIFIABLE FS_FL_USER_MODIFIABLE /* User modifiable flags */ |
| 199 | 195 | ||
| 200 | /* | 196 | /* |
| 201 | * ioctl commands | 197 | * ioctl commands |
| 202 | */ | 198 | */ |
| 203 | #define EXT2_IOC_GETFLAGS _IOR('f', 1, long) | 199 | #define EXT2_IOC_GETFLAGS FS_IOC_GETFLAGS |
| 204 | #define EXT2_IOC_SETFLAGS _IOW('f', 2, long) | 200 | #define EXT2_IOC_SETFLAGS FS_IOC_SETFLAGS |
| 205 | #define EXT2_IOC_GETVERSION _IOR('v', 1, long) | 201 | #define EXT2_IOC_GETVERSION FS_IOC_GETVERSION |
| 206 | #define EXT2_IOC_SETVERSION _IOW('v', 2, long) | 202 | #define EXT2_IOC_SETVERSION FS_IOC_SETVERSION |
| 203 | |||
| 204 | /* | ||
| 205 | * ioctl commands in 32 bit emulation | ||
| 206 | */ | ||
| 207 | #define EXT2_IOC32_GETFLAGS FS_IOC32_GETFLAGS | ||
| 208 | #define EXT2_IOC32_SETFLAGS FS_IOC32_SETFLAGS | ||
| 209 | #define EXT2_IOC32_GETVERSION FS_IOC32_GETVERSION | ||
| 210 | #define EXT2_IOC32_SETVERSION FS_IOC32_SETVERSION | ||
| 207 | 211 | ||
| 208 | /* | 212 | /* |
| 209 | * Structure of an inode on the disk | 213 | * Structure of an inode on the disk |
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h index 9f9cce7bd8..11cca1bdc0 100644 --- a/include/linux/ext3_fs.h +++ b/include/linux/ext3_fs.h | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | #define _LINUX_EXT3_FS_H | 17 | #define _LINUX_EXT3_FS_H |
| 18 | 18 | ||
| 19 | #include <linux/types.h> | 19 | #include <linux/types.h> |
| 20 | #include <linux/magic.h> | ||
| 20 | 21 | ||
| 21 | /* | 22 | /* |
| 22 | * The second extended filesystem constants/structures | 23 | * The second extended filesystem constants/structures |
| @@ -67,11 +68,6 @@ | |||
| 67 | #define EXT3_GOOD_OLD_FIRST_INO 11 | 68 | #define EXT3_GOOD_OLD_FIRST_INO 11 |
| 68 | 69 | ||
| 69 | /* | 70 | /* |
| 70 | * The second extended file system magic number | ||
| 71 | */ | ||
| 72 | #define EXT3_SUPER_MAGIC 0xEF53 | ||
| 73 | |||
| 74 | /* | ||
| 75 | * Maximal count of links to a file | 71 | * Maximal count of links to a file |
| 76 | */ | 72 | */ |
| 77 | #define EXT3_LINK_MAX 32000 | 73 | #define EXT3_LINK_MAX 32000 |
| @@ -220,14 +216,14 @@ struct ext3_new_group_data { | |||
| 220 | /* | 216 | /* |
| 221 | * ioctl commands | 217 | * ioctl commands |
| 222 | */ | 218 | */ |
| 223 | #define EXT3_IOC_GETFLAGS _IOR('f', 1, long) | 219 | #define EXT3_IOC_GETFLAGS FS_IOC_GETFLAGS |
| 224 | #define EXT3_IOC_SETFLAGS _IOW('f', 2, long) | 220 | #define EXT3_IOC_SETFLAGS FS_IOC_SETFLAGS |
| 225 | #define EXT3_IOC_GETVERSION _IOR('f', 3, long) | 221 | #define EXT3_IOC_GETVERSION _IOR('f', 3, long) |
| 226 | #define EXT3_IOC_SETVERSION _IOW('f', 4, long) | 222 | #define EXT3_IOC_SETVERSION _IOW('f', 4, long) |
| 227 | #define EXT3_IOC_GROUP_EXTEND _IOW('f', 7, unsigned long) | 223 | #define EXT3_IOC_GROUP_EXTEND _IOW('f', 7, unsigned long) |
| 228 | #define EXT3_IOC_GROUP_ADD _IOW('f', 8,struct ext3_new_group_input) | 224 | #define EXT3_IOC_GROUP_ADD _IOW('f', 8,struct ext3_new_group_input) |
| 229 | #define EXT3_IOC_GETVERSION_OLD _IOR('v', 1, long) | 225 | #define EXT3_IOC_GETVERSION_OLD FS_IOC_GETVERSION |
| 230 | #define EXT3_IOC_SETVERSION_OLD _IOW('v', 2, long) | 226 | #define EXT3_IOC_SETVERSION_OLD FS_IOC_SETVERSION |
| 231 | #ifdef CONFIG_JBD_DEBUG | 227 | #ifdef CONFIG_JBD_DEBUG |
| 232 | #define EXT3_IOC_WAIT_FOR_READONLY _IOR('f', 99, long) | 228 | #define EXT3_IOC_WAIT_FOR_READONLY _IOR('f', 99, long) |
| 233 | #endif | 229 | #endif |
| @@ -235,6 +231,23 @@ struct ext3_new_group_data { | |||
| 235 | #define EXT3_IOC_SETRSVSZ _IOW('f', 6, long) | 231 | #define EXT3_IOC_SETRSVSZ _IOW('f', 6, long) |
| 236 | 232 | ||
| 237 | /* | 233 | /* |
| 234 | * ioctl commands in 32 bit emulation | ||
| 235 | */ | ||
| 236 | #define EXT3_IOC32_GETFLAGS FS_IOC32_GETFLAGS | ||
| 237 | #define EXT3_IOC32_SETFLAGS FS_IOC32_SETFLAGS | ||
| 238 | #define EXT3_IOC32_GETVERSION _IOR('f', 3, int) | ||
| 239 | #define EXT3_IOC32_SETVERSION _IOW('f', 4, int) | ||
| 240 | #define EXT3_IOC32_GETRSVSZ _IOR('f', 5, int) | ||
| 241 | #define EXT3_IOC32_SETRSVSZ _IOW('f', 6, int) | ||
| 242 | #define EXT3_IOC32_GROUP_EXTEND _IOW('f', 7, unsigned int) | ||
| 243 | #ifdef CONFIG_JBD_DEBUG | ||
| 244 | #define EXT3_IOC32_WAIT_FOR_READONLY _IOR('f', 99, int) | ||
| 245 | #endif | ||
| 246 | #define EXT3_IOC32_GETVERSION_OLD FS_IOC32_GETVERSION | ||
| 247 | #define EXT3_IOC32_SETVERSION_OLD FS_IOC32_SETVERSION | ||
| 248 | |||
| 249 | |||
| 250 | /* | ||
| 238 | * Mount options | 251 | * Mount options |
| 239 | */ | 252 | */ |
| 240 | struct ext3_mount_options { | 253 | struct ext3_mount_options { |
| @@ -464,7 +477,7 @@ struct ext3_super_block { | |||
| 464 | */ | 477 | */ |
| 465 | __u8 s_prealloc_blocks; /* Nr of blocks to try to preallocate*/ | 478 | __u8 s_prealloc_blocks; /* Nr of blocks to try to preallocate*/ |
| 466 | __u8 s_prealloc_dir_blocks; /* Nr to preallocate for dirs */ | 479 | __u8 s_prealloc_dir_blocks; /* Nr to preallocate for dirs */ |
| 467 | __u16 s_reserved_gdt_blocks; /* Per group desc for online growth */ | 480 | __le16 s_reserved_gdt_blocks; /* Per group desc for online growth */ |
| 468 | /* | 481 | /* |
| 469 | * Journaling support valid if EXT3_FEATURE_COMPAT_HAS_JOURNAL set. | 482 | * Journaling support valid if EXT3_FEATURE_COMPAT_HAS_JOURNAL set. |
| 470 | */ | 483 | */ |
| @@ -477,7 +490,7 @@ struct ext3_super_block { | |||
| 477 | __u8 s_reserved_char_pad; | 490 | __u8 s_reserved_char_pad; |
| 478 | __u16 s_reserved_word_pad; | 491 | __u16 s_reserved_word_pad; |
| 479 | __le32 s_default_mount_opts; | 492 | __le32 s_default_mount_opts; |
| 480 | __le32 s_first_meta_bg; /* First metablock block group */ | 493 | __le32 s_first_meta_bg; /* First metablock block group */ |
| 481 | __u32 s_reserved[190]; /* Padding to the end of the block */ | 494 | __u32 s_reserved[190]; /* Padding to the end of the block */ |
| 482 | }; | 495 | }; |
| 483 | 496 | ||
| @@ -816,6 +829,7 @@ extern void ext3_set_aops(struct inode *inode); | |||
| 816 | /* ioctl.c */ | 829 | /* ioctl.c */ |
| 817 | extern int ext3_ioctl (struct inode *, struct file *, unsigned int, | 830 | extern int ext3_ioctl (struct inode *, struct file *, unsigned int, |
| 818 | unsigned long); | 831 | unsigned long); |
| 832 | extern long ext3_compat_ioctl (struct file *, unsigned int, unsigned long); | ||
| 819 | 833 | ||
| 820 | /* namei.c */ | 834 | /* namei.c */ |
| 821 | extern int ext3_orphan_add(handle_t *, struct inode *); | 835 | extern int ext3_orphan_add(handle_t *, struct inode *); |
diff --git a/include/linux/ext3_fs_i.h b/include/linux/ext3_fs_i.h index 2f18b9511f..4395e52067 100644 --- a/include/linux/ext3_fs_i.h +++ b/include/linux/ext3_fs_i.h | |||
| @@ -35,7 +35,7 @@ struct ext3_reserve_window { | |||
| 35 | }; | 35 | }; |
| 36 | 36 | ||
| 37 | struct ext3_reserve_window_node { | 37 | struct ext3_reserve_window_node { |
| 38 | struct rb_node rsv_node; | 38 | struct rb_node rsv_node; |
| 39 | __u32 rsv_goal_size; | 39 | __u32 rsv_goal_size; |
| 40 | __u32 rsv_alloc_hit; | 40 | __u32 rsv_alloc_hit; |
| 41 | struct ext3_reserve_window rsv_window; | 41 | struct ext3_reserve_window rsv_window; |
diff --git a/include/linux/ext3_jbd.h b/include/linux/ext3_jbd.h index c8307c02dd..ce0e6109af 100644 --- a/include/linux/ext3_jbd.h +++ b/include/linux/ext3_jbd.h | |||
| @@ -23,7 +23,7 @@ | |||
| 23 | 23 | ||
| 24 | /* Define the number of blocks we need to account to a transaction to | 24 | /* Define the number of blocks we need to account to a transaction to |
| 25 | * modify one block of data. | 25 | * modify one block of data. |
| 26 | * | 26 | * |
| 27 | * We may have to touch one inode, one bitmap buffer, up to three | 27 | * We may have to touch one inode, one bitmap buffer, up to three |
| 28 | * indirection blocks, the group and superblock summaries, and the data | 28 | * indirection blocks, the group and superblock summaries, and the data |
| 29 | * block to complete the transaction. */ | 29 | * block to complete the transaction. */ |
| @@ -88,16 +88,16 @@ | |||
| 88 | #endif | 88 | #endif |
| 89 | 89 | ||
| 90 | int | 90 | int |
| 91 | ext3_mark_iloc_dirty(handle_t *handle, | 91 | ext3_mark_iloc_dirty(handle_t *handle, |
| 92 | struct inode *inode, | 92 | struct inode *inode, |
| 93 | struct ext3_iloc *iloc); | 93 | struct ext3_iloc *iloc); |
| 94 | 94 | ||
| 95 | /* | 95 | /* |
| 96 | * On success, We end up with an outstanding reference count against | 96 | * On success, We end up with an outstanding reference count against |
| 97 | * iloc->bh. This _must_ be cleaned up later. | 97 | * iloc->bh. This _must_ be cleaned up later. |
| 98 | */ | 98 | */ |
| 99 | 99 | ||
| 100 | int ext3_reserve_inode_write(handle_t *handle, struct inode *inode, | 100 | int ext3_reserve_inode_write(handle_t *handle, struct inode *inode, |
| 101 | struct ext3_iloc *iloc); | 101 | struct ext3_iloc *iloc); |
| 102 | 102 | ||
| 103 | int ext3_mark_inode_dirty(handle_t *handle, struct inode *inode); | 103 | int ext3_mark_inode_dirty(handle_t *handle, struct inode *inode); |
diff --git a/include/linux/fib_rules.h b/include/linux/fib_rules.h new file mode 100644 index 0000000000..4418c8d9d4 --- /dev/null +++ b/include/linux/fib_rules.h | |||
| @@ -0,0 +1,65 @@ | |||
| 1 | #ifndef __LINUX_FIB_RULES_H | ||
| 2 | #define __LINUX_FIB_RULES_H | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | #include <linux/rtnetlink.h> | ||
| 6 | |||
| 7 | /* rule is permanent, and cannot be deleted */ | ||
| 8 | #define FIB_RULE_PERMANENT 1 | ||
| 9 | |||
| 10 | struct fib_rule_hdr | ||
| 11 | { | ||
| 12 | __u8 family; | ||
| 13 | __u8 dst_len; | ||
| 14 | __u8 src_len; | ||
| 15 | __u8 tos; | ||
| 16 | |||
| 17 | __u8 table; | ||
| 18 | __u8 res1; /* reserved */ | ||
| 19 | __u8 res2; /* reserved */ | ||
| 20 | __u8 action; | ||
| 21 | |||
| 22 | __u32 flags; | ||
| 23 | }; | ||
| 24 | |||
| 25 | enum | ||
| 26 | { | ||
| 27 | FRA_UNSPEC, | ||
| 28 | FRA_DST, /* destination address */ | ||
| 29 | FRA_SRC, /* source address */ | ||
| 30 | FRA_IFNAME, /* interface name */ | ||
| 31 | FRA_UNUSED1, | ||
| 32 | FRA_UNUSED2, | ||
| 33 | FRA_PRIORITY, /* priority/preference */ | ||
| 34 | FRA_UNUSED3, | ||
| 35 | FRA_UNUSED4, | ||
| 36 | FRA_UNUSED5, | ||
| 37 | FRA_FWMARK, /* netfilter mark */ | ||
| 38 | FRA_FLOW, /* flow/class id */ | ||
| 39 | FRA_UNUSED6, | ||
| 40 | FRA_UNUSED7, | ||
| 41 | FRA_UNUSED8, | ||
| 42 | FRA_TABLE, /* Extended table id */ | ||
| 43 | FRA_FWMASK, /* mask for netfilter mark */ | ||
| 44 | __FRA_MAX | ||
| 45 | }; | ||
| 46 | |||
| 47 | #define FRA_MAX (__FRA_MAX - 1) | ||
| 48 | |||
| 49 | enum | ||
| 50 | { | ||
| 51 | FR_ACT_UNSPEC, | ||
| 52 | FR_ACT_TO_TBL, /* Pass to fixed table */ | ||
| 53 | FR_ACT_RES1, | ||
| 54 | FR_ACT_RES2, | ||
| 55 | FR_ACT_RES3, | ||
| 56 | FR_ACT_RES4, | ||
| 57 | FR_ACT_BLACKHOLE, /* Drop without notification */ | ||
| 58 | FR_ACT_UNREACHABLE, /* Drop with ENETUNREACH */ | ||
| 59 | FR_ACT_PROHIBIT, /* Drop with EACCES */ | ||
| 60 | __FR_ACT_MAX, | ||
| 61 | }; | ||
| 62 | |||
| 63 | #define FR_ACT_MAX (__FR_ACT_MAX - 1) | ||
| 64 | |||
| 65 | #endif | ||
diff --git a/include/linux/file.h b/include/linux/file.h index 9f7c251386..74183e6f7f 100644 --- a/include/linux/file.h +++ b/include/linux/file.h | |||
| @@ -112,5 +112,6 @@ struct task_struct; | |||
| 112 | 112 | ||
| 113 | struct files_struct *get_files_struct(struct task_struct *); | 113 | struct files_struct *get_files_struct(struct task_struct *); |
| 114 | void FASTCALL(put_files_struct(struct files_struct *fs)); | 114 | void FASTCALL(put_files_struct(struct files_struct *fs)); |
| 115 | void reset_files_struct(struct task_struct *, struct files_struct *); | ||
| 115 | 116 | ||
| 116 | #endif /* __LINUX_FILE_H */ | 117 | #endif /* __LINUX_FILE_H */ |
diff --git a/include/linux/filter.h b/include/linux/filter.h index c6cb8f0950..91b2e3b925 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h | |||
| @@ -25,10 +25,10 @@ | |||
| 25 | 25 | ||
| 26 | struct sock_filter /* Filter block */ | 26 | struct sock_filter /* Filter block */ |
| 27 | { | 27 | { |
| 28 | __u16 code; /* Actual filter code */ | 28 | __u16 code; /* Actual filter code */ |
| 29 | __u8 jt; /* Jump true */ | 29 | __u8 jt; /* Jump true */ |
| 30 | __u8 jf; /* Jump false */ | 30 | __u8 jf; /* Jump false */ |
| 31 | __u32 k; /* Generic multiuse field */ | 31 | __u32 k; /* Generic multiuse field */ |
| 32 | }; | 32 | }; |
| 33 | 33 | ||
| 34 | struct sock_fprog /* Required for SO_ATTACH_FILTER. */ | 34 | struct sock_fprog /* Required for SO_ATTACH_FILTER. */ |
| @@ -41,8 +41,9 @@ struct sock_fprog /* Required for SO_ATTACH_FILTER. */ | |||
| 41 | struct sk_filter | 41 | struct sk_filter |
| 42 | { | 42 | { |
| 43 | atomic_t refcnt; | 43 | atomic_t refcnt; |
| 44 | unsigned int len; /* Number of filter blocks */ | 44 | unsigned int len; /* Number of filter blocks */ |
| 45 | struct sock_filter insns[0]; | 45 | struct rcu_head rcu; |
| 46 | struct sock_filter insns[0]; | ||
| 46 | }; | 47 | }; |
| 47 | 48 | ||
| 48 | static inline unsigned int sk_filter_len(struct sk_filter *fp) | 49 | static inline unsigned int sk_filter_len(struct sk_filter *fp) |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 555bc195c4..2e29a2edae 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -79,8 +79,8 @@ extern int dir_notify_enable; | |||
| 79 | #define WRITE 1 | 79 | #define WRITE 1 |
| 80 | #define READA 2 /* read-ahead - don't block if no resources */ | 80 | #define READA 2 /* read-ahead - don't block if no resources */ |
| 81 | #define SWRITE 3 /* for ll_rw_block() - wait for buffer lock */ | 81 | #define SWRITE 3 /* for ll_rw_block() - wait for buffer lock */ |
| 82 | #define SPECIAL 4 /* For non-blockdevice requests in request queue */ | ||
| 83 | #define READ_SYNC (READ | (1 << BIO_RW_SYNC)) | 82 | #define READ_SYNC (READ | (1 << BIO_RW_SYNC)) |
| 83 | #define READ_META (READ | (1 << BIO_RW_META)) | ||
| 84 | #define WRITE_SYNC (WRITE | (1 << BIO_RW_SYNC)) | 84 | #define WRITE_SYNC (WRITE | (1 << BIO_RW_SYNC)) |
| 85 | #define WRITE_BARRIER ((1 << BIO_RW) | (1 << BIO_RW_BARRIER)) | 85 | #define WRITE_BARRIER ((1 << BIO_RW) | (1 << BIO_RW_BARRIER)) |
| 86 | 86 | ||
| @@ -92,9 +92,10 @@ extern int dir_notify_enable; | |||
| 92 | #define FS_REQUIRES_DEV 1 | 92 | #define FS_REQUIRES_DEV 1 |
| 93 | #define FS_BINARY_MOUNTDATA 2 | 93 | #define FS_BINARY_MOUNTDATA 2 |
| 94 | #define FS_REVAL_DOT 16384 /* Check the paths ".", ".." for staleness */ | 94 | #define FS_REVAL_DOT 16384 /* Check the paths ".", ".." for staleness */ |
| 95 | #define FS_ODD_RENAME 32768 /* Temporary stuff; will go away as soon | 95 | #define FS_RENAME_DOES_D_MOVE 32768 /* FS will handle d_move() |
| 96 | * as nfs_rename() will be cleaned up | 96 | * during rename() internally. |
| 97 | */ | 97 | */ |
| 98 | |||
| 98 | /* | 99 | /* |
| 99 | * These are the fs-independent mount-flags: up to 32 flags are supported | 100 | * These are the fs-independent mount-flags: up to 32 flags are supported |
| 100 | */ | 101 | */ |
| @@ -216,6 +217,45 @@ extern int dir_notify_enable; | |||
| 216 | #define FIBMAP _IO(0x00,1) /* bmap access */ | 217 | #define FIBMAP _IO(0x00,1) /* bmap access */ |
| 217 | #define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */ | 218 | #define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */ |
| 218 | 219 | ||
| 220 | #define FS_IOC_GETFLAGS _IOR('f', 1, long) | ||
| 221 | #define FS_IOC_SETFLAGS _IOW('f', 2, long) | ||
| 222 | #define FS_IOC_GETVERSION _IOR('v', 1, long) | ||
| 223 | #define FS_IOC_SETVERSION _IOW('v', 2, long) | ||
| 224 | #define FS_IOC32_GETFLAGS _IOR('f', 1, int) | ||
| 225 | #define FS_IOC32_SETFLAGS _IOW('f', 2, int) | ||
| 226 | #define FS_IOC32_GETVERSION _IOR('v', 1, int) | ||
| 227 | #define FS_IOC32_SETVERSION _IOW('v', 2, int) | ||
| 228 | |||
| 229 | /* | ||
| 230 | * Inode flags (FS_IOC_GETFLAGS / FS_IOC_SETFLAGS) | ||
| 231 | */ | ||
| 232 | #define FS_SECRM_FL 0x00000001 /* Secure deletion */ | ||
| 233 | #define FS_UNRM_FL 0x00000002 /* Undelete */ | ||
| 234 | #define FS_COMPR_FL 0x00000004 /* Compress file */ | ||
| 235 | #define FS_SYNC_FL 0x00000008 /* Synchronous updates */ | ||
| 236 | #define FS_IMMUTABLE_FL 0x00000010 /* Immutable file */ | ||
| 237 | #define FS_APPEND_FL 0x00000020 /* writes to file may only append */ | ||
| 238 | #define FS_NODUMP_FL 0x00000040 /* do not dump file */ | ||
| 239 | #define FS_NOATIME_FL 0x00000080 /* do not update atime */ | ||
| 240 | /* Reserved for compression usage... */ | ||
| 241 | #define FS_DIRTY_FL 0x00000100 | ||
| 242 | #define FS_COMPRBLK_FL 0x00000200 /* One or more compressed clusters */ | ||
| 243 | #define FS_NOCOMP_FL 0x00000400 /* Don't compress */ | ||
| 244 | #define FS_ECOMPR_FL 0x00000800 /* Compression error */ | ||
| 245 | /* End compression flags --- maybe not all used */ | ||
| 246 | #define FS_BTREE_FL 0x00001000 /* btree format dir */ | ||
| 247 | #define FS_INDEX_FL 0x00001000 /* hash-indexed directory */ | ||
| 248 | #define FS_IMAGIC_FL 0x00002000 /* AFS directory */ | ||
| 249 | #define FS_JOURNAL_DATA_FL 0x00004000 /* Reserved for ext3 */ | ||
| 250 | #define FS_NOTAIL_FL 0x00008000 /* file tail should not be merged */ | ||
| 251 | #define FS_DIRSYNC_FL 0x00010000 /* dirsync behaviour (directories only) */ | ||
| 252 | #define FS_TOPDIR_FL 0x00020000 /* Top of directory hierarchies*/ | ||
| 253 | #define FS_RESERVED_FL 0x80000000 /* reserved for ext2 lib */ | ||
| 254 | |||
| 255 | #define FS_FL_USER_VISIBLE 0x0003DFFF /* User visible flags */ | ||
| 256 | #define FS_FL_USER_MODIFIABLE 0x000380FF /* User modifiable flags */ | ||
| 257 | |||
| 258 | |||
| 219 | #define SYNC_FILE_RANGE_WAIT_BEFORE 1 | 259 | #define SYNC_FILE_RANGE_WAIT_BEFORE 1 |
| 220 | #define SYNC_FILE_RANGE_WRITE 2 | 260 | #define SYNC_FILE_RANGE_WRITE 2 |
| 221 | #define SYNC_FILE_RANGE_WAIT_AFTER 4 | 261 | #define SYNC_FILE_RANGE_WAIT_AFTER 4 |
| @@ -511,7 +551,6 @@ struct inode { | |||
| 511 | struct timespec i_mtime; | 551 | struct timespec i_mtime; |
| 512 | struct timespec i_ctime; | 552 | struct timespec i_ctime; |
| 513 | unsigned int i_blkbits; | 553 | unsigned int i_blkbits; |
| 514 | unsigned long i_blksize; | ||
| 515 | unsigned long i_version; | 554 | unsigned long i_version; |
| 516 | blkcnt_t i_blocks; | 555 | blkcnt_t i_blocks; |
| 517 | unsigned short i_bytes; | 556 | unsigned short i_bytes; |
| @@ -527,11 +566,12 @@ struct inode { | |||
| 527 | #ifdef CONFIG_QUOTA | 566 | #ifdef CONFIG_QUOTA |
| 528 | struct dquot *i_dquot[MAXQUOTAS]; | 567 | struct dquot *i_dquot[MAXQUOTAS]; |
| 529 | #endif | 568 | #endif |
| 530 | /* These three should probably be a union */ | ||
| 531 | struct list_head i_devices; | 569 | struct list_head i_devices; |
| 532 | struct pipe_inode_info *i_pipe; | 570 | union { |
| 533 | struct block_device *i_bdev; | 571 | struct pipe_inode_info *i_pipe; |
| 534 | struct cdev *i_cdev; | 572 | struct block_device *i_bdev; |
| 573 | struct cdev *i_cdev; | ||
| 574 | }; | ||
| 535 | int i_cindex; | 575 | int i_cindex; |
| 536 | 576 | ||
| 537 | __u32 i_generation; | 577 | __u32 i_generation; |
| @@ -552,10 +592,10 @@ struct inode { | |||
| 552 | unsigned int i_flags; | 592 | unsigned int i_flags; |
| 553 | 593 | ||
| 554 | atomic_t i_writecount; | 594 | atomic_t i_writecount; |
| 595 | #ifdef CONFIG_SECURITY | ||
| 555 | void *i_security; | 596 | void *i_security; |
| 556 | union { | 597 | #endif |
| 557 | void *generic_ip; | 598 | void *i_private; /* fs or device private pointer */ |
| 558 | } u; | ||
| 559 | #ifdef __NEED_I_SIZE_ORDERED | 599 | #ifdef __NEED_I_SIZE_ORDERED |
| 560 | seqcount_t i_size_seqcount; | 600 | seqcount_t i_size_seqcount; |
| 561 | #endif | 601 | #endif |
| @@ -646,7 +686,6 @@ struct fown_struct { | |||
| 646 | rwlock_t lock; /* protects pid, uid, euid fields */ | 686 | rwlock_t lock; /* protects pid, uid, euid fields */ |
| 647 | int pid; /* pid or -pgrp where SIGIO should be sent */ | 687 | int pid; /* pid or -pgrp where SIGIO should be sent */ |
| 648 | uid_t uid, euid; /* uid/euid of process setting the owner */ | 688 | uid_t uid, euid; /* uid/euid of process setting the owner */ |
| 649 | void *security; | ||
| 650 | int signum; /* posix.1b rt signal to be delivered on IO */ | 689 | int signum; /* posix.1b rt signal to be delivered on IO */ |
| 651 | }; | 690 | }; |
| 652 | 691 | ||
| @@ -689,8 +728,9 @@ struct file { | |||
| 689 | struct file_ra_state f_ra; | 728 | struct file_ra_state f_ra; |
| 690 | 729 | ||
| 691 | unsigned long f_version; | 730 | unsigned long f_version; |
| 731 | #ifdef CONFIG_SECURITY | ||
| 692 | void *f_security; | 732 | void *f_security; |
| 693 | 733 | #endif | |
| 694 | /* needed for tty driver, and maybe others */ | 734 | /* needed for tty driver, and maybe others */ |
| 695 | void *private_data; | 735 | void *private_data; |
| 696 | 736 | ||
| @@ -878,7 +918,9 @@ struct super_block { | |||
| 878 | int s_syncing; | 918 | int s_syncing; |
| 879 | int s_need_sync_fs; | 919 | int s_need_sync_fs; |
| 880 | atomic_t s_active; | 920 | atomic_t s_active; |
| 921 | #ifdef CONFIG_SECURITY | ||
| 881 | void *s_security; | 922 | void *s_security; |
| 923 | #endif | ||
| 882 | struct xattr_handler **s_xattr; | 924 | struct xattr_handler **s_xattr; |
| 883 | 925 | ||
| 884 | struct list_head s_inodes; /* all inodes */ | 926 | struct list_head s_inodes; /* all inodes */ |
| @@ -1055,9 +1097,9 @@ struct file_operations { | |||
| 1055 | struct module *owner; | 1097 | struct module *owner; |
| 1056 | loff_t (*llseek) (struct file *, loff_t, int); | 1098 | loff_t (*llseek) (struct file *, loff_t, int); |
| 1057 | ssize_t (*read) (struct file *, char __user *, size_t, loff_t *); | 1099 | ssize_t (*read) (struct file *, char __user *, size_t, loff_t *); |
| 1058 | ssize_t (*aio_read) (struct kiocb *, char __user *, size_t, loff_t); | ||
| 1059 | ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *); | 1100 | ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *); |
| 1060 | ssize_t (*aio_write) (struct kiocb *, const char __user *, size_t, loff_t); | 1101 | ssize_t (*aio_read) (struct kiocb *, const struct iovec *, unsigned long, loff_t); |
| 1102 | ssize_t (*aio_write) (struct kiocb *, const struct iovec *, unsigned long, loff_t); | ||
| 1061 | int (*readdir) (struct file *, void *, filldir_t); | 1103 | int (*readdir) (struct file *, void *, filldir_t); |
| 1062 | unsigned int (*poll) (struct file *, struct poll_table_struct *); | 1104 | unsigned int (*poll) (struct file *, struct poll_table_struct *); |
| 1063 | int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned long); | 1105 | int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned long); |
| @@ -1071,8 +1113,6 @@ struct file_operations { | |||
| 1071 | int (*aio_fsync) (struct kiocb *, int datasync); | 1113 | int (*aio_fsync) (struct kiocb *, int datasync); |
| 1072 | int (*fasync) (int, struct file *, int); | 1114 | int (*fasync) (int, struct file *, int); |
| 1073 | int (*lock) (struct file *, int, struct file_lock *); | 1115 | int (*lock) (struct file *, int, struct file_lock *); |
| 1074 | ssize_t (*readv) (struct file *, const struct iovec *, unsigned long, loff_t *); | ||
| 1075 | ssize_t (*writev) (struct file *, const struct iovec *, unsigned long, loff_t *); | ||
| 1076 | ssize_t (*sendfile) (struct file *, loff_t *, size_t, read_actor_t, void *); | 1116 | ssize_t (*sendfile) (struct file *, loff_t *, size_t, read_actor_t, void *); |
| 1077 | ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int); | 1117 | ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int); |
| 1078 | unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); | 1118 | unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); |
| @@ -1110,6 +1150,11 @@ struct inode_operations { | |||
| 1110 | 1150 | ||
| 1111 | struct seq_file; | 1151 | struct seq_file; |
| 1112 | 1152 | ||
| 1153 | ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector, | ||
| 1154 | unsigned long nr_segs, unsigned long fast_segs, | ||
| 1155 | struct iovec *fast_pointer, | ||
| 1156 | struct iovec **ret_pointer); | ||
| 1157 | |||
| 1113 | extern ssize_t vfs_read(struct file *, char __user *, size_t, loff_t *); | 1158 | extern ssize_t vfs_read(struct file *, char __user *, size_t, loff_t *); |
| 1114 | extern ssize_t vfs_write(struct file *, const char __user *, size_t, loff_t *); | 1159 | extern ssize_t vfs_write(struct file *, const char __user *, size_t, loff_t *); |
| 1115 | extern ssize_t vfs_readv(struct file *, const struct iovec __user *, | 1160 | extern ssize_t vfs_readv(struct file *, const struct iovec __user *, |
| @@ -1144,9 +1189,10 @@ struct super_operations { | |||
| 1144 | 1189 | ||
| 1145 | int (*show_options)(struct seq_file *, struct vfsmount *); | 1190 | int (*show_options)(struct seq_file *, struct vfsmount *); |
| 1146 | int (*show_stats)(struct seq_file *, struct vfsmount *); | 1191 | int (*show_stats)(struct seq_file *, struct vfsmount *); |
| 1147 | 1192 | #ifdef CONFIG_QUOTA | |
| 1148 | ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t); | 1193 | ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t); |
| 1149 | ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t); | 1194 | ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t); |
| 1195 | #endif | ||
| 1150 | }; | 1196 | }; |
| 1151 | 1197 | ||
| 1152 | /* Inode state bits. Protected by inode_lock. */ | 1198 | /* Inode state bits. Protected by inode_lock. */ |
| @@ -1173,15 +1219,30 @@ static inline void mark_inode_dirty_sync(struct inode *inode) | |||
| 1173 | __mark_inode_dirty(inode, I_DIRTY_SYNC); | 1219 | __mark_inode_dirty(inode, I_DIRTY_SYNC); |
| 1174 | } | 1220 | } |
| 1175 | 1221 | ||
| 1176 | static inline void inode_inc_link_count(struct inode *inode) | 1222 | static inline void inc_nlink(struct inode *inode) |
| 1177 | { | 1223 | { |
| 1178 | inode->i_nlink++; | 1224 | inode->i_nlink++; |
| 1225 | } | ||
| 1226 | |||
| 1227 | static inline void inode_inc_link_count(struct inode *inode) | ||
| 1228 | { | ||
| 1229 | inc_nlink(inode); | ||
| 1179 | mark_inode_dirty(inode); | 1230 | mark_inode_dirty(inode); |
| 1180 | } | 1231 | } |
| 1181 | 1232 | ||
| 1182 | static inline void inode_dec_link_count(struct inode *inode) | 1233 | static inline void drop_nlink(struct inode *inode) |
| 1183 | { | 1234 | { |
| 1184 | inode->i_nlink--; | 1235 | inode->i_nlink--; |
| 1236 | } | ||
| 1237 | |||
| 1238 | static inline void clear_nlink(struct inode *inode) | ||
| 1239 | { | ||
| 1240 | inode->i_nlink = 0; | ||
| 1241 | } | ||
| 1242 | |||
| 1243 | static inline void inode_dec_link_count(struct inode *inode) | ||
| 1244 | { | ||
| 1245 | drop_nlink(inode); | ||
| 1185 | mark_inode_dirty(inode); | 1246 | mark_inode_dirty(inode); |
| 1186 | } | 1247 | } |
| 1187 | 1248 | ||
| @@ -1439,6 +1500,7 @@ extern void __init vfs_caches_init(unsigned long); | |||
| 1439 | extern void putname(const char *name); | 1500 | extern void putname(const char *name); |
| 1440 | #endif | 1501 | #endif |
| 1441 | 1502 | ||
| 1503 | #ifdef CONFIG_BLOCK | ||
| 1442 | extern int register_blkdev(unsigned int, const char *); | 1504 | extern int register_blkdev(unsigned int, const char *); |
| 1443 | extern int unregister_blkdev(unsigned int, const char *); | 1505 | extern int unregister_blkdev(unsigned int, const char *); |
| 1444 | extern struct block_device *bdget(dev_t); | 1506 | extern struct block_device *bdget(dev_t); |
| @@ -1447,11 +1509,15 @@ extern void bd_forget(struct inode *inode); | |||
| 1447 | extern void bdput(struct block_device *); | 1509 | extern void bdput(struct block_device *); |
| 1448 | extern struct block_device *open_by_devnum(dev_t, unsigned); | 1510 | extern struct block_device *open_by_devnum(dev_t, unsigned); |
| 1449 | extern struct block_device *open_partition_by_devnum(dev_t, unsigned); | 1511 | extern struct block_device *open_partition_by_devnum(dev_t, unsigned); |
| 1450 | extern const struct file_operations def_blk_fops; | ||
| 1451 | extern const struct address_space_operations def_blk_aops; | 1512 | extern const struct address_space_operations def_blk_aops; |
| 1513 | #else | ||
| 1514 | static inline void bd_forget(struct inode *inode) {} | ||
| 1515 | #endif | ||
| 1516 | extern const struct file_operations def_blk_fops; | ||
| 1452 | extern const struct file_operations def_chr_fops; | 1517 | extern const struct file_operations def_chr_fops; |
| 1453 | extern const struct file_operations bad_sock_fops; | 1518 | extern const struct file_operations bad_sock_fops; |
| 1454 | extern const struct file_operations def_fifo_fops; | 1519 | extern const struct file_operations def_fifo_fops; |
| 1520 | #ifdef CONFIG_BLOCK | ||
| 1455 | extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long); | 1521 | extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long); |
| 1456 | extern int blkdev_ioctl(struct inode *, struct file *, unsigned, unsigned long); | 1522 | extern int blkdev_ioctl(struct inode *, struct file *, unsigned, unsigned long); |
| 1457 | extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); | 1523 | extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); |
| @@ -1467,6 +1533,7 @@ extern void bd_release_from_disk(struct block_device *, struct gendisk *); | |||
| 1467 | #define bd_claim_by_disk(bdev, holder, disk) bd_claim(bdev, holder) | 1533 | #define bd_claim_by_disk(bdev, holder, disk) bd_claim(bdev, holder) |
| 1468 | #define bd_release_from_disk(bdev, disk) bd_release(bdev) | 1534 | #define bd_release_from_disk(bdev, disk) bd_release(bdev) |
| 1469 | #endif | 1535 | #endif |
| 1536 | #endif | ||
| 1470 | 1537 | ||
| 1471 | /* fs/char_dev.c */ | 1538 | /* fs/char_dev.c */ |
| 1472 | #define CHRDEV_MAJOR_HASH_SIZE 255 | 1539 | #define CHRDEV_MAJOR_HASH_SIZE 255 |
| @@ -1480,14 +1547,19 @@ extern int chrdev_open(struct inode *, struct file *); | |||
| 1480 | extern void chrdev_show(struct seq_file *,off_t); | 1547 | extern void chrdev_show(struct seq_file *,off_t); |
| 1481 | 1548 | ||
| 1482 | /* fs/block_dev.c */ | 1549 | /* fs/block_dev.c */ |
| 1483 | #define BLKDEV_MAJOR_HASH_SIZE 255 | ||
| 1484 | #define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */ | 1550 | #define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */ |
| 1551 | |||
| 1552 | #ifdef CONFIG_BLOCK | ||
| 1553 | #define BLKDEV_MAJOR_HASH_SIZE 255 | ||
| 1485 | extern const char *__bdevname(dev_t, char *buffer); | 1554 | extern const char *__bdevname(dev_t, char *buffer); |
| 1486 | extern const char *bdevname(struct block_device *bdev, char *buffer); | 1555 | extern const char *bdevname(struct block_device *bdev, char *buffer); |
| 1487 | extern struct block_device *lookup_bdev(const char *); | 1556 | extern struct block_device *lookup_bdev(const char *); |
| 1488 | extern struct block_device *open_bdev_excl(const char *, int, void *); | 1557 | extern struct block_device *open_bdev_excl(const char *, int, void *); |
| 1489 | extern void close_bdev_excl(struct block_device *); | 1558 | extern void close_bdev_excl(struct block_device *); |
| 1490 | extern void blkdev_show(struct seq_file *,off_t); | 1559 | extern void blkdev_show(struct seq_file *,off_t); |
| 1560 | #else | ||
| 1561 | #define BLKDEV_MAJOR_HASH_SIZE 0 | ||
| 1562 | #endif | ||
| 1491 | 1563 | ||
| 1492 | extern void init_special_inode(struct inode *, umode_t, dev_t); | 1564 | extern void init_special_inode(struct inode *, umode_t, dev_t); |
| 1493 | 1565 | ||
| @@ -1501,6 +1573,7 @@ extern const struct file_operations rdwr_fifo_fops; | |||
| 1501 | 1573 | ||
| 1502 | extern int fs_may_remount_ro(struct super_block *); | 1574 | extern int fs_may_remount_ro(struct super_block *); |
| 1503 | 1575 | ||
| 1576 | #ifdef CONFIG_BLOCK | ||
| 1504 | /* | 1577 | /* |
| 1505 | * return READ, READA, or WRITE | 1578 | * return READ, READA, or WRITE |
| 1506 | */ | 1579 | */ |
| @@ -1512,9 +1585,10 @@ extern int fs_may_remount_ro(struct super_block *); | |||
| 1512 | #define bio_data_dir(bio) ((bio)->bi_rw & 1) | 1585 | #define bio_data_dir(bio) ((bio)->bi_rw & 1) |
| 1513 | 1586 | ||
| 1514 | extern int check_disk_change(struct block_device *); | 1587 | extern int check_disk_change(struct block_device *); |
| 1515 | extern int invalidate_inodes(struct super_block *); | ||
| 1516 | extern int __invalidate_device(struct block_device *); | 1588 | extern int __invalidate_device(struct block_device *); |
| 1517 | extern int invalidate_partition(struct gendisk *, int); | 1589 | extern int invalidate_partition(struct gendisk *, int); |
| 1590 | #endif | ||
| 1591 | extern int invalidate_inodes(struct super_block *); | ||
| 1518 | unsigned long invalidate_mapping_pages(struct address_space *mapping, | 1592 | unsigned long invalidate_mapping_pages(struct address_space *mapping, |
| 1519 | pgoff_t start, pgoff_t end); | 1593 | pgoff_t start, pgoff_t end); |
| 1520 | unsigned long invalidate_inode_pages(struct address_space *mapping); | 1594 | unsigned long invalidate_inode_pages(struct address_space *mapping); |
| @@ -1542,11 +1616,14 @@ extern int __filemap_fdatawrite_range(struct address_space *mapping, | |||
| 1542 | extern long do_fsync(struct file *file, int datasync); | 1616 | extern long do_fsync(struct file *file, int datasync); |
| 1543 | extern void sync_supers(void); | 1617 | extern void sync_supers(void); |
| 1544 | extern void sync_filesystems(int wait); | 1618 | extern void sync_filesystems(int wait); |
| 1619 | extern void __fsync_super(struct super_block *sb); | ||
| 1545 | extern void emergency_sync(void); | 1620 | extern void emergency_sync(void); |
| 1546 | extern void emergency_remount(void); | 1621 | extern void emergency_remount(void); |
| 1547 | extern int do_remount_sb(struct super_block *sb, int flags, | 1622 | extern int do_remount_sb(struct super_block *sb, int flags, |
| 1548 | void *data, int force); | 1623 | void *data, int force); |
| 1624 | #ifdef CONFIG_BLOCK | ||
| 1549 | extern sector_t bmap(struct inode *, sector_t); | 1625 | extern sector_t bmap(struct inode *, sector_t); |
| 1626 | #endif | ||
| 1550 | extern int notify_change(struct dentry *, struct iattr *); | 1627 | extern int notify_change(struct dentry *, struct iattr *); |
| 1551 | extern int permission(struct inode *, int, struct nameidata *); | 1628 | extern int permission(struct inode *, int, struct nameidata *); |
| 1552 | extern int generic_permission(struct inode *, int, | 1629 | extern int generic_permission(struct inode *, int, |
| @@ -1564,6 +1641,9 @@ static inline void allow_write_access(struct file *file) | |||
| 1564 | atomic_inc(&file->f_dentry->d_inode->i_writecount); | 1641 | atomic_inc(&file->f_dentry->d_inode->i_writecount); |
| 1565 | } | 1642 | } |
| 1566 | extern int do_pipe(int *); | 1643 | extern int do_pipe(int *); |
| 1644 | extern struct file *create_read_pipe(struct file *f); | ||
| 1645 | extern struct file *create_write_pipe(void); | ||
| 1646 | extern void free_write_pipe(struct file *); | ||
| 1567 | 1647 | ||
| 1568 | extern int open_namei(int dfd, const char *, int, int, struct nameidata *); | 1648 | extern int open_namei(int dfd, const char *, int, int, struct nameidata *); |
| 1569 | extern int may_open(struct nameidata *, int, int); | 1649 | extern int may_open(struct nameidata *, int, int); |
| @@ -1629,9 +1709,11 @@ static inline void insert_inode_hash(struct inode *inode) { | |||
| 1629 | extern struct file * get_empty_filp(void); | 1709 | extern struct file * get_empty_filp(void); |
| 1630 | extern void file_move(struct file *f, struct list_head *list); | 1710 | extern void file_move(struct file *f, struct list_head *list); |
| 1631 | extern void file_kill(struct file *f); | 1711 | extern void file_kill(struct file *f); |
| 1712 | #ifdef CONFIG_BLOCK | ||
| 1632 | struct bio; | 1713 | struct bio; |
| 1633 | extern void submit_bio(int, struct bio *); | 1714 | extern void submit_bio(int, struct bio *); |
| 1634 | extern int bdev_read_only(struct block_device *); | 1715 | extern int bdev_read_only(struct block_device *); |
| 1716 | #endif | ||
| 1635 | extern int set_blocksize(struct block_device *, int); | 1717 | extern int set_blocksize(struct block_device *, int); |
| 1636 | extern int sb_set_blocksize(struct super_block *, int); | 1718 | extern int sb_set_blocksize(struct super_block *, int); |
| 1637 | extern int sb_min_blocksize(struct super_block *, int); | 1719 | extern int sb_min_blocksize(struct super_block *, int); |
| @@ -1640,22 +1722,17 @@ extern int generic_file_mmap(struct file *, struct vm_area_struct *); | |||
| 1640 | extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *); | 1722 | extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *); |
| 1641 | extern int file_read_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size); | 1723 | extern int file_read_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size); |
| 1642 | extern int file_send_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size); | 1724 | extern int file_send_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size); |
| 1643 | extern ssize_t generic_file_read(struct file *, char __user *, size_t, loff_t *); | ||
| 1644 | int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk); | 1725 | int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk); |
| 1645 | extern ssize_t generic_file_write(struct file *, const char __user *, size_t, loff_t *); | 1726 | extern ssize_t generic_file_aio_read(struct kiocb *, const struct iovec *, unsigned long, loff_t); |
| 1646 | extern ssize_t generic_file_aio_read(struct kiocb *, char __user *, size_t, loff_t); | 1727 | extern ssize_t generic_file_aio_write(struct kiocb *, const struct iovec *, unsigned long, loff_t); |
| 1647 | extern ssize_t __generic_file_aio_read(struct kiocb *, const struct iovec *, unsigned long, loff_t *); | ||
| 1648 | extern ssize_t generic_file_aio_write(struct kiocb *, const char __user *, size_t, loff_t); | ||
| 1649 | extern ssize_t generic_file_aio_write_nolock(struct kiocb *, const struct iovec *, | 1728 | extern ssize_t generic_file_aio_write_nolock(struct kiocb *, const struct iovec *, |
| 1650 | unsigned long, loff_t *); | 1729 | unsigned long, loff_t); |
| 1651 | extern ssize_t generic_file_direct_write(struct kiocb *, const struct iovec *, | 1730 | extern ssize_t generic_file_direct_write(struct kiocb *, const struct iovec *, |
| 1652 | unsigned long *, loff_t, loff_t *, size_t, size_t); | 1731 | unsigned long *, loff_t, loff_t *, size_t, size_t); |
| 1653 | extern ssize_t generic_file_buffered_write(struct kiocb *, const struct iovec *, | 1732 | extern ssize_t generic_file_buffered_write(struct kiocb *, const struct iovec *, |
| 1654 | unsigned long, loff_t, loff_t *, size_t, ssize_t); | 1733 | unsigned long, loff_t, loff_t *, size_t, ssize_t); |
| 1655 | extern ssize_t do_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos); | 1734 | extern ssize_t do_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos); |
| 1656 | extern ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos); | 1735 | extern ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos); |
| 1657 | ssize_t generic_file_write_nolock(struct file *file, const struct iovec *iov, | ||
| 1658 | unsigned long nr_segs, loff_t *ppos); | ||
| 1659 | extern ssize_t generic_file_sendfile(struct file *, loff_t *, size_t, read_actor_t, void *); | 1736 | extern ssize_t generic_file_sendfile(struct file *, loff_t *, size_t, read_actor_t, void *); |
| 1660 | extern void do_generic_mapping_read(struct address_space *mapping, | 1737 | extern void do_generic_mapping_read(struct address_space *mapping, |
| 1661 | struct file_ra_state *, struct file *, | 1738 | struct file_ra_state *, struct file *, |
| @@ -1673,10 +1750,6 @@ extern long do_splice_direct(struct file *in, loff_t *ppos, struct file *out, | |||
| 1673 | 1750 | ||
| 1674 | extern void | 1751 | extern void |
| 1675 | file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping); | 1752 | file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping); |
| 1676 | extern ssize_t generic_file_readv(struct file *filp, const struct iovec *iov, | ||
| 1677 | unsigned long nr_segs, loff_t *ppos); | ||
| 1678 | ssize_t generic_file_writev(struct file *filp, const struct iovec *iov, | ||
| 1679 | unsigned long nr_segs, loff_t *ppos); | ||
| 1680 | extern loff_t no_llseek(struct file *file, loff_t offset, int origin); | 1753 | extern loff_t no_llseek(struct file *file, loff_t offset, int origin); |
| 1681 | extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin); | 1754 | extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin); |
| 1682 | extern loff_t remote_llseek(struct file *file, loff_t offset, int origin); | 1755 | extern loff_t remote_llseek(struct file *file, loff_t offset, int origin); |
| @@ -1712,6 +1785,7 @@ static inline void do_generic_file_read(struct file * filp, loff_t *ppos, | |||
| 1712 | actor); | 1785 | actor); |
| 1713 | } | 1786 | } |
| 1714 | 1787 | ||
| 1788 | #ifdef CONFIG_BLOCK | ||
| 1715 | ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, | 1789 | ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, |
| 1716 | struct block_device *bdev, const struct iovec *iov, loff_t offset, | 1790 | struct block_device *bdev, const struct iovec *iov, loff_t offset, |
| 1717 | unsigned long nr_segs, get_block_t get_block, dio_iodone_t end_io, | 1791 | unsigned long nr_segs, get_block_t get_block, dio_iodone_t end_io, |
| @@ -1749,6 +1823,7 @@ static inline ssize_t blockdev_direct_IO_own_locking(int rw, struct kiocb *iocb, | |||
| 1749 | return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset, | 1823 | return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset, |
| 1750 | nr_segs, get_block, end_io, DIO_OWN_LOCKING); | 1824 | nr_segs, get_block, end_io, DIO_OWN_LOCKING); |
| 1751 | } | 1825 | } |
| 1826 | #endif | ||
| 1752 | 1827 | ||
| 1753 | extern const struct file_operations generic_ro_fops; | 1828 | extern const struct file_operations generic_ro_fops; |
| 1754 | 1829 | ||
diff --git a/include/linux/generic_acl.h b/include/linux/generic_acl.h new file mode 100644 index 0000000000..80764f40be --- /dev/null +++ b/include/linux/generic_acl.h | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | /* | ||
| 2 | * fs/generic_acl.c | ||
| 3 | * | ||
| 4 | * (C) 2005 Andreas Gruenbacher <agruen@suse.de> | ||
| 5 | * | ||
| 6 | * This file is released under the GPL. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #ifndef GENERIC_ACL_H | ||
| 10 | #define GENERIC_ACL_H | ||
| 11 | |||
| 12 | #include <linux/posix_acl.h> | ||
| 13 | #include <linux/posix_acl_xattr.h> | ||
| 14 | |||
| 15 | /** | ||
| 16 | * struct generic_acl_operations - filesystem operations | ||
| 17 | * | ||
| 18 | * Filesystems must make these operations available to the generic | ||
| 19 | * operations. | ||
| 20 | */ | ||
| 21 | struct generic_acl_operations { | ||
| 22 | struct posix_acl *(*getacl)(struct inode *, int); | ||
| 23 | void (*setacl)(struct inode *, int, struct posix_acl *); | ||
| 24 | }; | ||
| 25 | |||
| 26 | size_t generic_acl_list(struct inode *, struct generic_acl_operations *, int, | ||
| 27 | char *, size_t); | ||
| 28 | int generic_acl_get(struct inode *, struct generic_acl_operations *, int, | ||
| 29 | void *, size_t); | ||
| 30 | int generic_acl_set(struct inode *, struct generic_acl_operations *, int, | ||
| 31 | const void *, size_t); | ||
| 32 | int generic_acl_init(struct inode *, struct inode *, | ||
| 33 | struct generic_acl_operations *); | ||
| 34 | int generic_acl_chmod(struct inode *, struct generic_acl_operations *); | ||
| 35 | |||
| 36 | #endif | ||
diff --git a/include/linux/genetlink.h b/include/linux/genetlink.h index 84f12a41dc..9049dc65ae 100644 --- a/include/linux/genetlink.h +++ b/include/linux/genetlink.h | |||
| @@ -16,6 +16,8 @@ struct genlmsghdr { | |||
| 16 | 16 | ||
| 17 | #define GENL_HDRLEN NLMSG_ALIGN(sizeof(struct genlmsghdr)) | 17 | #define GENL_HDRLEN NLMSG_ALIGN(sizeof(struct genlmsghdr)) |
| 18 | 18 | ||
| 19 | #define GENL_ADMIN_PERM 0x01 | ||
| 20 | |||
| 19 | /* | 21 | /* |
| 20 | * List of reserved static generic netlink identifiers: | 22 | * List of reserved static generic netlink identifiers: |
| 21 | */ | 23 | */ |
| @@ -43,9 +45,25 @@ enum { | |||
| 43 | CTRL_ATTR_UNSPEC, | 45 | CTRL_ATTR_UNSPEC, |
| 44 | CTRL_ATTR_FAMILY_ID, | 46 | CTRL_ATTR_FAMILY_ID, |
| 45 | CTRL_ATTR_FAMILY_NAME, | 47 | CTRL_ATTR_FAMILY_NAME, |
| 48 | CTRL_ATTR_VERSION, | ||
| 49 | CTRL_ATTR_HDRSIZE, | ||
| 50 | CTRL_ATTR_MAXATTR, | ||
| 51 | CTRL_ATTR_OPS, | ||
| 46 | __CTRL_ATTR_MAX, | 52 | __CTRL_ATTR_MAX, |
| 47 | }; | 53 | }; |
| 48 | 54 | ||
| 49 | #define CTRL_ATTR_MAX (__CTRL_ATTR_MAX - 1) | 55 | #define CTRL_ATTR_MAX (__CTRL_ATTR_MAX - 1) |
| 50 | 56 | ||
| 57 | enum { | ||
| 58 | CTRL_ATTR_OP_UNSPEC, | ||
| 59 | CTRL_ATTR_OP_ID, | ||
| 60 | CTRL_ATTR_OP_FLAGS, | ||
| 61 | CTRL_ATTR_OP_POLICY, | ||
| 62 | CTRL_ATTR_OP_DOIT, | ||
| 63 | CTRL_ATTR_OP_DUMPIT, | ||
| 64 | __CTRL_ATTR_OP_MAX, | ||
| 65 | }; | ||
| 66 | |||
| 67 | #define CTRL_ATTR_OP_MAX (__CTRL_ATTR_OP_MAX - 1) | ||
| 68 | |||
| 51 | #endif /* __LINUX_GENERIC_NETLINK_H */ | 69 | #endif /* __LINUX_GENERIC_NETLINK_H */ |
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index e4af57e87c..41f276fdd1 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
| @@ -11,6 +11,8 @@ | |||
| 11 | 11 | ||
| 12 | #include <linux/types.h> | 12 | #include <linux/types.h> |
| 13 | 13 | ||
| 14 | #ifdef CONFIG_BLOCK | ||
| 15 | |||
| 14 | enum { | 16 | enum { |
| 15 | /* These three have identical behaviour; use the second one if DOS FDISK gets | 17 | /* These three have identical behaviour; use the second one if DOS FDISK gets |
| 16 | confused about extended/logical partitions starting past cylinder 1023. */ | 18 | confused about extended/logical partitions starting past cylinder 1023. */ |
| @@ -420,3 +422,5 @@ static inline struct block_device *bdget_disk(struct gendisk *disk, int index) | |||
| 420 | #endif | 422 | #endif |
| 421 | 423 | ||
| 422 | #endif | 424 | #endif |
| 425 | |||
| 426 | #endif | ||
diff --git a/include/linux/getcpu.h b/include/linux/getcpu.h new file mode 100644 index 0000000000..c7372d7a97 --- /dev/null +++ b/include/linux/getcpu.h | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | #ifndef _LINUX_GETCPU_H | ||
| 2 | #define _LINUX_GETCPU_H 1 | ||
| 3 | |||
| 4 | /* Cache for getcpu() to speed it up. Results might be a short time | ||
| 5 | out of date, but will be faster. | ||
| 6 | |||
| 7 | User programs should not refer to the contents of this structure. | ||
| 8 | I repeat they should not refer to it. If they do they will break | ||
| 9 | in future kernels. | ||
| 10 | |||
| 11 | It is only a private cache for vgetcpu(). It will change in future kernels. | ||
| 12 | The user program must store this information per thread (__thread) | ||
| 13 | If you want 100% accurate information pass NULL instead. */ | ||
| 14 | struct getcpu_cache { | ||
| 15 | unsigned long blob[128 / sizeof(long)]; | ||
| 16 | }; | ||
| 17 | |||
| 18 | #endif | ||
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index cc9e608444..bf2b6bc3f6 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
| @@ -9,17 +9,16 @@ struct vm_area_struct; | |||
| 9 | 9 | ||
| 10 | /* | 10 | /* |
| 11 | * GFP bitmasks.. | 11 | * GFP bitmasks.. |
| 12 | * | ||
| 13 | * Zone modifiers (see linux/mmzone.h - low three bits) | ||
| 14 | * | ||
| 15 | * Do not put any conditional on these. If necessary modify the definitions | ||
| 16 | * without the underscores and use the consistently. The definitions here may | ||
| 17 | * be used in bit comparisons. | ||
| 12 | */ | 18 | */ |
| 13 | /* Zone modifiers in GFP_ZONEMASK (see linux/mmzone.h - low three bits) */ | ||
| 14 | #define __GFP_DMA ((__force gfp_t)0x01u) | 19 | #define __GFP_DMA ((__force gfp_t)0x01u) |
| 15 | #define __GFP_HIGHMEM ((__force gfp_t)0x02u) | 20 | #define __GFP_HIGHMEM ((__force gfp_t)0x02u) |
| 16 | #ifdef CONFIG_DMA_IS_DMA32 | 21 | #define __GFP_DMA32 ((__force gfp_t)0x04u) |
| 17 | #define __GFP_DMA32 ((__force gfp_t)0x01) /* ZONE_DMA is ZONE_DMA32 */ | ||
| 18 | #elif BITS_PER_LONG < 64 | ||
| 19 | #define __GFP_DMA32 ((__force gfp_t)0x00) /* ZONE_NORMAL is ZONE_DMA32 */ | ||
| 20 | #else | ||
| 21 | #define __GFP_DMA32 ((__force gfp_t)0x04) /* Has own ZONE_DMA32 */ | ||
| 22 | #endif | ||
| 23 | 22 | ||
| 24 | /* | 23 | /* |
| 25 | * Action modifiers - doesn't change the zoning | 24 | * Action modifiers - doesn't change the zoning |
| @@ -46,6 +45,7 @@ struct vm_area_struct; | |||
| 46 | #define __GFP_ZERO ((__force gfp_t)0x8000u)/* Return zeroed page on success */ | 45 | #define __GFP_ZERO ((__force gfp_t)0x8000u)/* Return zeroed page on success */ |
| 47 | #define __GFP_NOMEMALLOC ((__force gfp_t)0x10000u) /* Don't use emergency reserves */ | 46 | #define __GFP_NOMEMALLOC ((__force gfp_t)0x10000u) /* Don't use emergency reserves */ |
| 48 | #define __GFP_HARDWALL ((__force gfp_t)0x20000u) /* Enforce hardwall cpuset memory allocs */ | 47 | #define __GFP_HARDWALL ((__force gfp_t)0x20000u) /* Enforce hardwall cpuset memory allocs */ |
| 48 | #define __GFP_THISNODE ((__force gfp_t)0x40000u)/* No fallback, no policies */ | ||
| 49 | 49 | ||
| 50 | #define __GFP_BITS_SHIFT 20 /* Room for 20 __GFP_FOO bits */ | 50 | #define __GFP_BITS_SHIFT 20 /* Room for 20 __GFP_FOO bits */ |
| 51 | #define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1)) | 51 | #define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1)) |
| @@ -54,7 +54,7 @@ struct vm_area_struct; | |||
| 54 | #define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| \ | 54 | #define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| \ |
| 55 | __GFP_COLD|__GFP_NOWARN|__GFP_REPEAT| \ | 55 | __GFP_COLD|__GFP_NOWARN|__GFP_REPEAT| \ |
| 56 | __GFP_NOFAIL|__GFP_NORETRY|__GFP_NO_GROW|__GFP_COMP| \ | 56 | __GFP_NOFAIL|__GFP_NORETRY|__GFP_NO_GROW|__GFP_COMP| \ |
| 57 | __GFP_NOMEMALLOC|__GFP_HARDWALL) | 57 | __GFP_NOMEMALLOC|__GFP_HARDWALL|__GFP_THISNODE) |
| 58 | 58 | ||
| 59 | /* This equals 0, but use constants in case they ever change */ | 59 | /* This equals 0, but use constants in case they ever change */ |
| 60 | #define GFP_NOWAIT (GFP_ATOMIC & ~__GFP_HIGH) | 60 | #define GFP_NOWAIT (GFP_ATOMIC & ~__GFP_HIGH) |
| @@ -67,6 +67,13 @@ struct vm_area_struct; | |||
| 67 | #define GFP_HIGHUSER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL | \ | 67 | #define GFP_HIGHUSER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL | \ |
| 68 | __GFP_HIGHMEM) | 68 | __GFP_HIGHMEM) |
| 69 | 69 | ||
| 70 | #ifdef CONFIG_NUMA | ||
| 71 | #define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY) | ||
| 72 | #else | ||
| 73 | #define GFP_THISNODE 0 | ||
| 74 | #endif | ||
| 75 | |||
| 76 | |||
| 70 | /* Flag - indicates that the buffer will be suitable for DMA. Ignored on some | 77 | /* Flag - indicates that the buffer will be suitable for DMA. Ignored on some |
| 71 | platforms, used as appropriate on others */ | 78 | platforms, used as appropriate on others */ |
| 72 | 79 | ||
| @@ -76,11 +83,19 @@ struct vm_area_struct; | |||
| 76 | #define GFP_DMA32 __GFP_DMA32 | 83 | #define GFP_DMA32 __GFP_DMA32 |
| 77 | 84 | ||
| 78 | 85 | ||
| 79 | static inline int gfp_zone(gfp_t gfp) | 86 | static inline enum zone_type gfp_zone(gfp_t flags) |
| 80 | { | 87 | { |
| 81 | int zone = GFP_ZONEMASK & (__force int) gfp; | 88 | if (flags & __GFP_DMA) |
| 82 | BUG_ON(zone >= GFP_ZONETYPES); | 89 | return ZONE_DMA; |
| 83 | return zone; | 90 | #ifdef CONFIG_ZONE_DMA32 |
| 91 | if (flags & __GFP_DMA32) | ||
| 92 | return ZONE_DMA32; | ||
| 93 | #endif | ||
| 94 | #ifdef CONFIG_HIGHMEM | ||
| 95 | if (flags & __GFP_HIGHMEM) | ||
| 96 | return ZONE_HIGHMEM; | ||
| 97 | #endif | ||
| 98 | return ZONE_NORMAL; | ||
| 84 | } | 99 | } |
| 85 | 100 | ||
| 86 | /* | 101 | /* |
diff --git a/include/linux/hdlc.h b/include/linux/hdlc.h index d5ebbb29ae..d4b333938f 100644 --- a/include/linux/hdlc.h +++ b/include/linux/hdlc.h | |||
| @@ -11,95 +11,46 @@ | |||
| 11 | #ifndef __HDLC_H | 11 | #ifndef __HDLC_H |
| 12 | #define __HDLC_H | 12 | #define __HDLC_H |
| 13 | 13 | ||
| 14 | #define GENERIC_HDLC_VERSION 4 /* For synchronization with sethdlc utility */ | ||
| 15 | |||
| 16 | #define CLOCK_DEFAULT 0 /* Default setting */ | ||
| 17 | #define CLOCK_EXT 1 /* External TX and RX clock - DTE */ | ||
| 18 | #define CLOCK_INT 2 /* Internal TX and RX clock - DCE */ | ||
| 19 | #define CLOCK_TXINT 3 /* Internal TX and external RX clock */ | ||
| 20 | #define CLOCK_TXFROMRX 4 /* TX clock derived from external RX clock */ | ||
| 21 | |||
| 22 | |||
| 23 | #define ENCODING_DEFAULT 0 /* Default setting */ | ||
| 24 | #define ENCODING_NRZ 1 | ||
| 25 | #define ENCODING_NRZI 2 | ||
| 26 | #define ENCODING_FM_MARK 3 | ||
| 27 | #define ENCODING_FM_SPACE 4 | ||
| 28 | #define ENCODING_MANCHESTER 5 | ||
| 29 | |||
| 30 | |||
| 31 | #define PARITY_DEFAULT 0 /* Default setting */ | ||
| 32 | #define PARITY_NONE 1 /* No parity */ | ||
| 33 | #define PARITY_CRC16_PR0 2 /* CRC16, initial value 0x0000 */ | ||
| 34 | #define PARITY_CRC16_PR1 3 /* CRC16, initial value 0xFFFF */ | ||
| 35 | #define PARITY_CRC16_PR0_CCITT 4 /* CRC16, initial 0x0000, ITU-T version */ | ||
| 36 | #define PARITY_CRC16_PR1_CCITT 5 /* CRC16, initial 0xFFFF, ITU-T version */ | ||
| 37 | #define PARITY_CRC32_PR0_CCITT 6 /* CRC32, initial value 0x00000000 */ | ||
| 38 | #define PARITY_CRC32_PR1_CCITT 7 /* CRC32, initial value 0xFFFFFFFF */ | ||
| 39 | |||
| 40 | #define LMI_DEFAULT 0 /* Default setting */ | ||
| 41 | #define LMI_NONE 1 /* No LMI, all PVCs are static */ | ||
| 42 | #define LMI_ANSI 2 /* ANSI Annex D */ | ||
| 43 | #define LMI_CCITT 3 /* ITU-T Annex A */ | ||
| 44 | #define LMI_CISCO 4 /* The "original" LMI, aka Gang of Four */ | ||
| 45 | 14 | ||
| 46 | #define HDLC_MAX_MTU 1500 /* Ethernet 1500 bytes */ | 15 | #define HDLC_MAX_MTU 1500 /* Ethernet 1500 bytes */ |
| 16 | #if 0 | ||
| 47 | #define HDLC_MAX_MRU (HDLC_MAX_MTU + 10 + 14 + 4) /* for ETH+VLAN over FR */ | 17 | #define HDLC_MAX_MRU (HDLC_MAX_MTU + 10 + 14 + 4) /* for ETH+VLAN over FR */ |
| 18 | #else | ||
| 19 | #define HDLC_MAX_MRU 1600 /* as required for FR network */ | ||
| 20 | #endif | ||
| 48 | 21 | ||
| 49 | 22 | ||
| 50 | #ifdef __KERNEL__ | 23 | #ifdef __KERNEL__ |
| 51 | 24 | ||
| 52 | #include <linux/skbuff.h> | 25 | #include <linux/skbuff.h> |
| 53 | #include <linux/netdevice.h> | 26 | #include <linux/netdevice.h> |
| 54 | #include <net/syncppp.h> | ||
| 55 | #include <linux/hdlc/ioctl.h> | 27 | #include <linux/hdlc/ioctl.h> |
| 56 | 28 | ||
| 57 | 29 | ||
| 58 | typedef struct { /* Used in Cisco and PPP mode */ | 30 | /* Used by all network devices here, pointed to by netdev_priv(dev) */ |
| 59 | u8 address; | 31 | struct hdlc_device_desc { |
| 60 | u8 control; | 32 | int (*netif_rx)(struct sk_buff *skb); |
| 61 | u16 protocol; | ||
| 62 | }__attribute__ ((packed)) hdlc_header; | ||
| 63 | |||
| 64 | |||
| 65 | |||
| 66 | typedef struct { | ||
| 67 | u32 type; /* code */ | ||
| 68 | u32 par1; | ||
| 69 | u32 par2; | ||
| 70 | u16 rel; /* reliability */ | ||
| 71 | u32 time; | ||
| 72 | }__attribute__ ((packed)) cisco_packet; | ||
| 73 | #define CISCO_PACKET_LEN 18 | ||
| 74 | #define CISCO_BIG_PACKET_LEN 20 | ||
| 75 | |||
| 76 | |||
| 77 | |||
| 78 | typedef struct pvc_device_struct { | ||
| 79 | struct net_device *master; | ||
| 80 | struct net_device *main; | ||
| 81 | struct net_device *ether; /* bridged Ethernet interface */ | ||
| 82 | struct pvc_device_struct *next; /* Sorted in ascending DLCI order */ | ||
| 83 | int dlci; | ||
| 84 | int open_count; | ||
| 85 | |||
| 86 | struct { | ||
| 87 | unsigned int new: 1; | ||
| 88 | unsigned int active: 1; | ||
| 89 | unsigned int exist: 1; | ||
| 90 | unsigned int deleted: 1; | ||
| 91 | unsigned int fecn: 1; | ||
| 92 | unsigned int becn: 1; | ||
| 93 | unsigned int bandwidth; /* Cisco LMI reporting only */ | ||
| 94 | }state; | ||
| 95 | }pvc_device; | ||
| 96 | |||
| 97 | |||
| 98 | |||
| 99 | typedef struct hdlc_device_struct { | ||
| 100 | /* To be initialized by hardware driver */ | ||
| 101 | struct net_device_stats stats; | 33 | struct net_device_stats stats; |
| 102 | 34 | }; | |
| 35 | |||
| 36 | /* This structure is a private property of HDLC protocols. | ||
| 37 | Hardware drivers have no interest here */ | ||
| 38 | |||
| 39 | struct hdlc_proto { | ||
| 40 | int (*open)(struct net_device *dev); | ||
| 41 | void (*close)(struct net_device *dev); | ||
| 42 | void (*start)(struct net_device *dev); /* if open & DCD */ | ||
| 43 | void (*stop)(struct net_device *dev); /* if open & !DCD */ | ||
| 44 | void (*detach)(struct net_device *dev); | ||
| 45 | int (*ioctl)(struct net_device *dev, struct ifreq *ifr); | ||
| 46 | unsigned short (*type_trans)(struct sk_buff *skb, | ||
| 47 | struct net_device *dev); | ||
| 48 | struct module *module; | ||
| 49 | struct hdlc_proto *next; /* next protocol in the list */ | ||
| 50 | }; | ||
| 51 | |||
| 52 | |||
| 53 | typedef struct hdlc_device { | ||
| 103 | /* used by HDLC layer to take control over HDLC device from hw driver*/ | 54 | /* used by HDLC layer to take control over HDLC device from hw driver*/ |
| 104 | int (*attach)(struct net_device *dev, | 55 | int (*attach)(struct net_device *dev, |
| 105 | unsigned short encoding, unsigned short parity); | 56 | unsigned short encoding, unsigned short parity); |
| @@ -107,82 +58,18 @@ typedef struct hdlc_device_struct { | |||
| 107 | /* hardware driver must handle this instead of dev->hard_start_xmit */ | 58 | /* hardware driver must handle this instead of dev->hard_start_xmit */ |
| 108 | int (*xmit)(struct sk_buff *skb, struct net_device *dev); | 59 | int (*xmit)(struct sk_buff *skb, struct net_device *dev); |
| 109 | 60 | ||
| 110 | |||
| 111 | /* Things below are for HDLC layer internal use only */ | 61 | /* Things below are for HDLC layer internal use only */ |
| 112 | struct { | 62 | const struct hdlc_proto *proto; |
| 113 | int (*open)(struct net_device *dev); | ||
| 114 | void (*close)(struct net_device *dev); | ||
| 115 | |||
| 116 | /* if open & DCD */ | ||
| 117 | void (*start)(struct net_device *dev); | ||
| 118 | /* if open & !DCD */ | ||
| 119 | void (*stop)(struct net_device *dev); | ||
| 120 | |||
| 121 | void (*detach)(struct hdlc_device_struct *hdlc); | ||
| 122 | int (*netif_rx)(struct sk_buff *skb); | ||
| 123 | unsigned short (*type_trans)(struct sk_buff *skb, | ||
| 124 | struct net_device *dev); | ||
| 125 | int id; /* IF_PROTO_HDLC/CISCO/FR/etc. */ | ||
| 126 | }proto; | ||
| 127 | |||
| 128 | int carrier; | 63 | int carrier; |
| 129 | int open; | 64 | int open; |
| 130 | spinlock_t state_lock; | 65 | spinlock_t state_lock; |
| 131 | 66 | void *state; | |
| 132 | union { | ||
| 133 | struct { | ||
| 134 | fr_proto settings; | ||
| 135 | pvc_device *first_pvc; | ||
| 136 | int dce_pvc_count; | ||
| 137 | |||
| 138 | struct timer_list timer; | ||
| 139 | unsigned long last_poll; | ||
| 140 | int reliable; | ||
| 141 | int dce_changed; | ||
| 142 | int request; | ||
| 143 | int fullrep_sent; | ||
| 144 | u32 last_errors; /* last errors bit list */ | ||
| 145 | u8 n391cnt; | ||
| 146 | u8 txseq; /* TX sequence number */ | ||
| 147 | u8 rxseq; /* RX sequence number */ | ||
| 148 | }fr; | ||
| 149 | |||
| 150 | struct { | ||
| 151 | cisco_proto settings; | ||
| 152 | |||
| 153 | struct timer_list timer; | ||
| 154 | unsigned long last_poll; | ||
| 155 | int up; | ||
| 156 | int request_sent; | ||
| 157 | u32 txseq; /* TX sequence number */ | ||
| 158 | u32 rxseq; /* RX sequence number */ | ||
| 159 | }cisco; | ||
| 160 | |||
| 161 | struct { | ||
| 162 | raw_hdlc_proto settings; | ||
| 163 | }raw_hdlc; | ||
| 164 | |||
| 165 | struct { | ||
| 166 | struct ppp_device pppdev; | ||
| 167 | struct ppp_device *syncppp_ptr; | ||
| 168 | int (*old_change_mtu)(struct net_device *dev, | ||
| 169 | int new_mtu); | ||
| 170 | }ppp; | ||
| 171 | }state; | ||
| 172 | void *priv; | 67 | void *priv; |
| 173 | }hdlc_device; | 68 | }hdlc_device; |
| 174 | 69 | ||
| 175 | 70 | ||
| 176 | 71 | ||
| 177 | int hdlc_raw_ioctl(struct net_device *dev, struct ifreq *ifr); | 72 | /* Exported from hdlc module */ |
| 178 | int hdlc_raw_eth_ioctl(struct net_device *dev, struct ifreq *ifr); | ||
| 179 | int hdlc_cisco_ioctl(struct net_device *dev, struct ifreq *ifr); | ||
| 180 | int hdlc_ppp_ioctl(struct net_device *dev, struct ifreq *ifr); | ||
| 181 | int hdlc_fr_ioctl(struct net_device *dev, struct ifreq *ifr); | ||
| 182 | int hdlc_x25_ioctl(struct net_device *dev, struct ifreq *ifr); | ||
| 183 | |||
| 184 | |||
| 185 | /* Exported from hdlc.o */ | ||
| 186 | 73 | ||
| 187 | /* Called by hardware driver when a user requests HDLC service */ | 74 | /* Called by hardware driver when a user requests HDLC service */ |
| 188 | int hdlc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd); | 75 | int hdlc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd); |
| @@ -191,17 +78,21 @@ int hdlc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd); | |||
| 191 | #define register_hdlc_device(dev) register_netdev(dev) | 78 | #define register_hdlc_device(dev) register_netdev(dev) |
| 192 | void unregister_hdlc_device(struct net_device *dev); | 79 | void unregister_hdlc_device(struct net_device *dev); |
| 193 | 80 | ||
| 81 | |||
| 82 | void register_hdlc_protocol(struct hdlc_proto *proto); | ||
| 83 | void unregister_hdlc_protocol(struct hdlc_proto *proto); | ||
| 84 | |||
| 194 | struct net_device *alloc_hdlcdev(void *priv); | 85 | struct net_device *alloc_hdlcdev(void *priv); |
| 195 | 86 | ||
| 196 | static __inline__ hdlc_device* dev_to_hdlc(struct net_device *dev) | 87 | |
| 88 | static __inline__ struct hdlc_device_desc* dev_to_desc(struct net_device *dev) | ||
| 197 | { | 89 | { |
| 198 | return netdev_priv(dev); | 90 | return netdev_priv(dev); |
| 199 | } | 91 | } |
| 200 | 92 | ||
| 201 | 93 | static __inline__ hdlc_device* dev_to_hdlc(struct net_device *dev) | |
| 202 | static __inline__ pvc_device* dev_to_pvc(struct net_device *dev) | ||
| 203 | { | 94 | { |
| 204 | return (pvc_device*)dev->priv; | 95 | return netdev_priv(dev) + sizeof(struct hdlc_device_desc); |
| 205 | } | 96 | } |
| 206 | 97 | ||
| 207 | 98 | ||
| @@ -225,18 +116,14 @@ int hdlc_open(struct net_device *dev); | |||
| 225 | /* Must be called by hardware driver when HDLC device is being closed */ | 116 | /* Must be called by hardware driver when HDLC device is being closed */ |
| 226 | void hdlc_close(struct net_device *dev); | 117 | void hdlc_close(struct net_device *dev); |
| 227 | 118 | ||
| 119 | int attach_hdlc_protocol(struct net_device *dev, struct hdlc_proto *proto, | ||
| 120 | int (*rx)(struct sk_buff *skb), size_t size); | ||
| 228 | /* May be used by hardware driver to gain control over HDLC device */ | 121 | /* May be used by hardware driver to gain control over HDLC device */ |
| 229 | static __inline__ void hdlc_proto_detach(hdlc_device *hdlc) | 122 | void detach_hdlc_protocol(struct net_device *dev); |
| 230 | { | ||
| 231 | if (hdlc->proto.detach) | ||
| 232 | hdlc->proto.detach(hdlc); | ||
| 233 | hdlc->proto.detach = NULL; | ||
| 234 | } | ||
| 235 | |||
| 236 | 123 | ||
| 237 | static __inline__ struct net_device_stats *hdlc_stats(struct net_device *dev) | 124 | static __inline__ struct net_device_stats *hdlc_stats(struct net_device *dev) |
| 238 | { | 125 | { |
| 239 | return &dev_to_hdlc(dev)->stats; | 126 | return &dev_to_desc(dev)->stats; |
| 240 | } | 127 | } |
| 241 | 128 | ||
| 242 | 129 | ||
| @@ -248,8 +135,8 @@ static __inline__ __be16 hdlc_type_trans(struct sk_buff *skb, | |||
| 248 | skb->mac.raw = skb->data; | 135 | skb->mac.raw = skb->data; |
| 249 | skb->dev = dev; | 136 | skb->dev = dev; |
| 250 | 137 | ||
| 251 | if (hdlc->proto.type_trans) | 138 | if (hdlc->proto->type_trans) |
| 252 | return hdlc->proto.type_trans(skb, dev); | 139 | return hdlc->proto->type_trans(skb, dev); |
| 253 | else | 140 | else |
| 254 | return htons(ETH_P_HDLC); | 141 | return htons(ETH_P_HDLC); |
| 255 | } | 142 | } |
diff --git a/include/linux/hdlc/ioctl.h b/include/linux/hdlc/ioctl.h index 78430ba3ea..5839723643 100644 --- a/include/linux/hdlc/ioctl.h +++ b/include/linux/hdlc/ioctl.h | |||
| @@ -1,6 +1,39 @@ | |||
| 1 | #ifndef __HDLC_IOCTL_H__ | 1 | #ifndef __HDLC_IOCTL_H__ |
| 2 | #define __HDLC_IOCTL_H__ | 2 | #define __HDLC_IOCTL_H__ |
| 3 | 3 | ||
| 4 | |||
| 5 | #define GENERIC_HDLC_VERSION 4 /* For synchronization with sethdlc utility */ | ||
| 6 | |||
| 7 | #define CLOCK_DEFAULT 0 /* Default setting */ | ||
| 8 | #define CLOCK_EXT 1 /* External TX and RX clock - DTE */ | ||
| 9 | #define CLOCK_INT 2 /* Internal TX and RX clock - DCE */ | ||
| 10 | #define CLOCK_TXINT 3 /* Internal TX and external RX clock */ | ||
| 11 | #define CLOCK_TXFROMRX 4 /* TX clock derived from external RX clock */ | ||
| 12 | |||
| 13 | |||
| 14 | #define ENCODING_DEFAULT 0 /* Default setting */ | ||
| 15 | #define ENCODING_NRZ 1 | ||
| 16 | #define ENCODING_NRZI 2 | ||
| 17 | #define ENCODING_FM_MARK 3 | ||
| 18 | #define ENCODING_FM_SPACE 4 | ||
| 19 | #define ENCODING_MANCHESTER 5 | ||
| 20 | |||
| 21 | |||
| 22 | #define PARITY_DEFAULT 0 /* Default setting */ | ||
| 23 | #define PARITY_NONE 1 /* No parity */ | ||
| 24 | #define PARITY_CRC16_PR0 2 /* CRC16, initial value 0x0000 */ | ||
| 25 | #define PARITY_CRC16_PR1 3 /* CRC16, initial value 0xFFFF */ | ||
| 26 | #define PARITY_CRC16_PR0_CCITT 4 /* CRC16, initial 0x0000, ITU-T version */ | ||
| 27 | #define PARITY_CRC16_PR1_CCITT 5 /* CRC16, initial 0xFFFF, ITU-T version */ | ||
| 28 | #define PARITY_CRC32_PR0_CCITT 6 /* CRC32, initial value 0x00000000 */ | ||
| 29 | #define PARITY_CRC32_PR1_CCITT 7 /* CRC32, initial value 0xFFFFFFFF */ | ||
| 30 | |||
| 31 | #define LMI_DEFAULT 0 /* Default setting */ | ||
| 32 | #define LMI_NONE 1 /* No LMI, all PVCs are static */ | ||
| 33 | #define LMI_ANSI 2 /* ANSI Annex D */ | ||
| 34 | #define LMI_CCITT 3 /* ITU-T Annex A */ | ||
| 35 | #define LMI_CISCO 4 /* The "original" LMI, aka Gang of Four */ | ||
| 36 | |||
| 4 | typedef struct { | 37 | typedef struct { |
| 5 | unsigned int clock_rate; /* bits per second */ | 38 | unsigned int clock_rate; /* bits per second */ |
| 6 | unsigned int clock_type; /* internal, external, TX-internal etc. */ | 39 | unsigned int clock_type; /* internal, external, TX-internal etc. */ |
diff --git a/include/linux/highmem.h b/include/linux/highmem.h index 85ce7ef9a5..fd7d12daa9 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h | |||
| @@ -24,11 +24,15 @@ static inline void flush_kernel_dcache_page(struct page *page) | |||
| 24 | 24 | ||
| 25 | /* declarations for linux/mm/highmem.c */ | 25 | /* declarations for linux/mm/highmem.c */ |
| 26 | unsigned int nr_free_highpages(void); | 26 | unsigned int nr_free_highpages(void); |
| 27 | extern unsigned long totalhigh_pages; | ||
| 27 | 28 | ||
| 28 | #else /* CONFIG_HIGHMEM */ | 29 | #else /* CONFIG_HIGHMEM */ |
| 29 | 30 | ||
| 30 | static inline unsigned int nr_free_highpages(void) { return 0; } | 31 | static inline unsigned int nr_free_highpages(void) { return 0; } |
| 31 | 32 | ||
| 33 | #define totalhigh_pages 0 | ||
| 34 | |||
| 35 | #ifndef ARCH_HAS_KMAP | ||
| 32 | static inline void *kmap(struct page *page) | 36 | static inline void *kmap(struct page *page) |
| 33 | { | 37 | { |
| 34 | might_sleep(); | 38 | might_sleep(); |
| @@ -41,6 +45,7 @@ static inline void *kmap(struct page *page) | |||
| 41 | #define kunmap_atomic(addr, idx) do { } while (0) | 45 | #define kunmap_atomic(addr, idx) do { } while (0) |
| 42 | #define kmap_atomic_pfn(pfn, idx) page_address(pfn_to_page(pfn)) | 46 | #define kmap_atomic_pfn(pfn, idx) page_address(pfn_to_page(pfn)) |
| 43 | #define kmap_atomic_to_page(ptr) virt_to_page(ptr) | 47 | #define kmap_atomic_to_page(ptr) virt_to_page(ptr) |
| 48 | #endif | ||
| 44 | 49 | ||
| 45 | #endif /* CONFIG_HIGHMEM */ | 50 | #endif /* CONFIG_HIGHMEM */ |
| 46 | 51 | ||
diff --git a/include/linux/hpfs_fs.h b/include/linux/hpfs_fs.h deleted file mode 100644 index a5028dd94d..0000000000 --- a/include/linux/hpfs_fs.h +++ /dev/null | |||
| @@ -1,8 +0,0 @@ | |||
| 1 | #ifndef _LINUX_HPFS_FS_H | ||
| 2 | #define _LINUX_HPFS_FS_H | ||
| 3 | |||
| 4 | /* HPFS magic number (word 0 of block 16) */ | ||
| 5 | |||
| 6 | #define HPFS_SUPER_MAGIC 0xf995e849 | ||
| 7 | |||
| 8 | #endif | ||
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 4fc379de6c..fca93025ab 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h | |||
| @@ -138,6 +138,7 @@ extern long hrtimer_nanosleep(struct timespec *rqtp, | |||
| 138 | struct timespec __user *rmtp, | 138 | struct timespec __user *rmtp, |
| 139 | const enum hrtimer_mode mode, | 139 | const enum hrtimer_mode mode, |
| 140 | const clockid_t clockid); | 140 | const clockid_t clockid); |
| 141 | extern long hrtimer_nanosleep_restart(struct restart_block *restart_block); | ||
| 141 | 142 | ||
| 142 | extern void hrtimer_init_sleeper(struct hrtimer_sleeper *sl, | 143 | extern void hrtimer_init_sleeper(struct hrtimer_sleeper *sl, |
| 143 | struct task_struct *tsk); | 144 | struct task_struct *tsk); |
diff --git a/include/linux/i2c-algo-bit.h b/include/linux/i2c-algo-bit.h index c0e7fab28c..c8f8df25c7 100644 --- a/include/linux/i2c-algo-bit.h +++ b/include/linux/i2c-algo-bit.h | |||
| @@ -40,7 +40,6 @@ struct i2c_algo_bit_data { | |||
| 40 | /* local settings */ | 40 | /* local settings */ |
| 41 | int udelay; /* half-clock-cycle time in microsecs */ | 41 | int udelay; /* half-clock-cycle time in microsecs */ |
| 42 | /* i.e. clock is (500 / udelay) KHz */ | 42 | /* i.e. clock is (500 / udelay) KHz */ |
| 43 | int mdelay; /* in millisecs, unused */ | ||
| 44 | int timeout; /* in jiffies */ | 43 | int timeout; /* in jiffies */ |
| 45 | }; | 44 | }; |
| 46 | 45 | ||
diff --git a/include/linux/i2c-algo-pcf.h b/include/linux/i2c-algo-pcf.h index 18b0adf57a..9908f3fc48 100644 --- a/include/linux/i2c-algo-pcf.h +++ b/include/linux/i2c-algo-pcf.h | |||
| @@ -35,7 +35,6 @@ struct i2c_algo_pcf_data { | |||
| 35 | 35 | ||
| 36 | /* local settings */ | 36 | /* local settings */ |
| 37 | int udelay; | 37 | int udelay; |
| 38 | int mdelay; | ||
| 39 | int timeout; | 38 | int timeout; |
| 40 | }; | 39 | }; |
| 41 | 40 | ||
diff --git a/include/linux/i2c-algo-sibyte.h b/include/linux/i2c-algo-sibyte.h deleted file mode 100644 index 03914ded86..0000000000 --- a/include/linux/i2c-algo-sibyte.h +++ /dev/null | |||
| @@ -1,33 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2001,2002,2003 Broadcom Corporation | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or | ||
| 5 | * modify it under the terms of the GNU General Public License | ||
| 6 | * as published by the Free Software Foundation; either version 2 | ||
| 7 | * of the License, or (at your option) any later version. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope that it will be useful, | ||
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | * GNU General Public License for more details. | ||
| 13 | * | ||
| 14 | * You should have received a copy of the GNU General Public License | ||
| 15 | * along with this program; if not, write to the Free Software | ||
| 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
| 17 | */ | ||
| 18 | |||
| 19 | #ifndef I2C_ALGO_SIBYTE_H | ||
| 20 | #define I2C_ALGO_SIBYTE_H 1 | ||
| 21 | |||
| 22 | #include <linux/i2c.h> | ||
| 23 | |||
| 24 | struct i2c_algo_sibyte_data { | ||
| 25 | void *data; /* private data */ | ||
| 26 | int bus; /* which bus */ | ||
| 27 | void *reg_base; /* CSR base */ | ||
| 28 | }; | ||
| 29 | |||
| 30 | int i2c_sibyte_add_bus(struct i2c_adapter *, int speed); | ||
| 31 | int i2c_sibyte_del_bus(struct i2c_adapter *); | ||
| 32 | |||
| 33 | #endif /* I2C_ALGO_SIBYTE_H */ | ||
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index 9418519a55..0a8f750cbe 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h | |||
| @@ -193,6 +193,7 @@ | |||
| 193 | #define I2C_HW_B_RADEON 0x01001e /* radeon framebuffer driver */ | 193 | #define I2C_HW_B_RADEON 0x01001e /* radeon framebuffer driver */ |
| 194 | #define I2C_HW_B_EM28XX 0x01001f /* em28xx video capture cards */ | 194 | #define I2C_HW_B_EM28XX 0x01001f /* em28xx video capture cards */ |
| 195 | #define I2C_HW_B_CX2341X 0x010020 /* Conexant CX2341X MPEG encoder cards */ | 195 | #define I2C_HW_B_CX2341X 0x010020 /* Conexant CX2341X MPEG encoder cards */ |
| 196 | #define I2C_HW_B_INTELFB 0x010021 /* intel framebuffer driver */ | ||
| 196 | 197 | ||
| 197 | /* --- PCF 8584 based algorithms */ | 198 | /* --- PCF 8584 based algorithms */ |
| 198 | #define I2C_HW_P_LP 0x020000 /* Parallel port interface */ | 199 | #define I2C_HW_P_LP 0x020000 /* Parallel port interface */ |
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index eb0628a7ec..9b5d04768c 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
| @@ -64,14 +64,6 @@ extern int i2c_master_recv(struct i2c_client *,char* ,int); | |||
| 64 | */ | 64 | */ |
| 65 | extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num); | 65 | extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num); |
| 66 | 66 | ||
| 67 | /* | ||
| 68 | * Some adapter types (i.e. PCF 8584 based ones) may support slave behaviuor. | ||
| 69 | * This is not tested/implemented yet and will change in the future. | ||
| 70 | */ | ||
| 71 | extern int i2c_slave_send(struct i2c_client *,char*,int); | ||
| 72 | extern int i2c_slave_recv(struct i2c_client *,char*,int); | ||
| 73 | |||
| 74 | |||
| 75 | 67 | ||
| 76 | /* This is the very generalized SMBus access routine. You probably do not | 68 | /* This is the very generalized SMBus access routine. You probably do not |
| 77 | want to use this, though; one of the functions below may be much easier, | 69 | want to use this, though; one of the functions below may be much easier, |
| @@ -201,10 +193,6 @@ struct i2c_algorithm { | |||
| 201 | unsigned short flags, char read_write, | 193 | unsigned short flags, char read_write, |
| 202 | u8 command, int size, union i2c_smbus_data * data); | 194 | u8 command, int size, union i2c_smbus_data * data); |
| 203 | 195 | ||
| 204 | /* --- these optional/future use for some adapter types.*/ | ||
| 205 | int (*slave_send)(struct i2c_adapter *,char*,int); | ||
| 206 | int (*slave_recv)(struct i2c_adapter *,char*,int); | ||
| 207 | |||
| 208 | /* --- ioctl like call to set div. parameters. */ | 196 | /* --- ioctl like call to set div. parameters. */ |
| 209 | int (*algo_control)(struct i2c_adapter *, unsigned int, unsigned long); | 197 | int (*algo_control)(struct i2c_adapter *, unsigned int, unsigned long); |
| 210 | 198 | ||
| @@ -220,7 +208,7 @@ struct i2c_adapter { | |||
| 220 | struct module *owner; | 208 | struct module *owner; |
| 221 | unsigned int id; | 209 | unsigned int id; |
| 222 | unsigned int class; | 210 | unsigned int class; |
| 223 | struct i2c_algorithm *algo;/* the algorithm to access the bus */ | 211 | const struct i2c_algorithm *algo; /* the algorithm to access the bus */ |
| 224 | void *algo_data; | 212 | void *algo_data; |
| 225 | 213 | ||
| 226 | /* --- administration stuff. */ | 214 | /* --- administration stuff. */ |
diff --git a/include/linux/icmp.h b/include/linux/icmp.h index f0b571f106..878cfe4e58 100644 --- a/include/linux/icmp.h +++ b/include/linux/icmp.h | |||
| @@ -68,16 +68,16 @@ | |||
| 68 | struct icmphdr { | 68 | struct icmphdr { |
| 69 | __u8 type; | 69 | __u8 type; |
| 70 | __u8 code; | 70 | __u8 code; |
| 71 | __u16 checksum; | 71 | __be16 checksum; |
| 72 | union { | 72 | union { |
| 73 | struct { | 73 | struct { |
| 74 | __u16 id; | 74 | __be16 id; |
| 75 | __u16 sequence; | 75 | __be16 sequence; |
| 76 | } echo; | 76 | } echo; |
| 77 | __u32 gateway; | 77 | __be32 gateway; |
| 78 | struct { | 78 | struct { |
| 79 | __u16 __unused; | 79 | __be16 __unused; |
| 80 | __u16 mtu; | 80 | __be16 mtu; |
| 81 | } frag; | 81 | } frag; |
| 82 | } un; | 82 | } un; |
| 83 | }; | 83 | }; |
diff --git a/include/linux/if.h b/include/linux/if.h index 374e20ad8b..32bf419351 100644 --- a/include/linux/if.h +++ b/include/linux/if.h | |||
| @@ -59,6 +59,8 @@ | |||
| 59 | #define IFF_SLAVE_INACTIVE 0x4 /* bonding slave not the curr. active */ | 59 | #define IFF_SLAVE_INACTIVE 0x4 /* bonding slave not the curr. active */ |
| 60 | #define IFF_MASTER_8023AD 0x8 /* bonding master, 802.3ad. */ | 60 | #define IFF_MASTER_8023AD 0x8 /* bonding master, 802.3ad. */ |
| 61 | #define IFF_MASTER_ALB 0x10 /* bonding master, balance-alb. */ | 61 | #define IFF_MASTER_ALB 0x10 /* bonding master, balance-alb. */ |
| 62 | #define IFF_BONDING 0x20 /* bonding master or slave */ | ||
| 63 | #define IFF_SLAVE_NEEDARP 0x40 /* need ARPs for validation */ | ||
| 62 | 64 | ||
| 63 | #define IF_GET_IFACE 0x0001 /* for querying only */ | 65 | #define IF_GET_IFACE 0x0001 /* for querying only */ |
| 64 | #define IF_GET_PROTO 0x0002 | 66 | #define IF_GET_PROTO 0x0002 |
| @@ -212,5 +214,4 @@ struct ifconf | |||
| 212 | #define ifc_buf ifc_ifcu.ifcu_buf /* buffer address */ | 214 | #define ifc_buf ifc_ifcu.ifcu_buf /* buffer address */ |
| 213 | #define ifc_req ifc_ifcu.ifcu_req /* array of structures */ | 215 | #define ifc_req ifc_ifcu.ifcu_req /* array of structures */ |
| 214 | 216 | ||
| 215 | |||
| 216 | #endif /* _LINUX_IF_H */ | 217 | #endif /* _LINUX_IF_H */ |
diff --git a/include/linux/if_addr.h b/include/linux/if_addr.h new file mode 100644 index 0000000000..dbe8f6120a --- /dev/null +++ b/include/linux/if_addr.h | |||
| @@ -0,0 +1,55 @@ | |||
| 1 | #ifndef __LINUX_IF_ADDR_H | ||
| 2 | #define __LINUX_IF_ADDR_H | ||
| 3 | |||
| 4 | #include <linux/netlink.h> | ||
| 5 | |||
| 6 | struct ifaddrmsg | ||
| 7 | { | ||
| 8 | __u8 ifa_family; | ||
| 9 | __u8 ifa_prefixlen; /* The prefix length */ | ||
| 10 | __u8 ifa_flags; /* Flags */ | ||
| 11 | __u8 ifa_scope; /* Address scope */ | ||
| 12 | __u32 ifa_index; /* Link index */ | ||
| 13 | }; | ||
| 14 | |||
| 15 | /* | ||
| 16 | * Important comment: | ||
| 17 | * IFA_ADDRESS is prefix address, rather than local interface address. | ||
| 18 | * It makes no difference for normally configured broadcast interfaces, | ||
| 19 | * but for point-to-point IFA_ADDRESS is DESTINATION address, | ||
| 20 | * local address is supplied in IFA_LOCAL attribute. | ||
| 21 | */ | ||
| 22 | enum | ||
| 23 | { | ||
| 24 | IFA_UNSPEC, | ||
| 25 | IFA_ADDRESS, | ||
| 26 | IFA_LOCAL, | ||
| 27 | IFA_LABEL, | ||
| 28 | IFA_BROADCAST, | ||
| 29 | IFA_ANYCAST, | ||
| 30 | IFA_CACHEINFO, | ||
| 31 | IFA_MULTICAST, | ||
| 32 | __IFA_MAX, | ||
| 33 | }; | ||
| 34 | |||
| 35 | #define IFA_MAX (__IFA_MAX - 1) | ||
| 36 | |||
| 37 | /* ifa_flags */ | ||
| 38 | #define IFA_F_SECONDARY 0x01 | ||
| 39 | #define IFA_F_TEMPORARY IFA_F_SECONDARY | ||
| 40 | |||
| 41 | #define IFA_F_NODAD 0x02 | ||
| 42 | #define IFA_F_HOMEADDRESS 0x10 | ||
| 43 | #define IFA_F_DEPRECATED 0x20 | ||
| 44 | #define IFA_F_TENTATIVE 0x40 | ||
| 45 | #define IFA_F_PERMANENT 0x80 | ||
| 46 | |||
| 47 | struct ifa_cacheinfo | ||
| 48 | { | ||
| 49 | __u32 ifa_prefered; | ||
| 50 | __u32 ifa_valid; | ||
| 51 | __u32 cstamp; /* created timestamp, hundredths of seconds */ | ||
| 52 | __u32 tstamp; /* updated timestamp, hundredths of seconds */ | ||
| 53 | }; | ||
| 54 | |||
| 55 | #endif | ||
diff --git a/include/linux/if_arp.h b/include/linux/if_arp.h index a8b1a20718..7f5714214e 100644 --- a/include/linux/if_arp.h +++ b/include/linux/if_arp.h | |||
| @@ -130,11 +130,11 @@ struct arpreq_old { | |||
| 130 | 130 | ||
| 131 | struct arphdr | 131 | struct arphdr |
| 132 | { | 132 | { |
| 133 | unsigned short ar_hrd; /* format of hardware address */ | 133 | __be16 ar_hrd; /* format of hardware address */ |
| 134 | unsigned short ar_pro; /* format of protocol address */ | 134 | __be16 ar_pro; /* format of protocol address */ |
| 135 | unsigned char ar_hln; /* length of hardware address */ | 135 | unsigned char ar_hln; /* length of hardware address */ |
| 136 | unsigned char ar_pln; /* length of protocol address */ | 136 | unsigned char ar_pln; /* length of protocol address */ |
| 137 | unsigned short ar_op; /* ARP opcode (command) */ | 137 | __be16 ar_op; /* ARP opcode (command) */ |
| 138 | 138 | ||
| 139 | #if 0 | 139 | #if 0 |
| 140 | /* | 140 | /* |
diff --git a/include/linux/if_link.h b/include/linux/if_link.h new file mode 100644 index 0000000000..e963a077e6 --- /dev/null +++ b/include/linux/if_link.h | |||
| @@ -0,0 +1,136 @@ | |||
| 1 | #ifndef _LINUX_IF_LINK_H | ||
| 2 | #define _LINUX_IF_LINK_H | ||
| 3 | |||
| 4 | #include <linux/netlink.h> | ||
| 5 | |||
| 6 | /* The struct should be in sync with struct net_device_stats */ | ||
| 7 | struct rtnl_link_stats | ||
| 8 | { | ||
| 9 | __u32 rx_packets; /* total packets received */ | ||
| 10 | __u32 tx_packets; /* total packets transmitted */ | ||
| 11 | __u32 rx_bytes; /* total bytes received */ | ||
| 12 | __u32 tx_bytes; /* total bytes transmitted */ | ||
| 13 | __u32 rx_errors; /* bad packets received */ | ||
| 14 | __u32 tx_errors; /* packet transmit problems */ | ||
| 15 | __u32 rx_dropped; /* no space in linux buffers */ | ||
| 16 | __u32 tx_dropped; /* no space available in linux */ | ||
| 17 | __u32 multicast; /* multicast packets received */ | ||
| 18 | __u32 collisions; | ||
| 19 | |||
| 20 | /* detailed rx_errors: */ | ||
| 21 | __u32 rx_length_errors; | ||
| 22 | __u32 rx_over_errors; /* receiver ring buff overflow */ | ||
| 23 | __u32 rx_crc_errors; /* recved pkt with crc error */ | ||
| 24 | __u32 rx_frame_errors; /* recv'd frame alignment error */ | ||
| 25 | __u32 rx_fifo_errors; /* recv'r fifo overrun */ | ||
| 26 | __u32 rx_missed_errors; /* receiver missed packet */ | ||
| 27 | |||
| 28 | /* detailed tx_errors */ | ||
| 29 | __u32 tx_aborted_errors; | ||
| 30 | __u32 tx_carrier_errors; | ||
| 31 | __u32 tx_fifo_errors; | ||
| 32 | __u32 tx_heartbeat_errors; | ||
| 33 | __u32 tx_window_errors; | ||
| 34 | |||
| 35 | /* for cslip etc */ | ||
| 36 | __u32 rx_compressed; | ||
| 37 | __u32 tx_compressed; | ||
| 38 | }; | ||
| 39 | |||
| 40 | /* The struct should be in sync with struct ifmap */ | ||
| 41 | struct rtnl_link_ifmap | ||
| 42 | { | ||
| 43 | __u64 mem_start; | ||
| 44 | __u64 mem_end; | ||
| 45 | __u64 base_addr; | ||
| 46 | __u16 irq; | ||
| 47 | __u8 dma; | ||
| 48 | __u8 port; | ||
| 49 | }; | ||
| 50 | |||
| 51 | enum | ||
| 52 | { | ||
| 53 | IFLA_UNSPEC, | ||
| 54 | IFLA_ADDRESS, | ||
| 55 | IFLA_BROADCAST, | ||
| 56 | IFLA_IFNAME, | ||
| 57 | IFLA_MTU, | ||
| 58 | IFLA_LINK, | ||
| 59 | IFLA_QDISC, | ||
| 60 | IFLA_STATS, | ||
| 61 | IFLA_COST, | ||
| 62 | #define IFLA_COST IFLA_COST | ||
| 63 | IFLA_PRIORITY, | ||
| 64 | #define IFLA_PRIORITY IFLA_PRIORITY | ||
| 65 | IFLA_MASTER, | ||
| 66 | #define IFLA_MASTER IFLA_MASTER | ||
| 67 | IFLA_WIRELESS, /* Wireless Extension event - see wireless.h */ | ||
| 68 | #define IFLA_WIRELESS IFLA_WIRELESS | ||
| 69 | IFLA_PROTINFO, /* Protocol specific information for a link */ | ||
| 70 | #define IFLA_PROTINFO IFLA_PROTINFO | ||
| 71 | IFLA_TXQLEN, | ||
| 72 | #define IFLA_TXQLEN IFLA_TXQLEN | ||
| 73 | IFLA_MAP, | ||
| 74 | #define IFLA_MAP IFLA_MAP | ||
| 75 | IFLA_WEIGHT, | ||
| 76 | #define IFLA_WEIGHT IFLA_WEIGHT | ||
| 77 | IFLA_OPERSTATE, | ||
| 78 | IFLA_LINKMODE, | ||
| 79 | __IFLA_MAX | ||
| 80 | }; | ||
| 81 | |||
| 82 | |||
| 83 | #define IFLA_MAX (__IFLA_MAX - 1) | ||
| 84 | |||
| 85 | /* ifi_flags. | ||
| 86 | |||
| 87 | IFF_* flags. | ||
| 88 | |||
| 89 | The only change is: | ||
| 90 | IFF_LOOPBACK, IFF_BROADCAST and IFF_POINTOPOINT are | ||
| 91 | more not changeable by user. They describe link media | ||
| 92 | characteristics and set by device driver. | ||
| 93 | |||
| 94 | Comments: | ||
| 95 | - Combination IFF_BROADCAST|IFF_POINTOPOINT is invalid | ||
| 96 | - If neither of these three flags are set; | ||
| 97 | the interface is NBMA. | ||
| 98 | |||
| 99 | - IFF_MULTICAST does not mean anything special: | ||
| 100 | multicasts can be used on all not-NBMA links. | ||
| 101 | IFF_MULTICAST means that this media uses special encapsulation | ||
| 102 | for multicast frames. Apparently, all IFF_POINTOPOINT and | ||
| 103 | IFF_BROADCAST devices are able to use multicasts too. | ||
| 104 | */ | ||
| 105 | |||
| 106 | /* IFLA_LINK. | ||
| 107 | For usual devices it is equal ifi_index. | ||
| 108 | If it is a "virtual interface" (f.e. tunnel), ifi_link | ||
| 109 | can point to real physical interface (f.e. for bandwidth calculations), | ||
| 110 | or maybe 0, what means, that real media is unknown (usual | ||
| 111 | for IPIP tunnels, when route to endpoint is allowed to change) | ||
| 112 | */ | ||
| 113 | |||
| 114 | /* Subtype attributes for IFLA_PROTINFO */ | ||
| 115 | enum | ||
| 116 | { | ||
| 117 | IFLA_INET6_UNSPEC, | ||
| 118 | IFLA_INET6_FLAGS, /* link flags */ | ||
| 119 | IFLA_INET6_CONF, /* sysctl parameters */ | ||
| 120 | IFLA_INET6_STATS, /* statistics */ | ||
| 121 | IFLA_INET6_MCAST, /* MC things. What of them? */ | ||
| 122 | IFLA_INET6_CACHEINFO, /* time values and max reasm size */ | ||
| 123 | __IFLA_INET6_MAX | ||
| 124 | }; | ||
| 125 | |||
| 126 | #define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1) | ||
| 127 | |||
| 128 | struct ifla_cacheinfo | ||
| 129 | { | ||
| 130 | __u32 max_reasm_len; | ||
| 131 | __u32 tstamp; /* ipv6InterfaceTable updated timestamp */ | ||
| 132 | __u32 reachable_time; | ||
| 133 | __u32 retrans_time; | ||
| 134 | }; | ||
| 135 | |||
| 136 | #endif /* _LINUX_IF_LINK_H */ | ||
diff --git a/include/linux/igmp.h b/include/linux/igmp.h index 899c3d4776..03f43e2893 100644 --- a/include/linux/igmp.h +++ b/include/linux/igmp.h | |||
| @@ -30,8 +30,8 @@ struct igmphdr | |||
| 30 | { | 30 | { |
| 31 | __u8 type; | 31 | __u8 type; |
| 32 | __u8 code; /* For newer IGMP */ | 32 | __u8 code; /* For newer IGMP */ |
| 33 | __u16 csum; | 33 | __be16 csum; |
| 34 | __u32 group; | 34 | __be32 group; |
| 35 | }; | 35 | }; |
| 36 | 36 | ||
| 37 | /* V3 group record types [grec_type] */ | 37 | /* V3 group record types [grec_type] */ |
| @@ -45,25 +45,25 @@ struct igmphdr | |||
| 45 | struct igmpv3_grec { | 45 | struct igmpv3_grec { |
| 46 | __u8 grec_type; | 46 | __u8 grec_type; |
| 47 | __u8 grec_auxwords; | 47 | __u8 grec_auxwords; |
| 48 | __u16 grec_nsrcs; | 48 | __be16 grec_nsrcs; |
| 49 | __u32 grec_mca; | 49 | __be32 grec_mca; |
| 50 | __u32 grec_src[0]; | 50 | __be32 grec_src[0]; |
| 51 | }; | 51 | }; |
| 52 | 52 | ||
| 53 | struct igmpv3_report { | 53 | struct igmpv3_report { |
| 54 | __u8 type; | 54 | __u8 type; |
| 55 | __u8 resv1; | 55 | __u8 resv1; |
| 56 | __u16 csum; | 56 | __be16 csum; |
| 57 | __u16 resv2; | 57 | __be16 resv2; |
| 58 | __u16 ngrec; | 58 | __be16 ngrec; |
| 59 | struct igmpv3_grec grec[0]; | 59 | struct igmpv3_grec grec[0]; |
| 60 | }; | 60 | }; |
| 61 | 61 | ||
| 62 | struct igmpv3_query { | 62 | struct igmpv3_query { |
| 63 | __u8 type; | 63 | __u8 type; |
| 64 | __u8 code; | 64 | __u8 code; |
| 65 | __u16 csum; | 65 | __be16 csum; |
| 66 | __u32 group; | 66 | __be32 group; |
| 67 | #if defined(__LITTLE_ENDIAN_BITFIELD) | 67 | #if defined(__LITTLE_ENDIAN_BITFIELD) |
| 68 | __u8 qrv:3, | 68 | __u8 qrv:3, |
| 69 | suppress:1, | 69 | suppress:1, |
| @@ -76,8 +76,8 @@ struct igmpv3_query { | |||
| 76 | #error "Please fix <asm/byteorder.h>" | 76 | #error "Please fix <asm/byteorder.h>" |
| 77 | #endif | 77 | #endif |
| 78 | __u8 qqic; | 78 | __u8 qqic; |
| 79 | __u16 nsrcs; | 79 | __be16 nsrcs; |
| 80 | __u32 srcs[0]; | 80 | __be32 srcs[0]; |
| 81 | }; | 81 | }; |
| 82 | 82 | ||
| 83 | #define IGMP_HOST_MEMBERSHIP_QUERY 0x11 /* From RFC1112 */ | 83 | #define IGMP_HOST_MEMBERSHIP_QUERY 0x11 /* From RFC1112 */ |
| @@ -136,11 +136,11 @@ struct ip_sf_socklist | |||
| 136 | { | 136 | { |
| 137 | unsigned int sl_max; | 137 | unsigned int sl_max; |
| 138 | unsigned int sl_count; | 138 | unsigned int sl_count; |
| 139 | __u32 sl_addr[0]; | 139 | __be32 sl_addr[0]; |
| 140 | }; | 140 | }; |
| 141 | 141 | ||
| 142 | #define IP_SFLSIZE(count) (sizeof(struct ip_sf_socklist) + \ | 142 | #define IP_SFLSIZE(count) (sizeof(struct ip_sf_socklist) + \ |
| 143 | (count) * sizeof(__u32)) | 143 | (count) * sizeof(__be32)) |
| 144 | 144 | ||
| 145 | #define IP_SFBLOCK 10 /* allocate this many at once */ | 145 | #define IP_SFBLOCK 10 /* allocate this many at once */ |
| 146 | 146 | ||
| @@ -159,7 +159,7 @@ struct ip_mc_socklist | |||
| 159 | struct ip_sf_list | 159 | struct ip_sf_list |
| 160 | { | 160 | { |
| 161 | struct ip_sf_list *sf_next; | 161 | struct ip_sf_list *sf_next; |
| 162 | __u32 sf_inaddr; | 162 | __be32 sf_inaddr; |
| 163 | unsigned long sf_count[2]; /* include/exclude counts */ | 163 | unsigned long sf_count[2]; /* include/exclude counts */ |
| 164 | unsigned char sf_gsresp; /* include in g & s response? */ | 164 | unsigned char sf_gsresp; /* include in g & s response? */ |
| 165 | unsigned char sf_oldin; /* change state */ | 165 | unsigned char sf_oldin; /* change state */ |
| @@ -197,7 +197,7 @@ struct ip_mc_list | |||
| 197 | #define IGMPV3_QQIC(value) IGMPV3_EXP(0x80, 4, 3, value) | 197 | #define IGMPV3_QQIC(value) IGMPV3_EXP(0x80, 4, 3, value) |
| 198 | #define IGMPV3_MRC(value) IGMPV3_EXP(0x80, 4, 3, value) | 198 | #define IGMPV3_MRC(value) IGMPV3_EXP(0x80, 4, 3, value) |
| 199 | 199 | ||
| 200 | extern int ip_check_mc(struct in_device *dev, u32 mc_addr, u32 src_addr, u16 proto); | 200 | extern int ip_check_mc(struct in_device *dev, __be32 mc_addr, __be32 src_addr, u16 proto); |
| 201 | extern int igmp_rcv(struct sk_buff *); | 201 | extern int igmp_rcv(struct sk_buff *); |
| 202 | extern int ip_mc_join_group(struct sock *sk, struct ip_mreqn *imr); | 202 | extern int ip_mc_join_group(struct sock *sk, struct ip_mreqn *imr); |
| 203 | extern int ip_mc_leave_group(struct sock *sk, struct ip_mreqn *imr); | 203 | extern int ip_mc_leave_group(struct sock *sk, struct ip_mreqn *imr); |
| @@ -209,13 +209,13 @@ extern int ip_mc_msfget(struct sock *sk, struct ip_msfilter *msf, | |||
| 209 | struct ip_msfilter __user *optval, int __user *optlen); | 209 | struct ip_msfilter __user *optval, int __user *optlen); |
| 210 | extern int ip_mc_gsfget(struct sock *sk, struct group_filter *gsf, | 210 | extern int ip_mc_gsfget(struct sock *sk, struct group_filter *gsf, |
| 211 | struct group_filter __user *optval, int __user *optlen); | 211 | struct group_filter __user *optval, int __user *optlen); |
| 212 | extern int ip_mc_sf_allow(struct sock *sk, u32 local, u32 rmt, int dif); | 212 | extern int ip_mc_sf_allow(struct sock *sk, __be32 local, __be32 rmt, int dif); |
| 213 | extern void ip_mr_init(void); | 213 | extern void ip_mr_init(void); |
| 214 | extern void ip_mc_init_dev(struct in_device *); | 214 | extern void ip_mc_init_dev(struct in_device *); |
| 215 | extern void ip_mc_destroy_dev(struct in_device *); | 215 | extern void ip_mc_destroy_dev(struct in_device *); |
| 216 | extern void ip_mc_up(struct in_device *); | 216 | extern void ip_mc_up(struct in_device *); |
| 217 | extern void ip_mc_down(struct in_device *); | 217 | extern void ip_mc_down(struct in_device *); |
| 218 | extern void ip_mc_dec_group(struct in_device *in_dev, u32 addr); | 218 | extern void ip_mc_dec_group(struct in_device *in_dev, __be32 addr); |
| 219 | extern void ip_mc_inc_group(struct in_device *in_dev, u32 addr); | 219 | extern void ip_mc_inc_group(struct in_device *in_dev, __be32 addr); |
| 220 | #endif | 220 | #endif |
| 221 | #endif | 221 | #endif |
diff --git a/include/linux/in.h b/include/linux/in.h index 94f557fa46..d79fc75fa7 100644 --- a/include/linux/in.h +++ b/include/linux/in.h | |||
| @@ -52,7 +52,7 @@ enum { | |||
| 52 | 52 | ||
| 53 | /* Internet address. */ | 53 | /* Internet address. */ |
| 54 | struct in_addr { | 54 | struct in_addr { |
| 55 | __u32 s_addr; | 55 | __be32 s_addr; |
| 56 | }; | 56 | }; |
| 57 | 57 | ||
| 58 | #define IP_TOS 1 | 58 | #define IP_TOS 1 |
| @@ -123,17 +123,17 @@ struct ip_mreqn | |||
| 123 | }; | 123 | }; |
| 124 | 124 | ||
| 125 | struct ip_mreq_source { | 125 | struct ip_mreq_source { |
| 126 | __u32 imr_multiaddr; | 126 | __be32 imr_multiaddr; |
| 127 | __u32 imr_interface; | 127 | __be32 imr_interface; |
| 128 | __u32 imr_sourceaddr; | 128 | __be32 imr_sourceaddr; |
| 129 | }; | 129 | }; |
| 130 | 130 | ||
| 131 | struct ip_msfilter { | 131 | struct ip_msfilter { |
| 132 | __u32 imsf_multiaddr; | 132 | __be32 imsf_multiaddr; |
| 133 | __u32 imsf_interface; | 133 | __be32 imsf_interface; |
| 134 | __u32 imsf_fmode; | 134 | __u32 imsf_fmode; |
| 135 | __u32 imsf_numsrc; | 135 | __u32 imsf_numsrc; |
| 136 | __u32 imsf_slist[1]; | 136 | __be32 imsf_slist[1]; |
| 137 | }; | 137 | }; |
| 138 | 138 | ||
| 139 | #define IP_MSFILTER_SIZE(numsrc) \ | 139 | #define IP_MSFILTER_SIZE(numsrc) \ |
| @@ -177,7 +177,7 @@ struct in_pktinfo | |||
| 177 | #define __SOCK_SIZE__ 16 /* sizeof(struct sockaddr) */ | 177 | #define __SOCK_SIZE__ 16 /* sizeof(struct sockaddr) */ |
| 178 | struct sockaddr_in { | 178 | struct sockaddr_in { |
| 179 | sa_family_t sin_family; /* Address family */ | 179 | sa_family_t sin_family; /* Address family */ |
| 180 | unsigned short int sin_port; /* Port number */ | 180 | __be16 sin_port; /* Port number */ |
| 181 | struct in_addr sin_addr; /* Internet address */ | 181 | struct in_addr sin_addr; /* Internet address */ |
| 182 | 182 | ||
| 183 | /* Pad to size of `struct sockaddr'. */ | 183 | /* Pad to size of `struct sockaddr'. */ |
diff --git a/include/linux/in6.h b/include/linux/in6.h index 304aaedea3..9be6a4756f 100644 --- a/include/linux/in6.h +++ b/include/linux/in6.h | |||
| @@ -32,8 +32,8 @@ struct in6_addr | |||
| 32 | union | 32 | union |
| 33 | { | 33 | { |
| 34 | __u8 u6_addr8[16]; | 34 | __u8 u6_addr8[16]; |
| 35 | __u16 u6_addr16[8]; | 35 | __be16 u6_addr16[8]; |
| 36 | __u32 u6_addr32[4]; | 36 | __be32 u6_addr32[4]; |
| 37 | } in6_u; | 37 | } in6_u; |
| 38 | #define s6_addr in6_u.u6_addr8 | 38 | #define s6_addr in6_u.u6_addr8 |
| 39 | #define s6_addr16 in6_u.u6_addr16 | 39 | #define s6_addr16 in6_u.u6_addr16 |
| @@ -53,7 +53,7 @@ extern const struct in6_addr in6addr_loopback; | |||
| 53 | 53 | ||
| 54 | struct sockaddr_in6 { | 54 | struct sockaddr_in6 { |
| 55 | unsigned short int sin6_family; /* AF_INET6 */ | 55 | unsigned short int sin6_family; /* AF_INET6 */ |
| 56 | __u16 sin6_port; /* Transport layer port # */ | 56 | __be16 sin6_port; /* Transport layer port # */ |
| 57 | __u32 sin6_flowinfo; /* IPv6 flow information */ | 57 | __u32 sin6_flowinfo; /* IPv6 flow information */ |
| 58 | struct in6_addr sin6_addr; /* IPv6 address */ | 58 | struct in6_addr sin6_addr; /* IPv6 address */ |
| 59 | __u32 sin6_scope_id; /* scope id (new in RFC2553) */ | 59 | __u32 sin6_scope_id; /* scope id (new in RFC2553) */ |
| @@ -134,6 +134,7 @@ struct in6_flowlabel_req | |||
| 134 | #define IPPROTO_ICMPV6 58 /* ICMPv6 */ | 134 | #define IPPROTO_ICMPV6 58 /* ICMPv6 */ |
| 135 | #define IPPROTO_NONE 59 /* IPv6 no next header */ | 135 | #define IPPROTO_NONE 59 /* IPv6 no next header */ |
| 136 | #define IPPROTO_DSTOPTS 60 /* IPv6 destination options */ | 136 | #define IPPROTO_DSTOPTS 60 /* IPv6 destination options */ |
| 137 | #define IPPROTO_MH 135 /* IPv6 mobility header */ | ||
| 137 | 138 | ||
| 138 | /* | 139 | /* |
| 139 | * IPv6 TLV options. | 140 | * IPv6 TLV options. |
| @@ -142,6 +143,7 @@ struct in6_flowlabel_req | |||
| 142 | #define IPV6_TLV_PADN 1 | 143 | #define IPV6_TLV_PADN 1 |
| 143 | #define IPV6_TLV_ROUTERALERT 5 | 144 | #define IPV6_TLV_ROUTERALERT 5 |
| 144 | #define IPV6_TLV_JUMBO 194 | 145 | #define IPV6_TLV_JUMBO 194 |
| 146 | #define IPV6_TLV_HAO 201 /* home address option */ | ||
| 145 | 147 | ||
| 146 | /* | 148 | /* |
| 147 | * IPV6 socket options | 149 | * IPV6 socket options |
diff --git a/include/linux/inet.h b/include/linux/inet.h index 6c5587af11..b7c6da7d6d 100644 --- a/include/linux/inet.h +++ b/include/linux/inet.h | |||
| @@ -46,5 +46,7 @@ | |||
| 46 | #include <linux/types.h> | 46 | #include <linux/types.h> |
| 47 | 47 | ||
| 48 | extern __be32 in_aton(const char *str); | 48 | extern __be32 in_aton(const char *str); |
| 49 | extern int in4_pton(const char *src, int srclen, u8 *dst, char delim, const char **end); | ||
| 50 | extern int in6_pton(const char *src, int srclen, u8 *dst, char delim, const char **end); | ||
| 49 | #endif | 51 | #endif |
| 50 | #endif /* _LINUX_INET_H */ | 52 | #endif /* _LINUX_INET_H */ |
diff --git a/include/linux/inet_diag.h b/include/linux/inet_diag.h index a4606e5810..6e8bc54863 100644 --- a/include/linux/inet_diag.h +++ b/include/linux/inet_diag.h | |||
| @@ -9,10 +9,10 @@ | |||
| 9 | 9 | ||
| 10 | /* Socket identity */ | 10 | /* Socket identity */ |
| 11 | struct inet_diag_sockid { | 11 | struct inet_diag_sockid { |
| 12 | __u16 idiag_sport; | 12 | __be16 idiag_sport; |
| 13 | __u16 idiag_dport; | 13 | __be16 idiag_dport; |
| 14 | __u32 idiag_src[4]; | 14 | __be32 idiag_src[4]; |
| 15 | __u32 idiag_dst[4]; | 15 | __be32 idiag_dst[4]; |
| 16 | __u32 idiag_if; | 16 | __u32 idiag_if; |
| 17 | __u32 idiag_cookie[2]; | 17 | __u32 idiag_cookie[2]; |
| 18 | #define INET_DIAG_NOCOOKIE (~0U) | 18 | #define INET_DIAG_NOCOOKIE (~0U) |
| @@ -67,7 +67,7 @@ struct inet_diag_hostcond { | |||
| 67 | __u8 family; | 67 | __u8 family; |
| 68 | __u8 prefix_len; | 68 | __u8 prefix_len; |
| 69 | int port; | 69 | int port; |
| 70 | __u32 addr[0]; | 70 | __be32 addr[0]; |
| 71 | }; | 71 | }; |
| 72 | 72 | ||
| 73 | /* Base info structure. It contains socket identity (addrs/ports/cookie) | 73 | /* Base info structure. It contains socket identity (addrs/ports/cookie) |
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index 92297ff24e..5a0ab04627 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h | |||
| @@ -90,11 +90,11 @@ struct in_ifaddr | |||
| 90 | struct in_ifaddr *ifa_next; | 90 | struct in_ifaddr *ifa_next; |
| 91 | struct in_device *ifa_dev; | 91 | struct in_device *ifa_dev; |
| 92 | struct rcu_head rcu_head; | 92 | struct rcu_head rcu_head; |
| 93 | u32 ifa_local; | 93 | __be32 ifa_local; |
| 94 | u32 ifa_address; | 94 | __be32 ifa_address; |
| 95 | u32 ifa_mask; | 95 | __be32 ifa_mask; |
| 96 | u32 ifa_broadcast; | 96 | __be32 ifa_broadcast; |
| 97 | u32 ifa_anycast; | 97 | __be32 ifa_anycast; |
| 98 | unsigned char ifa_scope; | 98 | unsigned char ifa_scope; |
| 99 | unsigned char ifa_flags; | 99 | unsigned char ifa_flags; |
| 100 | unsigned char ifa_prefixlen; | 100 | unsigned char ifa_prefixlen; |
| @@ -104,18 +104,18 @@ struct in_ifaddr | |||
| 104 | extern int register_inetaddr_notifier(struct notifier_block *nb); | 104 | extern int register_inetaddr_notifier(struct notifier_block *nb); |
| 105 | extern int unregister_inetaddr_notifier(struct notifier_block *nb); | 105 | extern int unregister_inetaddr_notifier(struct notifier_block *nb); |
| 106 | 106 | ||
| 107 | extern struct net_device *ip_dev_find(u32 addr); | 107 | extern struct net_device *ip_dev_find(__be32 addr); |
| 108 | extern int inet_addr_onlink(struct in_device *in_dev, u32 a, u32 b); | 108 | extern int inet_addr_onlink(struct in_device *in_dev, __be32 a, __be32 b); |
| 109 | extern int devinet_ioctl(unsigned int cmd, void __user *); | 109 | extern int devinet_ioctl(unsigned int cmd, void __user *); |
| 110 | extern void devinet_init(void); | 110 | extern void devinet_init(void); |
| 111 | extern struct in_device *inetdev_init(struct net_device *dev); | 111 | extern struct in_device *inetdev_init(struct net_device *dev); |
| 112 | extern struct in_device *inetdev_by_index(int); | 112 | extern struct in_device *inetdev_by_index(int); |
| 113 | extern u32 inet_select_addr(const struct net_device *dev, u32 dst, int scope); | 113 | extern __be32 inet_select_addr(const struct net_device *dev, __be32 dst, int scope); |
| 114 | extern u32 inet_confirm_addr(const struct net_device *dev, u32 dst, u32 local, int scope); | 114 | extern __be32 inet_confirm_addr(const struct net_device *dev, __be32 dst, __be32 local, int scope); |
| 115 | extern struct in_ifaddr *inet_ifa_byprefix(struct in_device *in_dev, u32 prefix, u32 mask); | 115 | extern struct in_ifaddr *inet_ifa_byprefix(struct in_device *in_dev, __be32 prefix, __be32 mask); |
| 116 | extern void inet_forward_change(void); | 116 | extern void inet_forward_change(void); |
| 117 | 117 | ||
| 118 | static __inline__ int inet_ifa_match(u32 addr, struct in_ifaddr *ifa) | 118 | static __inline__ int inet_ifa_match(__be32 addr, struct in_ifaddr *ifa) |
| 119 | { | 119 | { |
| 120 | return !((addr^ifa->ifa_address)&ifa->ifa_mask); | 120 | return !((addr^ifa->ifa_address)&ifa->ifa_mask); |
| 121 | } | 121 | } |
| @@ -183,7 +183,7 @@ static inline void in_dev_put(struct in_device *idev) | |||
| 183 | 183 | ||
| 184 | #endif /* __KERNEL__ */ | 184 | #endif /* __KERNEL__ */ |
| 185 | 185 | ||
| 186 | static __inline__ __u32 inet_make_mask(int logmask) | 186 | static __inline__ __be32 inet_make_mask(int logmask) |
| 187 | { | 187 | { |
| 188 | if (logmask) | 188 | if (logmask) |
| 189 | return htonl(~((1<<(32-logmask))-1)); | 189 | return htonl(~((1<<(32-logmask))-1)); |
diff --git a/include/linux/init.h b/include/linux/init.h index 6667785dd1..e92b1455d7 100644 --- a/include/linux/init.h +++ b/include/linux/init.h | |||
| @@ -68,6 +68,7 @@ extern initcall_t __security_initcall_start[], __security_initcall_end[]; | |||
| 68 | 68 | ||
| 69 | /* Defined in init/main.c */ | 69 | /* Defined in init/main.c */ |
| 70 | extern char saved_command_line[]; | 70 | extern char saved_command_line[]; |
| 71 | extern unsigned int reset_devices; | ||
| 71 | 72 | ||
| 72 | /* used by init/main.c */ | 73 | /* used by init/main.c */ |
| 73 | extern void setup_arch(char **); | 74 | extern void setup_arch(char **); |
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index d5afee95fd..1f97e3d926 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
| @@ -123,6 +123,14 @@ static inline void disable_irq_nosync_lockdep(unsigned int irq) | |||
| 123 | #endif | 123 | #endif |
| 124 | } | 124 | } |
| 125 | 125 | ||
| 126 | static inline void disable_irq_nosync_lockdep_irqsave(unsigned int irq, unsigned long *flags) | ||
| 127 | { | ||
| 128 | disable_irq_nosync(irq); | ||
| 129 | #ifdef CONFIG_LOCKDEP | ||
| 130 | local_irq_save(*flags); | ||
| 131 | #endif | ||
| 132 | } | ||
| 133 | |||
| 126 | static inline void disable_irq_lockdep(unsigned int irq) | 134 | static inline void disable_irq_lockdep(unsigned int irq) |
| 127 | { | 135 | { |
| 128 | disable_irq(irq); | 136 | disable_irq(irq); |
| @@ -139,6 +147,14 @@ static inline void enable_irq_lockdep(unsigned int irq) | |||
| 139 | enable_irq(irq); | 147 | enable_irq(irq); |
| 140 | } | 148 | } |
| 141 | 149 | ||
| 150 | static inline void enable_irq_lockdep_irqrestore(unsigned int irq, unsigned long *flags) | ||
| 151 | { | ||
| 152 | #ifdef CONFIG_LOCKDEP | ||
| 153 | local_irq_restore(*flags); | ||
| 154 | #endif | ||
| 155 | enable_irq(irq); | ||
| 156 | } | ||
| 157 | |||
| 142 | /* IRQ wakeup (PM) control: */ | 158 | /* IRQ wakeup (PM) control: */ |
| 143 | extern int set_irq_wake(unsigned int irq, unsigned int on); | 159 | extern int set_irq_wake(unsigned int irq, unsigned int on); |
| 144 | 160 | ||
diff --git a/include/linux/io.h b/include/linux/io.h index 420e2fdf26..aa3f5af670 100644 --- a/include/linux/io.h +++ b/include/linux/io.h | |||
| @@ -19,8 +19,12 @@ | |||
| 19 | #define _LINUX_IO_H | 19 | #define _LINUX_IO_H |
| 20 | 20 | ||
| 21 | #include <asm/io.h> | 21 | #include <asm/io.h> |
| 22 | #include <asm/page.h> | ||
| 22 | 23 | ||
| 23 | void __iowrite32_copy(void __iomem *to, const void *from, size_t count); | 24 | void __iowrite32_copy(void __iomem *to, const void *from, size_t count); |
| 24 | void __iowrite64_copy(void __iomem *to, const void *from, size_t count); | 25 | void __iowrite64_copy(void __iomem *to, const void *from, size_t count); |
| 25 | 26 | ||
| 27 | int ioremap_page_range(unsigned long addr, unsigned long end, | ||
| 28 | unsigned long phys_addr, pgprot_t prot); | ||
| 29 | |||
| 26 | #endif /* _LINUX_IO_H */ | 30 | #endif /* _LINUX_IO_H */ |
diff --git a/include/linux/ip.h b/include/linux/ip.h index 4b55cf1df7..6b25d36fc5 100644 --- a/include/linux/ip.h +++ b/include/linux/ip.h | |||
| @@ -57,6 +57,7 @@ | |||
| 57 | #define IPOPT_SEC (2 |IPOPT_CONTROL|IPOPT_COPY) | 57 | #define IPOPT_SEC (2 |IPOPT_CONTROL|IPOPT_COPY) |
| 58 | #define IPOPT_LSRR (3 |IPOPT_CONTROL|IPOPT_COPY) | 58 | #define IPOPT_LSRR (3 |IPOPT_CONTROL|IPOPT_COPY) |
| 59 | #define IPOPT_TIMESTAMP (4 |IPOPT_MEASUREMENT) | 59 | #define IPOPT_TIMESTAMP (4 |IPOPT_MEASUREMENT) |
| 60 | #define IPOPT_CIPSO (6 |IPOPT_CONTROL|IPOPT_COPY) | ||
| 60 | #define IPOPT_RR (7 |IPOPT_CONTROL) | 61 | #define IPOPT_RR (7 |IPOPT_CONTROL) |
| 61 | #define IPOPT_SID (8 |IPOPT_CONTROL|IPOPT_COPY) | 62 | #define IPOPT_SID (8 |IPOPT_CONTROL|IPOPT_COPY) |
| 62 | #define IPOPT_SSRR (9 |IPOPT_CONTROL|IPOPT_COPY) | 63 | #define IPOPT_SSRR (9 |IPOPT_CONTROL|IPOPT_COPY) |
| @@ -95,7 +96,7 @@ struct iphdr { | |||
| 95 | __be16 frag_off; | 96 | __be16 frag_off; |
| 96 | __u8 ttl; | 97 | __u8 ttl; |
| 97 | __u8 protocol; | 98 | __u8 protocol; |
| 98 | __u16 check; | 99 | __be16 check; |
| 99 | __be32 saddr; | 100 | __be32 saddr; |
| 100 | __be32 daddr; | 101 | __be32 daddr; |
| 101 | /*The options start here. */ | 102 | /*The options start here. */ |
| @@ -104,22 +105,22 @@ struct iphdr { | |||
| 104 | struct ip_auth_hdr { | 105 | struct ip_auth_hdr { |
| 105 | __u8 nexthdr; | 106 | __u8 nexthdr; |
| 106 | __u8 hdrlen; /* This one is measured in 32 bit units! */ | 107 | __u8 hdrlen; /* This one is measured in 32 bit units! */ |
| 107 | __u16 reserved; | 108 | __be16 reserved; |
| 108 | __u32 spi; | 109 | __be32 spi; |
| 109 | __u32 seq_no; /* Sequence number */ | 110 | __be32 seq_no; /* Sequence number */ |
| 110 | __u8 auth_data[0]; /* Variable len but >=4. Mind the 64 bit alignment! */ | 111 | __u8 auth_data[0]; /* Variable len but >=4. Mind the 64 bit alignment! */ |
| 111 | }; | 112 | }; |
| 112 | 113 | ||
| 113 | struct ip_esp_hdr { | 114 | struct ip_esp_hdr { |
| 114 | __u32 spi; | 115 | __be32 spi; |
| 115 | __u32 seq_no; /* Sequence number */ | 116 | __be32 seq_no; /* Sequence number */ |
| 116 | __u8 enc_data[0]; /* Variable len but >=8. Mind the 64 bit alignment! */ | 117 | __u8 enc_data[0]; /* Variable len but >=8. Mind the 64 bit alignment! */ |
| 117 | }; | 118 | }; |
| 118 | 119 | ||
| 119 | struct ip_comp_hdr { | 120 | struct ip_comp_hdr { |
| 120 | __u8 nexthdr; | 121 | __u8 nexthdr; |
| 121 | __u8 flags; | 122 | __u8 flags; |
| 122 | __u16 cpi; | 123 | __be16 cpi; |
| 123 | }; | 124 | }; |
| 124 | 125 | ||
| 125 | #endif /* _LINUX_IP_H */ | 126 | #endif /* _LINUX_IP_H */ |
diff --git a/include/linux/ipmi.h b/include/linux/ipmi.h index d09fbeabf1..796ca009fd 100644 --- a/include/linux/ipmi.h +++ b/include/linux/ipmi.h | |||
| @@ -148,6 +148,13 @@ struct ipmi_lan_addr | |||
| 148 | #define IPMI_BMC_CHANNEL 0xf | 148 | #define IPMI_BMC_CHANNEL 0xf |
| 149 | #define IPMI_NUM_CHANNELS 0x10 | 149 | #define IPMI_NUM_CHANNELS 0x10 |
| 150 | 150 | ||
| 151 | /* | ||
| 152 | * Used to signify an "all channel" bitmask. This is more than the | ||
| 153 | * actual number of channels because this is used in userland and | ||
| 154 | * will cover us if the number of channels is extended. | ||
| 155 | */ | ||
| 156 | #define IPMI_CHAN_ALL (~0) | ||
| 157 | |||
| 151 | 158 | ||
| 152 | /* | 159 | /* |
| 153 | * A raw IPMI message without any addressing. This covers both | 160 | * A raw IPMI message without any addressing. This covers both |
| @@ -350,18 +357,21 @@ int ipmi_request_supply_msgs(ipmi_user_t user, | |||
| 350 | 357 | ||
| 351 | /* | 358 | /* |
| 352 | * When commands come in to the SMS, the user can register to receive | 359 | * When commands come in to the SMS, the user can register to receive |
| 353 | * them. Only one user can be listening on a specific netfn/cmd pair | 360 | * them. Only one user can be listening on a specific netfn/cmd/chan tuple |
| 354 | * at a time, you will get an EBUSY error if the command is already | 361 | * at a time, you will get an EBUSY error if the command is already |
| 355 | * registered. If a command is received that does not have a user | 362 | * registered. If a command is received that does not have a user |
| 356 | * registered, the driver will automatically return the proper | 363 | * registered, the driver will automatically return the proper |
| 357 | * error. | 364 | * error. Channels are specified as a bitfield, use IPMI_CHAN_ALL to |
| 365 | * mean all channels. | ||
| 358 | */ | 366 | */ |
| 359 | int ipmi_register_for_cmd(ipmi_user_t user, | 367 | int ipmi_register_for_cmd(ipmi_user_t user, |
| 360 | unsigned char netfn, | 368 | unsigned char netfn, |
| 361 | unsigned char cmd); | 369 | unsigned char cmd, |
| 370 | unsigned int chans); | ||
| 362 | int ipmi_unregister_for_cmd(ipmi_user_t user, | 371 | int ipmi_unregister_for_cmd(ipmi_user_t user, |
| 363 | unsigned char netfn, | 372 | unsigned char netfn, |
| 364 | unsigned char cmd); | 373 | unsigned char cmd, |
| 374 | unsigned int chans); | ||
| 365 | 375 | ||
| 366 | /* | 376 | /* |
| 367 | * Allow run-to-completion mode to be set for the interface of | 377 | * Allow run-to-completion mode to be set for the interface of |
| @@ -571,6 +581,36 @@ struct ipmi_cmdspec | |||
| 571 | #define IPMICTL_UNREGISTER_FOR_CMD _IOR(IPMI_IOC_MAGIC, 15, \ | 581 | #define IPMICTL_UNREGISTER_FOR_CMD _IOR(IPMI_IOC_MAGIC, 15, \ |
| 572 | struct ipmi_cmdspec) | 582 | struct ipmi_cmdspec) |
| 573 | 583 | ||
| 584 | /* | ||
| 585 | * Register to get commands from other entities on specific channels. | ||
| 586 | * This way, you can only listen on specific channels, or have messages | ||
| 587 | * from some channels go to one place and other channels to someplace | ||
| 588 | * else. The chans field is a bitmask, (1 << channel) for each channel. | ||
| 589 | * It may be IPMI_CHAN_ALL for all channels. | ||
| 590 | */ | ||
| 591 | struct ipmi_cmdspec_chans | ||
| 592 | { | ||
| 593 | unsigned int netfn; | ||
| 594 | unsigned int cmd; | ||
| 595 | unsigned int chans; | ||
| 596 | }; | ||
| 597 | |||
| 598 | /* | ||
| 599 | * Register to receive a specific command on specific channels. error values: | ||
| 600 | * - EFAULT - an address supplied was invalid. | ||
| 601 | * - EBUSY - One of the netfn/cmd/chans supplied was already in use. | ||
| 602 | * - ENOMEM - could not allocate memory for the entry. | ||
| 603 | */ | ||
| 604 | #define IPMICTL_REGISTER_FOR_CMD_CHANS _IOR(IPMI_IOC_MAGIC, 28, \ | ||
| 605 | struct ipmi_cmdspec_chans) | ||
| 606 | /* | ||
| 607 | * Unregister some netfn/cmd/chans. error values: | ||
| 608 | * - EFAULT - an address supplied was invalid. | ||
| 609 | * - ENOENT - None of the netfn/cmd/chans were found registered for this user. | ||
| 610 | */ | ||
| 611 | #define IPMICTL_UNREGISTER_FOR_CMD_CHANS _IOR(IPMI_IOC_MAGIC, 29, \ | ||
| 612 | struct ipmi_cmdspec_chans) | ||
| 613 | |||
| 574 | /* | 614 | /* |
| 575 | * Set whether this interface receives events. Note that the first | 615 | * Set whether this interface receives events. Note that the first |
| 576 | * user registered for events will get all pending events for the | 616 | * user registered for events will get all pending events for the |
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index 297853c841..4f435c59de 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h | |||
| @@ -29,6 +29,7 @@ struct in6_ifreq { | |||
| 29 | 29 | ||
| 30 | #define IPV6_SRCRT_STRICT 0x01 /* this hop must be a neighbor */ | 30 | #define IPV6_SRCRT_STRICT 0x01 /* this hop must be a neighbor */ |
| 31 | #define IPV6_SRCRT_TYPE_0 0 /* IPv6 type 0 Routing Header */ | 31 | #define IPV6_SRCRT_TYPE_0 0 /* IPv6 type 0 Routing Header */ |
| 32 | #define IPV6_SRCRT_TYPE_2 2 /* IPv6 type 2 Routing Header */ | ||
| 32 | 33 | ||
| 33 | /* | 34 | /* |
| 34 | * routing header | 35 | * routing header |
| @@ -73,25 +74,47 @@ struct rt0_hdr { | |||
| 73 | #define rt0_type rt_hdr.type | 74 | #define rt0_type rt_hdr.type |
| 74 | }; | 75 | }; |
| 75 | 76 | ||
| 77 | /* | ||
| 78 | * routing header type 2 | ||
| 79 | */ | ||
| 80 | |||
| 81 | struct rt2_hdr { | ||
| 82 | struct ipv6_rt_hdr rt_hdr; | ||
| 83 | __u32 reserved; | ||
| 84 | struct in6_addr addr; | ||
| 85 | |||
| 86 | #define rt2_type rt_hdr.type | ||
| 87 | }; | ||
| 88 | |||
| 89 | /* | ||
| 90 | * home address option in destination options header | ||
| 91 | */ | ||
| 92 | |||
| 93 | struct ipv6_destopt_hao { | ||
| 94 | __u8 type; | ||
| 95 | __u8 length; | ||
| 96 | struct in6_addr addr; | ||
| 97 | } __attribute__ ((__packed__)); | ||
| 98 | |||
| 76 | struct ipv6_auth_hdr { | 99 | struct ipv6_auth_hdr { |
| 77 | __u8 nexthdr; | 100 | __u8 nexthdr; |
| 78 | __u8 hdrlen; /* This one is measured in 32 bit units! */ | 101 | __u8 hdrlen; /* This one is measured in 32 bit units! */ |
| 79 | __u16 reserved; | 102 | __be16 reserved; |
| 80 | __u32 spi; | 103 | __be32 spi; |
| 81 | __u32 seq_no; /* Sequence number */ | 104 | __be32 seq_no; /* Sequence number */ |
| 82 | __u8 auth_data[0]; /* Length variable but >=4. Mind the 64 bit alignment! */ | 105 | __u8 auth_data[0]; /* Length variable but >=4. Mind the 64 bit alignment! */ |
| 83 | }; | 106 | }; |
| 84 | 107 | ||
| 85 | struct ipv6_esp_hdr { | 108 | struct ipv6_esp_hdr { |
| 86 | __u32 spi; | 109 | __be32 spi; |
| 87 | __u32 seq_no; /* Sequence number */ | 110 | __be32 seq_no; /* Sequence number */ |
| 88 | __u8 enc_data[0]; /* Length variable but >=8. Mind the 64 bit alignment! */ | 111 | __u8 enc_data[0]; /* Length variable but >=8. Mind the 64 bit alignment! */ |
| 89 | }; | 112 | }; |
| 90 | 113 | ||
| 91 | struct ipv6_comp_hdr { | 114 | struct ipv6_comp_hdr { |
| 92 | __u8 nexthdr; | 115 | __u8 nexthdr; |
| 93 | __u8 flags; | 116 | __u8 flags; |
| 94 | __u16 cpi; | 117 | __be16 cpi; |
| 95 | }; | 118 | }; |
| 96 | 119 | ||
| 97 | /* | 120 | /* |
| @@ -113,7 +136,7 @@ struct ipv6hdr { | |||
| 113 | #endif | 136 | #endif |
| 114 | __u8 flow_lbl[3]; | 137 | __u8 flow_lbl[3]; |
| 115 | 138 | ||
| 116 | __u16 payload_len; | 139 | __be16 payload_len; |
| 117 | __u8 nexthdr; | 140 | __u8 nexthdr; |
| 118 | __u8 hop_limit; | 141 | __u8 hop_limit; |
| 119 | 142 | ||
| @@ -153,6 +176,7 @@ struct ipv6_devconf { | |||
| 153 | __s32 accept_ra_rt_info_max_plen; | 176 | __s32 accept_ra_rt_info_max_plen; |
| 154 | #endif | 177 | #endif |
| 155 | #endif | 178 | #endif |
| 179 | __s32 proxy_ndp; | ||
| 156 | void *sysctl; | 180 | void *sysctl; |
| 157 | }; | 181 | }; |
| 158 | 182 | ||
| @@ -180,6 +204,7 @@ enum { | |||
| 180 | DEVCONF_ACCEPT_RA_RTR_PREF, | 204 | DEVCONF_ACCEPT_RA_RTR_PREF, |
| 181 | DEVCONF_RTR_PROBE_INTERVAL, | 205 | DEVCONF_RTR_PROBE_INTERVAL, |
| 182 | DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN, | 206 | DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN, |
| 207 | DEVCONF_PROXY_NDP, | ||
| 183 | DEVCONF_MAX | 208 | DEVCONF_MAX |
| 184 | }; | 209 | }; |
| 185 | 210 | ||
| @@ -206,6 +231,9 @@ struct inet6_skb_parm { | |||
| 206 | __u16 lastopt; | 231 | __u16 lastopt; |
| 207 | __u32 nhoff; | 232 | __u32 nhoff; |
| 208 | __u16 flags; | 233 | __u16 flags; |
| 234 | #ifdef CONFIG_IPV6_MIP6 | ||
| 235 | __u16 dsthao; | ||
| 236 | #endif | ||
| 209 | 237 | ||
| 210 | #define IP6SKB_XFRM_TRANSFORMED 1 | 238 | #define IP6SKB_XFRM_TRANSFORMED 1 |
| 211 | }; | 239 | }; |
| @@ -242,6 +270,9 @@ struct ipv6_pinfo { | |||
| 242 | struct in6_addr rcv_saddr; | 270 | struct in6_addr rcv_saddr; |
| 243 | struct in6_addr daddr; | 271 | struct in6_addr daddr; |
| 244 | struct in6_addr *daddr_cache; | 272 | struct in6_addr *daddr_cache; |
| 273 | #ifdef CONFIG_IPV6_SUBTREES | ||
| 274 | struct in6_addr *saddr_cache; | ||
| 275 | #endif | ||
| 245 | 276 | ||
| 246 | __u32 flow_label; | 277 | __u32 flow_label; |
| 247 | __u32 frag_size; | 278 | __u32 frag_size; |
| @@ -430,7 +461,7 @@ static inline struct raw6_sock *raw6_sk(const struct sock *sk) | |||
| 430 | 461 | ||
| 431 | #define INET6_MATCH(__sk, __hash, __saddr, __daddr, __ports, __dif)\ | 462 | #define INET6_MATCH(__sk, __hash, __saddr, __daddr, __ports, __dif)\ |
| 432 | (((__sk)->sk_hash == (__hash)) && \ | 463 | (((__sk)->sk_hash == (__hash)) && \ |
| 433 | ((*((__u32 *)&(inet_sk(__sk)->dport))) == (__ports)) && \ | 464 | ((*((__portpair *)&(inet_sk(__sk)->dport))) == (__ports)) && \ |
| 434 | ((__sk)->sk_family == AF_INET6) && \ | 465 | ((__sk)->sk_family == AF_INET6) && \ |
| 435 | ipv6_addr_equal(&inet6_sk(__sk)->daddr, (__saddr)) && \ | 466 | ipv6_addr_equal(&inet6_sk(__sk)->daddr, (__saddr)) && \ |
| 436 | ipv6_addr_equal(&inet6_sk(__sk)->rcv_saddr, (__daddr)) && \ | 467 | ipv6_addr_equal(&inet6_sk(__sk)->rcv_saddr, (__daddr)) && \ |
diff --git a/include/linux/irq.h b/include/linux/irq.h index fbf6d901e9..48d3cb3b6a 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
| @@ -320,7 +320,9 @@ handle_irq_name(void fastcall (*handle)(unsigned int, struct irq_desc *, | |||
| 320 | * Monolithic do_IRQ implementation. | 320 | * Monolithic do_IRQ implementation. |
| 321 | * (is an explicit fastcall, because i386 4KSTACKS calls it from assembly) | 321 | * (is an explicit fastcall, because i386 4KSTACKS calls it from assembly) |
| 322 | */ | 322 | */ |
| 323 | #ifndef CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ | ||
| 323 | extern fastcall unsigned int __do_IRQ(unsigned int irq, struct pt_regs *regs); | 324 | extern fastcall unsigned int __do_IRQ(unsigned int irq, struct pt_regs *regs); |
| 325 | #endif | ||
| 324 | 326 | ||
| 325 | /* | 327 | /* |
| 326 | * Architectures call this to let the generic IRQ layer | 328 | * Architectures call this to let the generic IRQ layer |
| @@ -332,10 +334,14 @@ static inline void generic_handle_irq(unsigned int irq, struct pt_regs *regs) | |||
| 332 | { | 334 | { |
| 333 | struct irq_desc *desc = irq_desc + irq; | 335 | struct irq_desc *desc = irq_desc + irq; |
| 334 | 336 | ||
| 337 | #ifdef CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ | ||
| 338 | desc->handle_irq(irq, desc, regs); | ||
| 339 | #else | ||
| 335 | if (likely(desc->handle_irq)) | 340 | if (likely(desc->handle_irq)) |
| 336 | desc->handle_irq(irq, desc, regs); | 341 | desc->handle_irq(irq, desc, regs); |
| 337 | else | 342 | else |
| 338 | __do_IRQ(irq, regs); | 343 | __do_IRQ(irq, regs); |
| 344 | #endif | ||
| 339 | } | 345 | } |
| 340 | 346 | ||
| 341 | /* Handling of unhandled and spurious interrupts: */ | 347 | /* Handling of unhandled and spurious interrupts: */ |
diff --git a/include/linux/iso_fs.h b/include/linux/iso_fs.h index 47967878bf..4688ac4284 100644 --- a/include/linux/iso_fs.h +++ b/include/linux/iso_fs.h | |||
| @@ -2,6 +2,8 @@ | |||
| 2 | #define _ISOFS_FS_H | 2 | #define _ISOFS_FS_H |
| 3 | 3 | ||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | #include <linux/magic.h> | ||
| 6 | |||
| 5 | /* | 7 | /* |
| 6 | * The isofs filesystem constants/structures | 8 | * The isofs filesystem constants/structures |
| 7 | */ | 9 | */ |
| @@ -160,6 +162,4 @@ struct iso_directory_record { | |||
| 160 | #define ISOFS_BUFFER_SIZE(INODE) ((INODE)->i_sb->s_blocksize) | 162 | #define ISOFS_BUFFER_SIZE(INODE) ((INODE)->i_sb->s_blocksize) |
| 161 | #define ISOFS_BUFFER_BITS(INODE) ((INODE)->i_sb->s_blocksize_bits) | 163 | #define ISOFS_BUFFER_BITS(INODE) ((INODE)->i_sb->s_blocksize_bits) |
| 162 | 164 | ||
| 163 | #define ISOFS_SUPER_MAGIC 0x9660 | 165 | #endif /* _ISOFS_FS_H */ |
| 164 | |||
| 165 | #endif | ||
diff --git a/include/linux/jbd.h b/include/linux/jbd.h index a04c154c52..fe89444b1c 100644 --- a/include/linux/jbd.h +++ b/include/linux/jbd.h | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * linux/include/linux/jbd.h | 2 | * linux/include/linux/jbd.h |
| 3 | * | 3 | * |
| 4 | * Written by Stephen C. Tweedie <sct@redhat.com> | 4 | * Written by Stephen C. Tweedie <sct@redhat.com> |
| 5 | * | 5 | * |
| 6 | * Copyright 1998-2000 Red Hat, Inc --- All Rights Reserved | 6 | * Copyright 1998-2000 Red Hat, Inc --- All Rights Reserved |
| @@ -64,7 +64,7 @@ extern int journal_enable_debug; | |||
| 64 | if ((n) <= journal_enable_debug) { \ | 64 | if ((n) <= journal_enable_debug) { \ |
| 65 | printk (KERN_DEBUG "(%s, %d): %s: ", \ | 65 | printk (KERN_DEBUG "(%s, %d): %s: ", \ |
| 66 | __FILE__, __LINE__, __FUNCTION__); \ | 66 | __FILE__, __LINE__, __FUNCTION__); \ |
| 67 | printk (f, ## a); \ | 67 | printk (f, ## a); \ |
| 68 | } \ | 68 | } \ |
| 69 | } while (0) | 69 | } while (0) |
| 70 | #else | 70 | #else |
| @@ -97,8 +97,8 @@ extern void jbd_slab_free(void *ptr, size_t size); | |||
| 97 | * number of outstanding buffers possible at any time. When the | 97 | * number of outstanding buffers possible at any time. When the |
| 98 | * operation completes, any buffer credits not used are credited back to | 98 | * operation completes, any buffer credits not used are credited back to |
| 99 | * the transaction, so that at all times we know how many buffers the | 99 | * the transaction, so that at all times we know how many buffers the |
| 100 | * outstanding updates on a transaction might possibly touch. | 100 | * outstanding updates on a transaction might possibly touch. |
| 101 | * | 101 | * |
| 102 | * This is an opaque datatype. | 102 | * This is an opaque datatype. |
| 103 | **/ | 103 | **/ |
| 104 | typedef struct handle_s handle_t; /* Atomic operation type */ | 104 | typedef struct handle_s handle_t; /* Atomic operation type */ |
| @@ -108,7 +108,7 @@ typedef struct handle_s handle_t; /* Atomic operation type */ | |||
| 108 | * typedef journal_t - The journal_t maintains all of the journaling state information for a single filesystem. | 108 | * typedef journal_t - The journal_t maintains all of the journaling state information for a single filesystem. |
| 109 | * | 109 | * |
| 110 | * journal_t is linked to from the fs superblock structure. | 110 | * journal_t is linked to from the fs superblock structure. |
| 111 | * | 111 | * |
| 112 | * We use the journal_t to keep track of all outstanding transaction | 112 | * We use the journal_t to keep track of all outstanding transaction |
| 113 | * activity on the filesystem, and to manage the state of the log | 113 | * activity on the filesystem, and to manage the state of the log |
| 114 | * writing process. | 114 | * writing process. |
| @@ -128,7 +128,7 @@ typedef struct journal_s journal_t; /* Journal control structure */ | |||
| 128 | * On-disk structures | 128 | * On-disk structures |
| 129 | */ | 129 | */ |
| 130 | 130 | ||
| 131 | /* | 131 | /* |
| 132 | * Descriptor block types: | 132 | * Descriptor block types: |
| 133 | */ | 133 | */ |
| 134 | 134 | ||
| @@ -149,8 +149,8 @@ typedef struct journal_header_s | |||
| 149 | } journal_header_t; | 149 | } journal_header_t; |
| 150 | 150 | ||
| 151 | 151 | ||
| 152 | /* | 152 | /* |
| 153 | * The block tag: used to describe a single buffer in the journal | 153 | * The block tag: used to describe a single buffer in the journal |
| 154 | */ | 154 | */ |
| 155 | typedef struct journal_block_tag_s | 155 | typedef struct journal_block_tag_s |
| 156 | { | 156 | { |
| @@ -158,9 +158,9 @@ typedef struct journal_block_tag_s | |||
| 158 | __be32 t_flags; /* See below */ | 158 | __be32 t_flags; /* See below */ |
| 159 | } journal_block_tag_t; | 159 | } journal_block_tag_t; |
| 160 | 160 | ||
| 161 | /* | 161 | /* |
| 162 | * The revoke descriptor: used on disk to describe a series of blocks to | 162 | * The revoke descriptor: used on disk to describe a series of blocks to |
| 163 | * be revoked from the log | 163 | * be revoked from the log |
| 164 | */ | 164 | */ |
| 165 | typedef struct journal_revoke_header_s | 165 | typedef struct journal_revoke_header_s |
| 166 | { | 166 | { |
| @@ -201,9 +201,9 @@ typedef struct journal_superblock_s | |||
| 201 | 201 | ||
| 202 | /* 0x0024 */ | 202 | /* 0x0024 */ |
| 203 | /* Remaining fields are only valid in a version-2 superblock */ | 203 | /* Remaining fields are only valid in a version-2 superblock */ |
| 204 | __be32 s_feature_compat; /* compatible feature set */ | 204 | __be32 s_feature_compat; /* compatible feature set */ |
| 205 | __be32 s_feature_incompat; /* incompatible feature set */ | 205 | __be32 s_feature_incompat; /* incompatible feature set */ |
| 206 | __be32 s_feature_ro_compat; /* readonly-compatible feature set */ | 206 | __be32 s_feature_ro_compat; /* readonly-compatible feature set */ |
| 207 | /* 0x0030 */ | 207 | /* 0x0030 */ |
| 208 | __u8 s_uuid[16]; /* 128-bit uuid for journal */ | 208 | __u8 s_uuid[16]; /* 128-bit uuid for journal */ |
| 209 | 209 | ||
| @@ -374,10 +374,10 @@ struct jbd_revoke_table_s; | |||
| 374 | **/ | 374 | **/ |
| 375 | 375 | ||
| 376 | /* Docbook can't yet cope with the bit fields, but will leave the documentation | 376 | /* Docbook can't yet cope with the bit fields, but will leave the documentation |
| 377 | * in so it can be fixed later. | 377 | * in so it can be fixed later. |
| 378 | */ | 378 | */ |
| 379 | 379 | ||
| 380 | struct handle_s | 380 | struct handle_s |
| 381 | { | 381 | { |
| 382 | /* Which compound transaction is this update a part of? */ | 382 | /* Which compound transaction is this update a part of? */ |
| 383 | transaction_t *h_transaction; | 383 | transaction_t *h_transaction; |
| @@ -435,7 +435,7 @@ struct handle_s | |||
| 435 | * | 435 | * |
| 436 | */ | 436 | */ |
| 437 | 437 | ||
| 438 | struct transaction_s | 438 | struct transaction_s |
| 439 | { | 439 | { |
| 440 | /* Pointer to the journal for this transaction. [no locking] */ | 440 | /* Pointer to the journal for this transaction. [no locking] */ |
| 441 | journal_t *t_journal; | 441 | journal_t *t_journal; |
| @@ -455,7 +455,7 @@ struct transaction_s | |||
| 455 | T_RUNDOWN, | 455 | T_RUNDOWN, |
| 456 | T_FLUSH, | 456 | T_FLUSH, |
| 457 | T_COMMIT, | 457 | T_COMMIT, |
| 458 | T_FINISHED | 458 | T_FINISHED |
| 459 | } t_state; | 459 | } t_state; |
| 460 | 460 | ||
| 461 | /* | 461 | /* |
| @@ -569,7 +569,7 @@ struct transaction_s | |||
| 569 | * journal_t. | 569 | * journal_t. |
| 570 | * @j_flags: General journaling state flags | 570 | * @j_flags: General journaling state flags |
| 571 | * @j_errno: Is there an outstanding uncleared error on the journal (from a | 571 | * @j_errno: Is there an outstanding uncleared error on the journal (from a |
| 572 | * prior abort)? | 572 | * prior abort)? |
| 573 | * @j_sb_buffer: First part of superblock buffer | 573 | * @j_sb_buffer: First part of superblock buffer |
| 574 | * @j_superblock: Second part of superblock buffer | 574 | * @j_superblock: Second part of superblock buffer |
| 575 | * @j_format_version: Version of the superblock format | 575 | * @j_format_version: Version of the superblock format |
| @@ -583,7 +583,7 @@ struct transaction_s | |||
| 583 | * @j_wait_transaction_locked: Wait queue for waiting for a locked transaction | 583 | * @j_wait_transaction_locked: Wait queue for waiting for a locked transaction |
| 584 | * to start committing, or for a barrier lock to be released | 584 | * to start committing, or for a barrier lock to be released |
| 585 | * @j_wait_logspace: Wait queue for waiting for checkpointing to complete | 585 | * @j_wait_logspace: Wait queue for waiting for checkpointing to complete |
| 586 | * @j_wait_done_commit: Wait queue for waiting for commit to complete | 586 | * @j_wait_done_commit: Wait queue for waiting for commit to complete |
| 587 | * @j_wait_checkpoint: Wait queue to trigger checkpointing | 587 | * @j_wait_checkpoint: Wait queue to trigger checkpointing |
| 588 | * @j_wait_commit: Wait queue to trigger commit | 588 | * @j_wait_commit: Wait queue to trigger commit |
| 589 | * @j_wait_updates: Wait queue to wait for updates to complete | 589 | * @j_wait_updates: Wait queue to wait for updates to complete |
| @@ -592,7 +592,7 @@ struct transaction_s | |||
| 592 | * @j_tail: Journal tail - identifies the oldest still-used block in the | 592 | * @j_tail: Journal tail - identifies the oldest still-used block in the |
| 593 | * journal. | 593 | * journal. |
| 594 | * @j_free: Journal free - how many free blocks are there in the journal? | 594 | * @j_free: Journal free - how many free blocks are there in the journal? |
| 595 | * @j_first: The block number of the first usable block | 595 | * @j_first: The block number of the first usable block |
| 596 | * @j_last: The block number one beyond the last usable block | 596 | * @j_last: The block number one beyond the last usable block |
| 597 | * @j_dev: Device where we store the journal | 597 | * @j_dev: Device where we store the journal |
| 598 | * @j_blocksize: blocksize for the location where we store the journal. | 598 | * @j_blocksize: blocksize for the location where we store the journal. |
| @@ -604,12 +604,12 @@ struct transaction_s | |||
| 604 | * @j_list_lock: Protects the buffer lists and internal buffer state. | 604 | * @j_list_lock: Protects the buffer lists and internal buffer state. |
| 605 | * @j_inode: Optional inode where we store the journal. If present, all journal | 605 | * @j_inode: Optional inode where we store the journal. If present, all journal |
| 606 | * block numbers are mapped into this inode via bmap(). | 606 | * block numbers are mapped into this inode via bmap(). |
| 607 | * @j_tail_sequence: Sequence number of the oldest transaction in the log | 607 | * @j_tail_sequence: Sequence number of the oldest transaction in the log |
| 608 | * @j_transaction_sequence: Sequence number of the next transaction to grant | 608 | * @j_transaction_sequence: Sequence number of the next transaction to grant |
| 609 | * @j_commit_sequence: Sequence number of the most recently committed | 609 | * @j_commit_sequence: Sequence number of the most recently committed |
| 610 | * transaction | 610 | * transaction |
| 611 | * @j_commit_request: Sequence number of the most recent transaction wanting | 611 | * @j_commit_request: Sequence number of the most recent transaction wanting |
| 612 | * commit | 612 | * commit |
| 613 | * @j_uuid: Uuid of client object. | 613 | * @j_uuid: Uuid of client object. |
| 614 | * @j_task: Pointer to the current commit thread for this journal | 614 | * @j_task: Pointer to the current commit thread for this journal |
| 615 | * @j_max_transaction_buffers: Maximum number of metadata buffers to allow in a | 615 | * @j_max_transaction_buffers: Maximum number of metadata buffers to allow in a |
| @@ -699,7 +699,7 @@ struct journal_s | |||
| 699 | wait_queue_head_t j_wait_updates; | 699 | wait_queue_head_t j_wait_updates; |
| 700 | 700 | ||
| 701 | /* Semaphore for locking against concurrent checkpoints */ | 701 | /* Semaphore for locking against concurrent checkpoints */ |
| 702 | struct mutex j_checkpoint_mutex; | 702 | struct mutex j_checkpoint_mutex; |
| 703 | 703 | ||
| 704 | /* | 704 | /* |
| 705 | * Journal head: identifies the first unused block in the journal. | 705 | * Journal head: identifies the first unused block in the journal. |
| @@ -732,7 +732,7 @@ struct journal_s | |||
| 732 | */ | 732 | */ |
| 733 | struct block_device *j_dev; | 733 | struct block_device *j_dev; |
| 734 | int j_blocksize; | 734 | int j_blocksize; |
| 735 | unsigned int j_blk_offset; | 735 | unsigned long j_blk_offset; |
| 736 | 736 | ||
| 737 | /* | 737 | /* |
| 738 | * Device which holds the client fs. For internal journal this will be | 738 | * Device which holds the client fs. For internal journal this will be |
| @@ -823,8 +823,8 @@ struct journal_s | |||
| 823 | void *j_private; | 823 | void *j_private; |
| 824 | }; | 824 | }; |
| 825 | 825 | ||
| 826 | /* | 826 | /* |
| 827 | * Journal flag definitions | 827 | * Journal flag definitions |
| 828 | */ | 828 | */ |
| 829 | #define JFS_UNMOUNT 0x001 /* Journal thread is being destroyed */ | 829 | #define JFS_UNMOUNT 0x001 /* Journal thread is being destroyed */ |
| 830 | #define JFS_ABORT 0x002 /* Journaling has been aborted for errors. */ | 830 | #define JFS_ABORT 0x002 /* Journaling has been aborted for errors. */ |
| @@ -833,7 +833,7 @@ struct journal_s | |||
| 833 | #define JFS_LOADED 0x010 /* The journal superblock has been loaded */ | 833 | #define JFS_LOADED 0x010 /* The journal superblock has been loaded */ |
| 834 | #define JFS_BARRIER 0x020 /* Use IDE barriers */ | 834 | #define JFS_BARRIER 0x020 /* Use IDE barriers */ |
| 835 | 835 | ||
| 836 | /* | 836 | /* |
| 837 | * Function declarations for the journaling transaction and buffer | 837 | * Function declarations for the journaling transaction and buffer |
| 838 | * management | 838 | * management |
| 839 | */ | 839 | */ |
| @@ -862,11 +862,11 @@ int __journal_remove_checkpoint(struct journal_head *); | |||
| 862 | void __journal_insert_checkpoint(struct journal_head *, transaction_t *); | 862 | void __journal_insert_checkpoint(struct journal_head *, transaction_t *); |
| 863 | 863 | ||
| 864 | /* Buffer IO */ | 864 | /* Buffer IO */ |
| 865 | extern int | 865 | extern int |
| 866 | journal_write_metadata_buffer(transaction_t *transaction, | 866 | journal_write_metadata_buffer(transaction_t *transaction, |
| 867 | struct journal_head *jh_in, | 867 | struct journal_head *jh_in, |
| 868 | struct journal_head **jh_out, | 868 | struct journal_head **jh_out, |
| 869 | int blocknr); | 869 | unsigned long blocknr); |
| 870 | 870 | ||
| 871 | /* Transaction locking */ | 871 | /* Transaction locking */ |
| 872 | extern void __wait_on_journal (journal_t *); | 872 | extern void __wait_on_journal (journal_t *); |
| @@ -890,7 +890,7 @@ static inline handle_t *journal_current_handle(void) | |||
| 890 | /* The journaling code user interface: | 890 | /* The journaling code user interface: |
| 891 | * | 891 | * |
| 892 | * Create and destroy handles | 892 | * Create and destroy handles |
| 893 | * Register buffer modifications against the current transaction. | 893 | * Register buffer modifications against the current transaction. |
| 894 | */ | 894 | */ |
| 895 | 895 | ||
| 896 | extern handle_t *journal_start(journal_t *, int nblocks); | 896 | extern handle_t *journal_start(journal_t *, int nblocks); |
| @@ -917,11 +917,11 @@ extern journal_t * journal_init_dev(struct block_device *bdev, | |||
| 917 | int start, int len, int bsize); | 917 | int start, int len, int bsize); |
| 918 | extern journal_t * journal_init_inode (struct inode *); | 918 | extern journal_t * journal_init_inode (struct inode *); |
| 919 | extern int journal_update_format (journal_t *); | 919 | extern int journal_update_format (journal_t *); |
| 920 | extern int journal_check_used_features | 920 | extern int journal_check_used_features |
| 921 | (journal_t *, unsigned long, unsigned long, unsigned long); | 921 | (journal_t *, unsigned long, unsigned long, unsigned long); |
| 922 | extern int journal_check_available_features | 922 | extern int journal_check_available_features |
| 923 | (journal_t *, unsigned long, unsigned long, unsigned long); | 923 | (journal_t *, unsigned long, unsigned long, unsigned long); |
| 924 | extern int journal_set_features | 924 | extern int journal_set_features |
| 925 | (journal_t *, unsigned long, unsigned long, unsigned long); | 925 | (journal_t *, unsigned long, unsigned long, unsigned long); |
| 926 | extern int journal_create (journal_t *); | 926 | extern int journal_create (journal_t *); |
| 927 | extern int journal_load (journal_t *journal); | 927 | extern int journal_load (journal_t *journal); |
| @@ -977,7 +977,6 @@ extern void journal_write_revoke_records(journal_t *, transaction_t *); | |||
| 977 | extern int journal_set_revoke(journal_t *, unsigned long, tid_t); | 977 | extern int journal_set_revoke(journal_t *, unsigned long, tid_t); |
| 978 | extern int journal_test_revoke(journal_t *, unsigned long, tid_t); | 978 | extern int journal_test_revoke(journal_t *, unsigned long, tid_t); |
| 979 | extern void journal_clear_revoke(journal_t *); | 979 | extern void journal_clear_revoke(journal_t *); |
| 980 | extern void journal_brelse_array(struct buffer_head *b[], int n); | ||
| 981 | extern void journal_switch_revoke_table(journal_t *journal); | 980 | extern void journal_switch_revoke_table(journal_t *journal); |
| 982 | 981 | ||
| 983 | /* | 982 | /* |
| @@ -1015,7 +1014,7 @@ do { \ | |||
| 1015 | * bit, when set, indicates that we have had a fatal error somewhere, | 1014 | * bit, when set, indicates that we have had a fatal error somewhere, |
| 1016 | * either inside the journaling layer or indicated to us by the client | 1015 | * either inside the journaling layer or indicated to us by the client |
| 1017 | * (eg. ext3), and that we and should not commit any further | 1016 | * (eg. ext3), and that we and should not commit any further |
| 1018 | * transactions. | 1017 | * transactions. |
| 1019 | */ | 1018 | */ |
| 1020 | 1019 | ||
| 1021 | static inline int is_journal_aborted(journal_t *journal) | 1020 | static inline int is_journal_aborted(journal_t *journal) |
| @@ -1082,7 +1081,7 @@ static inline int jbd_space_needed(journal_t *journal) | |||
| 1082 | #define BJ_Reserved 7 /* Buffer is reserved for access by journal */ | 1081 | #define BJ_Reserved 7 /* Buffer is reserved for access by journal */ |
| 1083 | #define BJ_Locked 8 /* Locked for I/O during commit */ | 1082 | #define BJ_Locked 8 /* Locked for I/O during commit */ |
| 1084 | #define BJ_Types 9 | 1083 | #define BJ_Types 9 |
| 1085 | 1084 | ||
| 1086 | extern int jbd_blocks_per_page(struct inode *inode); | 1085 | extern int jbd_blocks_per_page(struct inode *inode); |
| 1087 | 1086 | ||
| 1088 | #ifdef __KERNEL__ | 1087 | #ifdef __KERNEL__ |
diff --git a/include/linux/jffs2.h b/include/linux/jffs2.h index c9c760700b..840631fa5f 100644 --- a/include/linux/jffs2.h +++ b/include/linux/jffs2.h | |||
| @@ -15,12 +15,12 @@ | |||
| 15 | #ifndef __LINUX_JFFS2_H__ | 15 | #ifndef __LINUX_JFFS2_H__ |
| 16 | #define __LINUX_JFFS2_H__ | 16 | #define __LINUX_JFFS2_H__ |
| 17 | 17 | ||
| 18 | #include <linux/magic.h> | ||
| 19 | |||
| 18 | /* You must include something which defines the C99 uintXX_t types. | 20 | /* You must include something which defines the C99 uintXX_t types. |
| 19 | We don't do it from here because this file is used in too many | 21 | We don't do it from here because this file is used in too many |
| 20 | different environments. */ | 22 | different environments. */ |
| 21 | 23 | ||
| 22 | #define JFFS2_SUPER_MAGIC 0x72b6 | ||
| 23 | |||
| 24 | /* Values we may expect to find in the 'magic' field */ | 24 | /* Values we may expect to find in the 'magic' field */ |
| 25 | #define JFFS2_OLD_MAGIC_BITMASK 0x1984 | 25 | #define JFFS2_OLD_MAGIC_BITMASK 0x1984 |
| 26 | #define JFFS2_MAGIC_BITMASK 0x1985 | 26 | #define JFFS2_MAGIC_BITMASK 0x1985 |
diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h index 329ebcffa1..c8d5f207c3 100644 --- a/include/linux/jiffies.h +++ b/include/linux/jiffies.h | |||
| @@ -115,6 +115,21 @@ static inline u64 get_jiffies_64(void) | |||
| 115 | ((long)(a) - (long)(b) >= 0)) | 115 | ((long)(a) - (long)(b) >= 0)) |
| 116 | #define time_before_eq(a,b) time_after_eq(b,a) | 116 | #define time_before_eq(a,b) time_after_eq(b,a) |
| 117 | 117 | ||
| 118 | /* Same as above, but does so with platform independent 64bit types. | ||
| 119 | * These must be used when utilizing jiffies_64 (i.e. return value of | ||
| 120 | * get_jiffies_64() */ | ||
| 121 | #define time_after64(a,b) \ | ||
| 122 | (typecheck(__u64, a) && \ | ||
| 123 | typecheck(__u64, b) && \ | ||
| 124 | ((__s64)(b) - (__s64)(a) < 0)) | ||
| 125 | #define time_before64(a,b) time_after64(b,a) | ||
| 126 | |||
| 127 | #define time_after_eq64(a,b) \ | ||
| 128 | (typecheck(__u64, a) && \ | ||
| 129 | typecheck(__u64, b) && \ | ||
| 130 | ((__s64)(a) - (__s64)(b) >= 0)) | ||
| 131 | #define time_before_eq64(a,b) time_after_eq64(b,a) | ||
| 132 | |||
| 118 | /* | 133 | /* |
| 119 | * Have the 32 bit jiffies value wrap 5 minutes after boot | 134 | * Have the 32 bit jiffies value wrap 5 minutes after boot |
| 120 | * so jiffies wrap bugs show up earlier. | 135 | * so jiffies wrap bugs show up earlier. |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 851aa1bcfc..4d00988dad 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
| @@ -31,8 +31,9 @@ extern const char linux_banner[]; | |||
| 31 | #define STACK_MAGIC 0xdeadbeef | 31 | #define STACK_MAGIC 0xdeadbeef |
| 32 | 32 | ||
| 33 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) | 33 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) |
| 34 | #define ALIGN(x,a) (((x)+(a)-1)&~((a)-1)) | 34 | #define ALIGN(x,a) (((x)+(a)-1UL)&~((a)-1UL)) |
| 35 | #define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f)) | 35 | #define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f)) |
| 36 | #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) | ||
| 36 | #define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) | 37 | #define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) |
| 37 | 38 | ||
| 38 | #define KERN_EMERG "<0>" /* system is unusable */ | 39 | #define KERN_EMERG "<0>" /* system is unusable */ |
| @@ -186,6 +187,7 @@ extern void bust_spinlocks(int yes); | |||
| 186 | extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in progress */ | 187 | extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in progress */ |
| 187 | extern int panic_timeout; | 188 | extern int panic_timeout; |
| 188 | extern int panic_on_oops; | 189 | extern int panic_on_oops; |
| 190 | extern int panic_on_unrecovered_nmi; | ||
| 189 | extern int tainted; | 191 | extern int tainted; |
| 190 | extern const char *print_tainted(void); | 192 | extern const char *print_tainted(void); |
| 191 | extern void add_taint(unsigned); | 193 | extern void add_taint(unsigned); |
| @@ -348,4 +350,11 @@ struct sysinfo { | |||
| 348 | /* Trap pasters of __FUNCTION__ at compile-time */ | 350 | /* Trap pasters of __FUNCTION__ at compile-time */ |
| 349 | #define __FUNCTION__ (__func__) | 351 | #define __FUNCTION__ (__func__) |
| 350 | 352 | ||
| 353 | /* This helps us to avoid #ifdef CONFIG_NUMA */ | ||
| 354 | #ifdef CONFIG_NUMA | ||
| 355 | #define NUMA_BUILD 1 | ||
| 356 | #else | ||
| 357 | #define NUMA_BUILD 0 | ||
| 358 | #endif | ||
| 359 | |||
| 351 | #endif | 360 | #endif |
diff --git a/include/linux/kmod.h b/include/linux/kmod.h index 0db22a1ab4..10f505c843 100644 --- a/include/linux/kmod.h +++ b/include/linux/kmod.h | |||
| @@ -47,4 +47,8 @@ call_usermodehelper(char *path, char **argv, char **envp, int wait) | |||
| 47 | 47 | ||
| 48 | extern void usermodehelper_init(void); | 48 | extern void usermodehelper_init(void); |
| 49 | 49 | ||
| 50 | struct file; | ||
| 51 | extern int call_usermodehelper_pipe(char *path, char *argv[], char *envp[], | ||
| 52 | struct file **filp); | ||
| 53 | |||
| 50 | #endif /* __LINUX_KMOD_H__ */ | 54 | #endif /* __LINUX_KMOD_H__ */ |
diff --git a/include/linux/kobject.h b/include/linux/kobject.h index 2d22932795..bcd9cd173c 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | #include <linux/types.h> | 20 | #include <linux/types.h> |
| 21 | #include <linux/list.h> | 21 | #include <linux/list.h> |
| 22 | #include <linux/sysfs.h> | 22 | #include <linux/sysfs.h> |
| 23 | #include <linux/compiler.h> | ||
| 23 | #include <linux/spinlock.h> | 24 | #include <linux/spinlock.h> |
| 24 | #include <linux/rwsem.h> | 25 | #include <linux/rwsem.h> |
| 25 | #include <linux/kref.h> | 26 | #include <linux/kref.h> |
| @@ -71,12 +72,12 @@ static inline const char * kobject_name(const struct kobject * kobj) | |||
| 71 | extern void kobject_init(struct kobject *); | 72 | extern void kobject_init(struct kobject *); |
| 72 | extern void kobject_cleanup(struct kobject *); | 73 | extern void kobject_cleanup(struct kobject *); |
| 73 | 74 | ||
| 74 | extern int kobject_add(struct kobject *); | 75 | extern int __must_check kobject_add(struct kobject *); |
| 75 | extern void kobject_del(struct kobject *); | 76 | extern void kobject_del(struct kobject *); |
| 76 | 77 | ||
| 77 | extern int kobject_rename(struct kobject *, const char *new_name); | 78 | extern int __must_check kobject_rename(struct kobject *, const char *new_name); |
| 78 | 79 | ||
| 79 | extern int kobject_register(struct kobject *); | 80 | extern int __must_check kobject_register(struct kobject *); |
| 80 | extern void kobject_unregister(struct kobject *); | 81 | extern void kobject_unregister(struct kobject *); |
| 81 | 82 | ||
| 82 | extern struct kobject * kobject_get(struct kobject *); | 83 | extern struct kobject * kobject_get(struct kobject *); |
| @@ -128,8 +129,8 @@ struct kset { | |||
| 128 | 129 | ||
| 129 | 130 | ||
| 130 | extern void kset_init(struct kset * k); | 131 | extern void kset_init(struct kset * k); |
| 131 | extern int kset_add(struct kset * k); | 132 | extern int __must_check kset_add(struct kset * k); |
| 132 | extern int kset_register(struct kset * k); | 133 | extern int __must_check kset_register(struct kset * k); |
| 133 | extern void kset_unregister(struct kset * k); | 134 | extern void kset_unregister(struct kset * k); |
| 134 | 135 | ||
| 135 | static inline struct kset * to_kset(struct kobject * kobj) | 136 | static inline struct kset * to_kset(struct kobject * kobj) |
| @@ -239,7 +240,7 @@ extern struct subsystem hypervisor_subsys; | |||
| 239 | (obj)->subsys.kset.kobj.kset = &(_subsys).kset | 240 | (obj)->subsys.kset.kobj.kset = &(_subsys).kset |
| 240 | 241 | ||
| 241 | extern void subsystem_init(struct subsystem *); | 242 | extern void subsystem_init(struct subsystem *); |
| 242 | extern int subsystem_register(struct subsystem *); | 243 | extern int __must_check subsystem_register(struct subsystem *); |
| 243 | extern void subsystem_unregister(struct subsystem *); | 244 | extern void subsystem_unregister(struct subsystem *); |
| 244 | 245 | ||
| 245 | static inline struct subsystem * subsys_get(struct subsystem * s) | 246 | static inline struct subsystem * subsys_get(struct subsystem * s) |
| @@ -258,7 +259,8 @@ struct subsys_attribute { | |||
| 258 | ssize_t (*store)(struct subsystem *, const char *, size_t); | 259 | ssize_t (*store)(struct subsystem *, const char *, size_t); |
| 259 | }; | 260 | }; |
| 260 | 261 | ||
| 261 | extern int subsys_create_file(struct subsystem * , struct subsys_attribute *); | 262 | extern int __must_check subsys_create_file(struct subsystem * , |
| 263 | struct subsys_attribute *); | ||
| 262 | 264 | ||
| 263 | #if defined(CONFIG_HOTPLUG) | 265 | #if defined(CONFIG_HOTPLUG) |
| 264 | void kobject_uevent(struct kobject *kobj, enum kobject_action action); | 266 | void kobject_uevent(struct kobject *kobj, enum kobject_action action); |
diff --git a/include/linux/latency.h b/include/linux/latency.h new file mode 100644 index 0000000000..c08b52bb55 --- /dev/null +++ b/include/linux/latency.h | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | /* | ||
| 2 | * latency.h: Explicit system-wide latency-expectation infrastructure | ||
| 3 | * | ||
| 4 | * (C) Copyright 2006 Intel Corporation | ||
| 5 | * Author: Arjan van de Ven <arjan@linux.intel.com> | ||
| 6 | * | ||
| 7 | */ | ||
| 8 | |||
| 9 | #ifndef _INCLUDE_GUARD_LATENCY_H_ | ||
| 10 | #define _INCLUDE_GUARD_LATENCY_H_ | ||
| 11 | |||
| 12 | #include <linux/notifier.h> | ||
| 13 | |||
| 14 | void set_acceptable_latency(char *identifier, int usecs); | ||
| 15 | void modify_acceptable_latency(char *identifier, int usecs); | ||
| 16 | void remove_acceptable_latency(char *identifier); | ||
| 17 | void synchronize_acceptable_latency(void); | ||
| 18 | int system_latency_constraint(void); | ||
| 19 | |||
| 20 | int register_latency_notifier(struct notifier_block * nb); | ||
| 21 | int unregister_latency_notifier(struct notifier_block * nb); | ||
| 22 | |||
| 23 | #define INFINITE_LATENCY 1000000 | ||
| 24 | |||
| 25 | #endif | ||
diff --git a/include/linux/leds.h b/include/linux/leds.h index dc23c7c639..88afceffb7 100644 --- a/include/linux/leds.h +++ b/include/linux/leds.h | |||
| @@ -12,6 +12,9 @@ | |||
| 12 | #ifndef __LINUX_LEDS_H_INCLUDED | 12 | #ifndef __LINUX_LEDS_H_INCLUDED |
| 13 | #define __LINUX_LEDS_H_INCLUDED | 13 | #define __LINUX_LEDS_H_INCLUDED |
| 14 | 14 | ||
| 15 | #include <linux/list.h> | ||
| 16 | #include <linux/spinlock.h> | ||
| 17 | |||
| 15 | struct device; | 18 | struct device; |
| 16 | struct class_device; | 19 | struct class_device; |
| 17 | /* | 20 | /* |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 66c3100c2b..d6a3d4b345 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
| @@ -37,6 +37,16 @@ | |||
| 37 | #include <scsi/scsi_host.h> | 37 | #include <scsi/scsi_host.h> |
| 38 | 38 | ||
| 39 | /* | 39 | /* |
| 40 | * Define if arch has non-standard setup. This is a _PCI_ standard | ||
| 41 | * not a legacy or ISA standard. | ||
| 42 | */ | ||
| 43 | #ifdef CONFIG_ATA_NONSTANDARD | ||
| 44 | #include <asm/libata-portmap.h> | ||
| 45 | #else | ||
| 46 | #include <asm-generic/libata-portmap.h> | ||
| 47 | #endif | ||
| 48 | |||
| 49 | /* | ||
| 40 | * compile-time options: to be removed as soon as all the drivers are | 50 | * compile-time options: to be removed as soon as all the drivers are |
| 41 | * converted to the new debugging mechanism | 51 | * converted to the new debugging mechanism |
| 42 | */ | 52 | */ |
| @@ -44,7 +54,7 @@ | |||
| 44 | #undef ATA_VERBOSE_DEBUG /* yet more debugging output */ | 54 | #undef ATA_VERBOSE_DEBUG /* yet more debugging output */ |
| 45 | #undef ATA_IRQ_TRAP /* define to ack screaming irqs */ | 55 | #undef ATA_IRQ_TRAP /* define to ack screaming irqs */ |
| 46 | #undef ATA_NDEBUG /* define to disable quick runtime checks */ | 56 | #undef ATA_NDEBUG /* define to disable quick runtime checks */ |
| 47 | #undef ATA_ENABLE_PATA /* define to enable PATA support in some | 57 | #define ATA_ENABLE_PATA /* define to enable PATA support in some |
| 48 | * low-level drivers */ | 58 | * low-level drivers */ |
| 49 | 59 | ||
| 50 | 60 | ||
| @@ -112,8 +122,6 @@ enum { | |||
| 112 | /* tag ATA_MAX_QUEUE - 1 is reserved for internal commands */ | 122 | /* tag ATA_MAX_QUEUE - 1 is reserved for internal commands */ |
| 113 | ATA_MAX_QUEUE = 32, | 123 | ATA_MAX_QUEUE = 32, |
| 114 | ATA_TAG_INTERNAL = ATA_MAX_QUEUE - 1, | 124 | ATA_TAG_INTERNAL = ATA_MAX_QUEUE - 1, |
| 115 | ATA_MAX_SECTORS = 200, /* FIXME */ | ||
| 116 | ATA_MAX_SECTORS_LBA48 = 65535, | ||
| 117 | ATA_MAX_BUS = 2, | 125 | ATA_MAX_BUS = 2, |
| 118 | ATA_DEF_BUSY_WAIT = 10000, | 126 | ATA_DEF_BUSY_WAIT = 10000, |
| 119 | ATA_SHORT_PAUSE = (HZ >> 6) + 1, | 127 | ATA_SHORT_PAUSE = (HZ >> 6) + 1, |
| @@ -197,8 +205,8 @@ enum { | |||
| 197 | ATA_QCFLAG_EH_SCHEDULED = (1 << 18), /* EH scheduled (obsolete) */ | 205 | ATA_QCFLAG_EH_SCHEDULED = (1 << 18), /* EH scheduled (obsolete) */ |
| 198 | 206 | ||
| 199 | /* host set flags */ | 207 | /* host set flags */ |
| 200 | ATA_HOST_SIMPLEX = (1 << 0), /* Host is simplex, one DMA channel per host_set only */ | 208 | ATA_HOST_SIMPLEX = (1 << 0), /* Host is simplex, one DMA channel per host only */ |
| 201 | 209 | ||
| 202 | /* various lengths of time */ | 210 | /* various lengths of time */ |
| 203 | ATA_TMOUT_BOOT = 30 * HZ, /* heuristic */ | 211 | ATA_TMOUT_BOOT = 30 * HZ, /* heuristic */ |
| 204 | ATA_TMOUT_BOOT_QUICK = 7 * HZ, /* heuristic */ | 212 | ATA_TMOUT_BOOT_QUICK = 7 * HZ, /* heuristic */ |
| @@ -225,8 +233,8 @@ enum { | |||
| 225 | /* encoding various smaller bitmaps into a single | 233 | /* encoding various smaller bitmaps into a single |
| 226 | * unsigned int bitmap | 234 | * unsigned int bitmap |
| 227 | */ | 235 | */ |
| 228 | ATA_BITS_PIO = 5, | 236 | ATA_BITS_PIO = 7, |
| 229 | ATA_BITS_MWDMA = 3, | 237 | ATA_BITS_MWDMA = 5, |
| 230 | ATA_BITS_UDMA = 8, | 238 | ATA_BITS_UDMA = 8, |
| 231 | 239 | ||
| 232 | ATA_SHIFT_PIO = 0, | 240 | ATA_SHIFT_PIO = 0, |
| @@ -289,6 +297,11 @@ enum { | |||
| 289 | * most devices. | 297 | * most devices. |
| 290 | */ | 298 | */ |
| 291 | ATA_SPINUP_WAIT = 8000, | 299 | ATA_SPINUP_WAIT = 8000, |
| 300 | |||
| 301 | /* Horkage types. May be set by libata or controller on drives | ||
| 302 | (some horkage may be drive/controller pair dependant */ | ||
| 303 | |||
| 304 | ATA_HORKAGE_DIAGNOSTIC = (1 << 0), /* Failed boot diag */ | ||
| 292 | }; | 305 | }; |
| 293 | 306 | ||
| 294 | enum hsm_task_states { | 307 | enum hsm_task_states { |
| @@ -350,23 +363,32 @@ struct ata_probe_ent { | |||
| 350 | struct scsi_host_template *sht; | 363 | struct scsi_host_template *sht; |
| 351 | struct ata_ioports port[ATA_MAX_PORTS]; | 364 | struct ata_ioports port[ATA_MAX_PORTS]; |
| 352 | unsigned int n_ports; | 365 | unsigned int n_ports; |
| 353 | unsigned int hard_port_no; | 366 | unsigned int dummy_port_mask; |
| 354 | unsigned int pio_mask; | 367 | unsigned int pio_mask; |
| 355 | unsigned int mwdma_mask; | 368 | unsigned int mwdma_mask; |
| 356 | unsigned int udma_mask; | 369 | unsigned int udma_mask; |
| 357 | unsigned int legacy_mode; | ||
| 358 | unsigned long irq; | 370 | unsigned long irq; |
| 371 | unsigned long irq2; | ||
| 359 | unsigned int irq_flags; | 372 | unsigned int irq_flags; |
| 360 | unsigned long host_flags; | 373 | unsigned long port_flags; |
| 361 | unsigned long host_set_flags; | 374 | unsigned long _host_flags; |
| 362 | void __iomem *mmio_base; | 375 | void __iomem *mmio_base; |
| 363 | void *private_data; | 376 | void *private_data; |
| 377 | |||
| 378 | /* port_info for the secondary port. Together with irq2, it's | ||
| 379 | * used to implement non-uniform secondary port. Currently, | ||
| 380 | * the only user is ata_piix combined mode. This workaround | ||
| 381 | * will be removed together with ata_probe_ent when init model | ||
| 382 | * is updated. | ||
| 383 | */ | ||
| 384 | const struct ata_port_info *pinfo2; | ||
| 364 | }; | 385 | }; |
| 365 | 386 | ||
| 366 | struct ata_host_set { | 387 | struct ata_host { |
| 367 | spinlock_t lock; | 388 | spinlock_t lock; |
| 368 | struct device *dev; | 389 | struct device *dev; |
| 369 | unsigned long irq; | 390 | unsigned long irq; |
| 391 | unsigned long irq2; | ||
| 370 | void __iomem *mmio_base; | 392 | void __iomem *mmio_base; |
| 371 | unsigned int n_ports; | 393 | unsigned int n_ports; |
| 372 | void *private_data; | 394 | void *private_data; |
| @@ -374,7 +396,6 @@ struct ata_host_set { | |||
| 374 | unsigned long flags; | 396 | unsigned long flags; |
| 375 | int simplex_claimed; /* Keep seperate in case we | 397 | int simplex_claimed; /* Keep seperate in case we |
| 376 | ever need to do this locked */ | 398 | ever need to do this locked */ |
| 377 | struct ata_host_set *next; /* for legacy mode */ | ||
| 378 | struct ata_port *ports[0]; | 399 | struct ata_port *ports[0]; |
| 379 | }; | 400 | }; |
| 380 | 401 | ||
| @@ -420,7 +441,7 @@ struct ata_queued_cmd { | |||
| 420 | void *private_data; | 441 | void *private_data; |
| 421 | }; | 442 | }; |
| 422 | 443 | ||
| 423 | struct ata_host_stats { | 444 | struct ata_port_stats { |
| 424 | unsigned long unhandled_irq; | 445 | unsigned long unhandled_irq; |
| 425 | unsigned long idle_irq; | 446 | unsigned long idle_irq; |
| 426 | unsigned long rw_reqbuf; | 447 | unsigned long rw_reqbuf; |
| @@ -468,6 +489,7 @@ struct ata_device { | |||
| 468 | 489 | ||
| 469 | /* error history */ | 490 | /* error history */ |
| 470 | struct ata_ering ering; | 491 | struct ata_ering ering; |
| 492 | unsigned int horkage; /* List of broken features */ | ||
| 471 | }; | 493 | }; |
| 472 | 494 | ||
| 473 | /* Offset into struct ata_device. Fields above it are maintained | 495 | /* Offset into struct ata_device. Fields above it are maintained |
| @@ -498,14 +520,13 @@ struct ata_eh_context { | |||
| 498 | }; | 520 | }; |
| 499 | 521 | ||
| 500 | struct ata_port { | 522 | struct ata_port { |
| 501 | struct Scsi_Host *host; /* our co-allocated scsi host */ | 523 | struct Scsi_Host *scsi_host; /* our co-allocated scsi host */ |
| 502 | const struct ata_port_operations *ops; | 524 | const struct ata_port_operations *ops; |
| 503 | spinlock_t *lock; | 525 | spinlock_t *lock; |
| 504 | unsigned long flags; /* ATA_FLAG_xxx */ | 526 | unsigned long flags; /* ATA_FLAG_xxx */ |
| 505 | unsigned int pflags; /* ATA_PFLAG_xxx */ | 527 | unsigned int pflags; /* ATA_PFLAG_xxx */ |
| 506 | unsigned int id; /* unique id req'd by scsi midlyr */ | 528 | unsigned int id; /* unique id req'd by scsi midlyr */ |
| 507 | unsigned int port_no; /* unique port #; from zero */ | 529 | unsigned int port_no; /* unique port #; from zero */ |
| 508 | unsigned int hard_port_no; /* hardware port #; from zero */ | ||
| 509 | 530 | ||
| 510 | struct ata_prd *prd; /* our SG list */ | 531 | struct ata_prd *prd; /* our SG list */ |
| 511 | dma_addr_t prd_dma; /* and its DMA mapping */ | 532 | dma_addr_t prd_dma; /* and its DMA mapping */ |
| @@ -524,7 +545,7 @@ struct ata_port { | |||
| 524 | unsigned int hw_sata_spd_limit; | 545 | unsigned int hw_sata_spd_limit; |
| 525 | unsigned int sata_spd_limit; /* SATA PHY speed limit */ | 546 | unsigned int sata_spd_limit; /* SATA PHY speed limit */ |
| 526 | 547 | ||
| 527 | /* record runtime error info, protected by host_set lock */ | 548 | /* record runtime error info, protected by host lock */ |
| 528 | struct ata_eh_info eh_info; | 549 | struct ata_eh_info eh_info; |
| 529 | /* EH context owned by EH */ | 550 | /* EH context owned by EH */ |
| 530 | struct ata_eh_context eh_context; | 551 | struct ata_eh_context eh_context; |
| @@ -538,8 +559,8 @@ struct ata_port { | |||
| 538 | unsigned int active_tag; | 559 | unsigned int active_tag; |
| 539 | u32 sactive; | 560 | u32 sactive; |
| 540 | 561 | ||
| 541 | struct ata_host_stats stats; | 562 | struct ata_port_stats stats; |
| 542 | struct ata_host_set *host_set; | 563 | struct ata_host *host; |
| 543 | struct device *dev; | 564 | struct device *dev; |
| 544 | 565 | ||
| 545 | struct work_struct port_task; | 566 | struct work_struct port_task; |
| @@ -615,7 +636,7 @@ struct ata_port_operations { | |||
| 615 | int (*port_start) (struct ata_port *ap); | 636 | int (*port_start) (struct ata_port *ap); |
| 616 | void (*port_stop) (struct ata_port *ap); | 637 | void (*port_stop) (struct ata_port *ap); |
| 617 | 638 | ||
| 618 | void (*host_stop) (struct ata_host_set *host_set); | 639 | void (*host_stop) (struct ata_host *host); |
| 619 | 640 | ||
| 620 | void (*bmdma_stop) (struct ata_queued_cmd *qc); | 641 | void (*bmdma_stop) (struct ata_queued_cmd *qc); |
| 621 | u8 (*bmdma_status) (struct ata_port *ap); | 642 | u8 (*bmdma_status) (struct ata_port *ap); |
| @@ -623,7 +644,7 @@ struct ata_port_operations { | |||
| 623 | 644 | ||
| 624 | struct ata_port_info { | 645 | struct ata_port_info { |
| 625 | struct scsi_host_template *sht; | 646 | struct scsi_host_template *sht; |
| 626 | unsigned long host_flags; | 647 | unsigned long flags; |
| 627 | unsigned long pio_mask; | 648 | unsigned long pio_mask; |
| 628 | unsigned long mwdma_mask; | 649 | unsigned long mwdma_mask; |
| 629 | unsigned long udma_mask; | 650 | unsigned long udma_mask; |
| @@ -649,6 +670,8 @@ extern const unsigned long sata_deb_timing_normal[]; | |||
| 649 | extern const unsigned long sata_deb_timing_hotplug[]; | 670 | extern const unsigned long sata_deb_timing_hotplug[]; |
| 650 | extern const unsigned long sata_deb_timing_long[]; | 671 | extern const unsigned long sata_deb_timing_long[]; |
| 651 | 672 | ||
| 673 | extern const struct ata_port_operations ata_dummy_port_ops; | ||
| 674 | |||
| 652 | static inline const unsigned long * | 675 | static inline const unsigned long * |
| 653 | sata_ehc_deb_timing(struct ata_eh_context *ehc) | 676 | sata_ehc_deb_timing(struct ata_eh_context *ehc) |
| 654 | { | 677 | { |
| @@ -658,6 +681,11 @@ sata_ehc_deb_timing(struct ata_eh_context *ehc) | |||
| 658 | return sata_deb_timing_normal; | 681 | return sata_deb_timing_normal; |
| 659 | } | 682 | } |
| 660 | 683 | ||
| 684 | static inline int ata_port_is_dummy(struct ata_port *ap) | ||
| 685 | { | ||
| 686 | return ap->ops == &ata_dummy_port_ops; | ||
| 687 | } | ||
| 688 | |||
| 661 | extern void ata_port_probe(struct ata_port *); | 689 | extern void ata_port_probe(struct ata_port *); |
| 662 | extern void __sata_phy_reset(struct ata_port *ap); | 690 | extern void __sata_phy_reset(struct ata_port *ap); |
| 663 | extern void sata_phy_reset(struct ata_port *ap); | 691 | extern void sata_phy_reset(struct ata_port *ap); |
| @@ -676,19 +704,30 @@ extern void ata_std_ports(struct ata_ioports *ioaddr); | |||
| 676 | extern int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_info, | 704 | extern int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_info, |
| 677 | unsigned int n_ports); | 705 | unsigned int n_ports); |
| 678 | extern void ata_pci_remove_one (struct pci_dev *pdev); | 706 | extern void ata_pci_remove_one (struct pci_dev *pdev); |
| 679 | extern void ata_pci_device_do_suspend(struct pci_dev *pdev, pm_message_t state); | 707 | extern void ata_pci_device_do_suspend(struct pci_dev *pdev, pm_message_t mesg); |
| 680 | extern void ata_pci_device_do_resume(struct pci_dev *pdev); | 708 | extern void ata_pci_device_do_resume(struct pci_dev *pdev); |
| 681 | extern int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t state); | 709 | extern int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg); |
| 682 | extern int ata_pci_device_resume(struct pci_dev *pdev); | 710 | extern int ata_pci_device_resume(struct pci_dev *pdev); |
| 683 | extern int ata_pci_clear_simplex(struct pci_dev *pdev); | 711 | extern int ata_pci_clear_simplex(struct pci_dev *pdev); |
| 684 | #endif /* CONFIG_PCI */ | 712 | #endif /* CONFIG_PCI */ |
| 685 | extern int ata_device_add(const struct ata_probe_ent *ent); | 713 | extern int ata_device_add(const struct ata_probe_ent *ent); |
| 686 | extern void ata_port_detach(struct ata_port *ap); | 714 | extern void ata_port_detach(struct ata_port *ap); |
| 687 | extern void ata_host_set_remove(struct ata_host_set *host_set); | 715 | extern void ata_host_init(struct ata_host *, struct device *, |
| 716 | unsigned long, const struct ata_port_operations *); | ||
| 717 | extern void ata_host_remove(struct ata_host *host); | ||
| 688 | extern int ata_scsi_detect(struct scsi_host_template *sht); | 718 | extern int ata_scsi_detect(struct scsi_host_template *sht); |
| 689 | extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); | 719 | extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); |
| 690 | extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); | 720 | extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); |
| 691 | extern int ata_scsi_release(struct Scsi_Host *host); | 721 | extern int ata_scsi_release(struct Scsi_Host *host); |
| 722 | extern void ata_sas_port_destroy(struct ata_port *); | ||
| 723 | extern struct ata_port *ata_sas_port_alloc(struct ata_host *, | ||
| 724 | struct ata_port_info *, struct Scsi_Host *); | ||
| 725 | extern int ata_sas_port_init(struct ata_port *); | ||
| 726 | extern int ata_sas_port_start(struct ata_port *ap); | ||
| 727 | extern void ata_sas_port_stop(struct ata_port *ap); | ||
| 728 | extern int ata_sas_slave_configure(struct scsi_device *, struct ata_port *); | ||
| 729 | extern int ata_sas_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *), | ||
| 730 | struct ata_port *ap); | ||
| 692 | extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc); | 731 | extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc); |
| 693 | extern int sata_scr_valid(struct ata_port *ap); | 732 | extern int sata_scr_valid(struct ata_port *ap); |
| 694 | extern int sata_scr_read(struct ata_port *ap, int reg, u32 *val); | 733 | extern int sata_scr_read(struct ata_port *ap, int reg, u32 *val); |
| @@ -697,10 +736,9 @@ extern int sata_scr_write_flush(struct ata_port *ap, int reg, u32 val); | |||
| 697 | extern int ata_port_online(struct ata_port *ap); | 736 | extern int ata_port_online(struct ata_port *ap); |
| 698 | extern int ata_port_offline(struct ata_port *ap); | 737 | extern int ata_port_offline(struct ata_port *ap); |
| 699 | extern int ata_scsi_device_resume(struct scsi_device *); | 738 | extern int ata_scsi_device_resume(struct scsi_device *); |
| 700 | extern int ata_scsi_device_suspend(struct scsi_device *, pm_message_t state); | 739 | extern int ata_scsi_device_suspend(struct scsi_device *, pm_message_t mesg); |
| 701 | extern int ata_host_set_suspend(struct ata_host_set *host_set, | 740 | extern int ata_host_suspend(struct ata_host *host, pm_message_t mesg); |
| 702 | pm_message_t mesg); | 741 | extern void ata_host_resume(struct ata_host *host); |
| 703 | extern void ata_host_set_resume(struct ata_host_set *host_set); | ||
| 704 | extern int ata_ratelimit(void); | 742 | extern int ata_ratelimit(void); |
| 705 | extern unsigned int ata_busy_sleep(struct ata_port *ap, | 743 | extern unsigned int ata_busy_sleep(struct ata_port *ap, |
| 706 | unsigned long timeout_pat, | 744 | unsigned long timeout_pat, |
| @@ -725,7 +763,7 @@ extern u8 ata_altstatus(struct ata_port *ap); | |||
| 725 | extern void ata_exec_command(struct ata_port *ap, const struct ata_taskfile *tf); | 763 | extern void ata_exec_command(struct ata_port *ap, const struct ata_taskfile *tf); |
| 726 | extern int ata_port_start (struct ata_port *ap); | 764 | extern int ata_port_start (struct ata_port *ap); |
| 727 | extern void ata_port_stop (struct ata_port *ap); | 765 | extern void ata_port_stop (struct ata_port *ap); |
| 728 | extern void ata_host_stop (struct ata_host_set *host_set); | 766 | extern void ata_host_stop (struct ata_host *host); |
| 729 | extern irqreturn_t ata_interrupt (int irq, void *dev_instance, struct pt_regs *regs); | 767 | extern irqreturn_t ata_interrupt (int irq, void *dev_instance, struct pt_regs *regs); |
| 730 | extern void ata_mmio_data_xfer(struct ata_device *adev, unsigned char *buf, | 768 | extern void ata_mmio_data_xfer(struct ata_device *adev, unsigned char *buf, |
| 731 | unsigned int buflen, int write_data); | 769 | unsigned int buflen, int write_data); |
| @@ -811,7 +849,7 @@ struct pci_bits { | |||
| 811 | unsigned long val; | 849 | unsigned long val; |
| 812 | }; | 850 | }; |
| 813 | 851 | ||
| 814 | extern void ata_pci_host_stop (struct ata_host_set *host_set); | 852 | extern void ata_pci_host_stop (struct ata_host *host); |
| 815 | extern struct ata_probe_ent * | 853 | extern struct ata_probe_ent * |
| 816 | ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int portmask); | 854 | ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int portmask); |
| 817 | extern int pci_test_config_bits(struct pci_dev *pdev, const struct pci_bits *bits); | 855 | extern int pci_test_config_bits(struct pci_dev *pdev, const struct pci_bits *bits); |
diff --git a/include/linux/linkage.h b/include/linux/linkage.h index 932021f872..6c9873f882 100644 --- a/include/linux/linkage.h +++ b/include/linux/linkage.h | |||
| @@ -35,9 +35,13 @@ | |||
| 35 | #endif | 35 | #endif |
| 36 | 36 | ||
| 37 | #define KPROBE_ENTRY(name) \ | 37 | #define KPROBE_ENTRY(name) \ |
| 38 | .section .kprobes.text, "ax"; \ | 38 | .pushsection .kprobes.text, "ax"; \ |
| 39 | ENTRY(name) | 39 | ENTRY(name) |
| 40 | 40 | ||
| 41 | #define KPROBE_END(name) \ | ||
| 42 | END(name); \ | ||
| 43 | .popsection | ||
| 44 | |||
| 41 | #ifndef END | 45 | #ifndef END |
| 42 | #define END(name) \ | 46 | #define END(name) \ |
| 43 | .size name, .-name | 47 | .size name, .-name |
diff --git a/include/linux/list.h b/include/linux/list.h index 65a5b5ceda..a9c90287c0 100644 --- a/include/linux/list.h +++ b/include/linux/list.h | |||
| @@ -39,6 +39,7 @@ static inline void INIT_LIST_HEAD(struct list_head *list) | |||
| 39 | * This is only for internal list manipulation where we know | 39 | * This is only for internal list manipulation where we know |
| 40 | * the prev/next entries already! | 40 | * the prev/next entries already! |
| 41 | */ | 41 | */ |
| 42 | #ifndef CONFIG_DEBUG_LIST | ||
| 42 | static inline void __list_add(struct list_head *new, | 43 | static inline void __list_add(struct list_head *new, |
| 43 | struct list_head *prev, | 44 | struct list_head *prev, |
| 44 | struct list_head *next) | 45 | struct list_head *next) |
| @@ -48,6 +49,11 @@ static inline void __list_add(struct list_head *new, | |||
| 48 | new->prev = prev; | 49 | new->prev = prev; |
| 49 | prev->next = new; | 50 | prev->next = new; |
| 50 | } | 51 | } |
| 52 | #else | ||
| 53 | extern void __list_add(struct list_head *new, | ||
| 54 | struct list_head *prev, | ||
| 55 | struct list_head *next); | ||
| 56 | #endif | ||
| 51 | 57 | ||
| 52 | /** | 58 | /** |
| 53 | * list_add - add a new entry | 59 | * list_add - add a new entry |
| @@ -57,10 +63,15 @@ static inline void __list_add(struct list_head *new, | |||
| 57 | * Insert a new entry after the specified head. | 63 | * Insert a new entry after the specified head. |
| 58 | * This is good for implementing stacks. | 64 | * This is good for implementing stacks. |
| 59 | */ | 65 | */ |
| 66 | #ifndef CONFIG_DEBUG_LIST | ||
| 60 | static inline void list_add(struct list_head *new, struct list_head *head) | 67 | static inline void list_add(struct list_head *new, struct list_head *head) |
| 61 | { | 68 | { |
| 62 | __list_add(new, head, head->next); | 69 | __list_add(new, head, head->next); |
| 63 | } | 70 | } |
| 71 | #else | ||
| 72 | extern void list_add(struct list_head *new, struct list_head *head); | ||
| 73 | #endif | ||
| 74 | |||
| 64 | 75 | ||
| 65 | /** | 76 | /** |
| 66 | * list_add_tail - add a new entry | 77 | * list_add_tail - add a new entry |
| @@ -153,12 +164,16 @@ static inline void __list_del(struct list_head * prev, struct list_head * next) | |||
| 153 | * Note: list_empty on entry does not return true after this, the entry is | 164 | * Note: list_empty on entry does not return true after this, the entry is |
| 154 | * in an undefined state. | 165 | * in an undefined state. |
| 155 | */ | 166 | */ |
| 167 | #ifndef CONFIG_DEBUG_LIST | ||
| 156 | static inline void list_del(struct list_head *entry) | 168 | static inline void list_del(struct list_head *entry) |
| 157 | { | 169 | { |
| 158 | __list_del(entry->prev, entry->next); | 170 | __list_del(entry->prev, entry->next); |
| 159 | entry->next = LIST_POISON1; | 171 | entry->next = LIST_POISON1; |
| 160 | entry->prev = LIST_POISON2; | 172 | entry->prev = LIST_POISON2; |
| 161 | } | 173 | } |
| 174 | #else | ||
| 175 | extern void list_del(struct list_head *entry); | ||
| 176 | #endif | ||
| 162 | 177 | ||
| 163 | /** | 178 | /** |
| 164 | * list_del_rcu - deletes entry from list without re-initialization | 179 | * list_del_rcu - deletes entry from list without re-initialization |
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index c040a8c969..1314ca0f29 100644 --- a/include/linux/lockdep.h +++ b/include/linux/lockdep.h | |||
| @@ -8,13 +8,13 @@ | |||
| 8 | #ifndef __LINUX_LOCKDEP_H | 8 | #ifndef __LINUX_LOCKDEP_H |
| 9 | #define __LINUX_LOCKDEP_H | 9 | #define __LINUX_LOCKDEP_H |
| 10 | 10 | ||
| 11 | #ifdef CONFIG_LOCKDEP | ||
| 12 | |||
| 11 | #include <linux/linkage.h> | 13 | #include <linux/linkage.h> |
| 12 | #include <linux/list.h> | 14 | #include <linux/list.h> |
| 13 | #include <linux/debug_locks.h> | 15 | #include <linux/debug_locks.h> |
| 14 | #include <linux/stacktrace.h> | 16 | #include <linux/stacktrace.h> |
| 15 | 17 | ||
| 16 | #ifdef CONFIG_LOCKDEP | ||
| 17 | |||
| 18 | /* | 18 | /* |
| 19 | * Lock-class usage-state bits: | 19 | * Lock-class usage-state bits: |
| 20 | */ | 20 | */ |
diff --git a/include/linux/loop.h b/include/linux/loop.h index e76c7611d6..191a595055 100644 --- a/include/linux/loop.h +++ b/include/linux/loop.h | |||
| @@ -59,10 +59,9 @@ struct loop_device { | |||
| 59 | struct bio *lo_bio; | 59 | struct bio *lo_bio; |
| 60 | struct bio *lo_biotail; | 60 | struct bio *lo_biotail; |
| 61 | int lo_state; | 61 | int lo_state; |
| 62 | struct completion lo_done; | ||
| 63 | struct completion lo_bh_done; | ||
| 64 | struct mutex lo_ctl_mutex; | 62 | struct mutex lo_ctl_mutex; |
| 65 | int lo_pending; | 63 | struct task_struct *lo_thread; |
| 64 | wait_queue_head_t lo_event; | ||
| 66 | 65 | ||
| 67 | request_queue_t *lo_queue; | 66 | request_queue_t *lo_queue; |
| 68 | }; | 67 | }; |
diff --git a/include/linux/magic.h b/include/linux/magic.h new file mode 100644 index 0000000000..22036dd2ba --- /dev/null +++ b/include/linux/magic.h | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | #ifndef __LINUX_MAGIC_H__ | ||
| 2 | #define __LINUX_MAGIC_H__ | ||
| 3 | |||
| 4 | #define ADFS_SUPER_MAGIC 0xadf5 | ||
| 5 | #define AFFS_SUPER_MAGIC 0xadff | ||
| 6 | #define AUTOFS_SUPER_MAGIC 0x0187 | ||
| 7 | #define CODA_SUPER_MAGIC 0x73757245 | ||
| 8 | #define EFS_SUPER_MAGIC 0x414A53 | ||
| 9 | #define EXT2_SUPER_MAGIC 0xEF53 | ||
| 10 | #define EXT3_SUPER_MAGIC 0xEF53 | ||
| 11 | #define HPFS_SUPER_MAGIC 0xf995e849 | ||
| 12 | #define ISOFS_SUPER_MAGIC 0x9660 | ||
| 13 | #define JFFS2_SUPER_MAGIC 0x72b6 | ||
| 14 | |||
| 15 | #define MINIX_SUPER_MAGIC 0x137F /* original minix fs */ | ||
| 16 | #define MINIX_SUPER_MAGIC2 0x138F /* minix fs, 30 char names */ | ||
| 17 | #define MINIX2_SUPER_MAGIC 0x2468 /* minix V2 fs */ | ||
| 18 | #define MINIX2_SUPER_MAGIC2 0x2478 /* minix V2 fs, 30 char names */ | ||
| 19 | |||
| 20 | #define MSDOS_SUPER_MAGIC 0x4d44 /* MD */ | ||
| 21 | #define NCP_SUPER_MAGIC 0x564c /* Guess, what 0x564c is :-) */ | ||
| 22 | #define NFS_SUPER_MAGIC 0x6969 | ||
| 23 | #define OPENPROM_SUPER_MAGIC 0x9fa1 | ||
| 24 | #define PROC_SUPER_MAGIC 0x9fa0 | ||
| 25 | #define QNX4_SUPER_MAGIC 0x002f /* qnx4 fs detection */ | ||
| 26 | |||
| 27 | #define REISERFS_SUPER_MAGIC 0x52654973 /* used by gcc */ | ||
| 28 | /* used by file system utilities that | ||
| 29 | look at the superblock, etc. */ | ||
| 30 | #define REISERFS_SUPER_MAGIC_STRING "ReIsErFs" | ||
| 31 | #define REISER2FS_SUPER_MAGIC_STRING "ReIsEr2Fs" | ||
| 32 | #define REISER2FS_JR_SUPER_MAGIC_STRING "ReIsEr3Fs" | ||
| 33 | |||
| 34 | #define SMB_SUPER_MAGIC 0x517B | ||
| 35 | #define USBDEVICE_SUPER_MAGIC 0x9fa2 | ||
| 36 | |||
| 37 | #endif /* __LINUX_MAGIC_H__ */ | ||
diff --git a/include/linux/memory.h b/include/linux/memory.h index 8f04143ca3..654ef55448 100644 --- a/include/linux/memory.h +++ b/include/linux/memory.h | |||
| @@ -57,7 +57,7 @@ struct memory_block { | |||
| 57 | struct notifier_block; | 57 | struct notifier_block; |
| 58 | struct mem_section; | 58 | struct mem_section; |
| 59 | 59 | ||
| 60 | #ifndef CONFIG_MEMORY_HOTPLUG | 60 | #ifndef CONFIG_MEMORY_HOTPLUG_SPARSE |
| 61 | static inline int memory_dev_init(void) | 61 | static inline int memory_dev_init(void) |
| 62 | { | 62 | { |
| 63 | return 0; | 63 | return 0; |
| @@ -78,7 +78,7 @@ extern int remove_memory_block(unsigned long, struct mem_section *, int); | |||
| 78 | #define CONFIG_MEM_BLOCK_SIZE (PAGES_PER_SECTION<<PAGE_SHIFT) | 78 | #define CONFIG_MEM_BLOCK_SIZE (PAGES_PER_SECTION<<PAGE_SHIFT) |
| 79 | 79 | ||
| 80 | 80 | ||
| 81 | #endif /* CONFIG_MEMORY_HOTPLUG */ | 81 | #endif /* CONFIG_MEMORY_HOTPLUG_SPARSE */ |
| 82 | 82 | ||
| 83 | #define hotplug_memory_notifier(fn, pri) { \ | 83 | #define hotplug_memory_notifier(fn, pri) { \ |
| 84 | static struct notifier_block fn##_mem_nb = \ | 84 | static struct notifier_block fn##_mem_nb = \ |
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h index 218501cfae..7b54666cea 100644 --- a/include/linux/memory_hotplug.h +++ b/include/linux/memory_hotplug.h | |||
| @@ -172,5 +172,7 @@ static inline int __remove_pages(struct zone *zone, unsigned long start_pfn, | |||
| 172 | extern int add_memory(int nid, u64 start, u64 size); | 172 | extern int add_memory(int nid, u64 start, u64 size); |
| 173 | extern int arch_add_memory(int nid, u64 start, u64 size); | 173 | extern int arch_add_memory(int nid, u64 start, u64 size); |
| 174 | extern int remove_memory(u64 start, u64 size); | 174 | extern int remove_memory(u64 start, u64 size); |
| 175 | extern int sparse_add_one_section(struct zone *zone, unsigned long start_pfn, | ||
| 176 | int nr_pages); | ||
| 175 | 177 | ||
| 176 | #endif /* __LINUX_MEMORY_HOTPLUG_H */ | 178 | #endif /* __LINUX_MEMORY_HOTPLUG_H */ |
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h index 72440f0a44..09f0f575dd 100644 --- a/include/linux/mempolicy.h +++ b/include/linux/mempolicy.h | |||
| @@ -162,9 +162,9 @@ extern struct zonelist *huge_zonelist(struct vm_area_struct *vma, | |||
| 162 | unsigned long addr); | 162 | unsigned long addr); |
| 163 | extern unsigned slab_node(struct mempolicy *policy); | 163 | extern unsigned slab_node(struct mempolicy *policy); |
| 164 | 164 | ||
| 165 | extern int policy_zone; | 165 | extern enum zone_type policy_zone; |
| 166 | 166 | ||
| 167 | static inline void check_highest_zone(int k) | 167 | static inline void check_highest_zone(enum zone_type k) |
| 168 | { | 168 | { |
| 169 | if (k > policy_zone) | 169 | if (k > policy_zone) |
| 170 | policy_zone = k; | 170 | policy_zone = k; |
diff --git a/include/linux/minix_fs.h b/include/linux/minix_fs.h index 1ecc3cc8ce..916e8f72c6 100644 --- a/include/linux/minix_fs.h +++ b/include/linux/minix_fs.h | |||
| @@ -1,6 +1,8 @@ | |||
| 1 | #ifndef _LINUX_MINIX_FS_H | 1 | #ifndef _LINUX_MINIX_FS_H |
| 2 | #define _LINUX_MINIX_FS_H | 2 | #define _LINUX_MINIX_FS_H |
| 3 | 3 | ||
| 4 | #include <linux/magic.h> | ||
| 5 | |||
| 4 | /* | 6 | /* |
| 5 | * The minix filesystem constants/structures | 7 | * The minix filesystem constants/structures |
| 6 | */ | 8 | */ |
| @@ -19,10 +21,6 @@ | |||
| 19 | 21 | ||
| 20 | #define MINIX_I_MAP_SLOTS 8 | 22 | #define MINIX_I_MAP_SLOTS 8 |
| 21 | #define MINIX_Z_MAP_SLOTS 64 | 23 | #define MINIX_Z_MAP_SLOTS 64 |
| 22 | #define MINIX_SUPER_MAGIC 0x137F /* original minix fs */ | ||
| 23 | #define MINIX_SUPER_MAGIC2 0x138F /* minix fs, 30 char names */ | ||
| 24 | #define MINIX2_SUPER_MAGIC 0x2468 /* minix V2 fs */ | ||
| 25 | #define MINIX2_SUPER_MAGIC2 0x2478 /* minix V2 fs, 30 char names */ | ||
| 26 | #define MINIX_VALID_FS 0x0001 /* Clean fs. */ | 24 | #define MINIX_VALID_FS 0x0001 /* Clean fs. */ |
| 27 | #define MINIX_ERROR_FS 0x0002 /* fs has errors. */ | 25 | #define MINIX_ERROR_FS 0x0002 /* fs has errors. */ |
| 28 | 26 | ||
diff --git a/include/linux/mm.h b/include/linux/mm.h index f0b135cd86..b7966ab8cb 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
| @@ -15,6 +15,8 @@ | |||
| 15 | #include <linux/fs.h> | 15 | #include <linux/fs.h> |
| 16 | #include <linux/mutex.h> | 16 | #include <linux/mutex.h> |
| 17 | #include <linux/debug_locks.h> | 17 | #include <linux/debug_locks.h> |
| 18 | #include <linux/backing-dev.h> | ||
| 19 | #include <linux/mm_types.h> | ||
| 18 | 20 | ||
| 19 | struct mempolicy; | 21 | struct mempolicy; |
| 20 | struct anon_vma; | 22 | struct anon_vma; |
| @@ -197,6 +199,7 @@ struct vm_operations_struct { | |||
| 197 | void (*open)(struct vm_area_struct * area); | 199 | void (*open)(struct vm_area_struct * area); |
| 198 | void (*close)(struct vm_area_struct * area); | 200 | void (*close)(struct vm_area_struct * area); |
| 199 | struct page * (*nopage)(struct vm_area_struct * area, unsigned long address, int *type); | 201 | struct page * (*nopage)(struct vm_area_struct * area, unsigned long address, int *type); |
| 202 | unsigned long (*nopfn)(struct vm_area_struct * area, unsigned long address); | ||
| 200 | int (*populate)(struct vm_area_struct * area, unsigned long address, unsigned long len, pgprot_t prot, unsigned long pgoff, int nonblock); | 203 | int (*populate)(struct vm_area_struct * area, unsigned long address, unsigned long len, pgprot_t prot, unsigned long pgoff, int nonblock); |
| 201 | 204 | ||
| 202 | /* notification that a previously read-only page is about to become | 205 | /* notification that a previously read-only page is about to become |
| @@ -214,61 +217,6 @@ struct vm_operations_struct { | |||
| 214 | struct mmu_gather; | 217 | struct mmu_gather; |
| 215 | struct inode; | 218 | struct inode; |
| 216 | 219 | ||
| 217 | /* | ||
| 218 | * Each physical page in the system has a struct page associated with | ||
| 219 | * it to keep track of whatever it is we are using the page for at the | ||
| 220 | * moment. Note that we have no way to track which tasks are using | ||
| 221 | * a page. | ||
| 222 | */ | ||
| 223 | struct page { | ||
| 224 | unsigned long flags; /* Atomic flags, some possibly | ||
| 225 | * updated asynchronously */ | ||
| 226 | atomic_t _count; /* Usage count, see below. */ | ||
| 227 | atomic_t _mapcount; /* Count of ptes mapped in mms, | ||
| 228 | * to show when page is mapped | ||
| 229 | * & limit reverse map searches. | ||
| 230 | */ | ||
| 231 | union { | ||
| 232 | struct { | ||
| 233 | unsigned long private; /* Mapping-private opaque data: | ||
| 234 | * usually used for buffer_heads | ||
| 235 | * if PagePrivate set; used for | ||
| 236 | * swp_entry_t if PageSwapCache; | ||
| 237 | * indicates order in the buddy | ||
| 238 | * system if PG_buddy is set. | ||
| 239 | */ | ||
| 240 | struct address_space *mapping; /* If low bit clear, points to | ||
| 241 | * inode address_space, or NULL. | ||
| 242 | * If page mapped as anonymous | ||
| 243 | * memory, low bit is set, and | ||
| 244 | * it points to anon_vma object: | ||
| 245 | * see PAGE_MAPPING_ANON below. | ||
| 246 | */ | ||
| 247 | }; | ||
| 248 | #if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS | ||
| 249 | spinlock_t ptl; | ||
| 250 | #endif | ||
| 251 | }; | ||
| 252 | pgoff_t index; /* Our offset within mapping. */ | ||
| 253 | struct list_head lru; /* Pageout list, eg. active_list | ||
| 254 | * protected by zone->lru_lock ! | ||
| 255 | */ | ||
| 256 | /* | ||
| 257 | * On machines where all RAM is mapped into kernel address space, | ||
| 258 | * we can simply calculate the virtual address. On machines with | ||
| 259 | * highmem some memory is mapped into kernel virtual memory | ||
| 260 | * dynamically, so we need a place to store that address. | ||
| 261 | * Note that this field could be 16 bits on x86 ... ;) | ||
| 262 | * | ||
| 263 | * Architectures with slow multiplication can define | ||
| 264 | * WANT_PAGE_VIRTUAL in asm/page.h | ||
| 265 | */ | ||
| 266 | #if defined(WANT_PAGE_VIRTUAL) | ||
| 267 | void *virtual; /* Kernel virtual address (NULL if | ||
| 268 | not kmapped, ie. highmem) */ | ||
| 269 | #endif /* WANT_PAGE_VIRTUAL */ | ||
| 270 | }; | ||
| 271 | |||
| 272 | #define page_private(page) ((page)->private) | 220 | #define page_private(page) ((page)->private) |
| 273 | #define set_page_private(page, v) ((page)->private = (v)) | 221 | #define set_page_private(page, v) ((page)->private = (v)) |
| 274 | 222 | ||
| @@ -278,6 +226,12 @@ struct page { | |||
| 278 | */ | 226 | */ |
| 279 | #include <linux/page-flags.h> | 227 | #include <linux/page-flags.h> |
| 280 | 228 | ||
| 229 | #ifdef CONFIG_DEBUG_VM | ||
| 230 | #define VM_BUG_ON(cond) BUG_ON(cond) | ||
| 231 | #else | ||
| 232 | #define VM_BUG_ON(condition) do { } while(0) | ||
| 233 | #endif | ||
| 234 | |||
| 281 | /* | 235 | /* |
| 282 | * Methods to modify the page usage count. | 236 | * Methods to modify the page usage count. |
| 283 | * | 237 | * |
| @@ -292,12 +246,11 @@ struct page { | |||
| 292 | */ | 246 | */ |
| 293 | 247 | ||
| 294 | /* | 248 | /* |
| 295 | * Drop a ref, return true if the logical refcount fell to zero (the page has | 249 | * Drop a ref, return true if the refcount fell to zero (the page has no users) |
| 296 | * no users) | ||
| 297 | */ | 250 | */ |
| 298 | static inline int put_page_testzero(struct page *page) | 251 | static inline int put_page_testzero(struct page *page) |
| 299 | { | 252 | { |
| 300 | BUG_ON(atomic_read(&page->_count) == 0); | 253 | VM_BUG_ON(atomic_read(&page->_count) == 0); |
| 301 | return atomic_dec_and_test(&page->_count); | 254 | return atomic_dec_and_test(&page->_count); |
| 302 | } | 255 | } |
| 303 | 256 | ||
| @@ -307,11 +260,10 @@ static inline int put_page_testzero(struct page *page) | |||
| 307 | */ | 260 | */ |
| 308 | static inline int get_page_unless_zero(struct page *page) | 261 | static inline int get_page_unless_zero(struct page *page) |
| 309 | { | 262 | { |
| 263 | VM_BUG_ON(PageCompound(page)); | ||
| 310 | return atomic_inc_not_zero(&page->_count); | 264 | return atomic_inc_not_zero(&page->_count); |
| 311 | } | 265 | } |
| 312 | 266 | ||
| 313 | extern void FASTCALL(__page_cache_release(struct page *)); | ||
| 314 | |||
| 315 | static inline int page_count(struct page *page) | 267 | static inline int page_count(struct page *page) |
| 316 | { | 268 | { |
| 317 | if (unlikely(PageCompound(page))) | 269 | if (unlikely(PageCompound(page))) |
| @@ -323,6 +275,7 @@ static inline void get_page(struct page *page) | |||
| 323 | { | 275 | { |
| 324 | if (unlikely(PageCompound(page))) | 276 | if (unlikely(PageCompound(page))) |
| 325 | page = (struct page *)page_private(page); | 277 | page = (struct page *)page_private(page); |
| 278 | VM_BUG_ON(atomic_read(&page->_count) == 0); | ||
| 326 | atomic_inc(&page->_count); | 279 | atomic_inc(&page->_count); |
| 327 | } | 280 | } |
| 328 | 281 | ||
| @@ -349,43 +302,55 @@ void split_page(struct page *page, unsigned int order); | |||
| 349 | * For the non-reserved pages, page_count(page) denotes a reference count. | 302 | * For the non-reserved pages, page_count(page) denotes a reference count. |
| 350 | * page_count() == 0 means the page is free. page->lru is then used for | 303 | * page_count() == 0 means the page is free. page->lru is then used for |
| 351 | * freelist management in the buddy allocator. | 304 | * freelist management in the buddy allocator. |
| 352 | * page_count() == 1 means the page is used for exactly one purpose | 305 | * page_count() > 0 means the page has been allocated. |
| 353 | * (e.g. a private data page of one process). | 306 | * |
| 307 | * Pages are allocated by the slab allocator in order to provide memory | ||
| 308 | * to kmalloc and kmem_cache_alloc. In this case, the management of the | ||
| 309 | * page, and the fields in 'struct page' are the responsibility of mm/slab.c | ||
| 310 | * unless a particular usage is carefully commented. (the responsibility of | ||
| 311 | * freeing the kmalloc memory is the caller's, of course). | ||
| 354 | * | 312 | * |
| 355 | * A page may be used for kmalloc() or anyone else who does a | 313 | * A page may be used by anyone else who does a __get_free_page(). |
| 356 | * __get_free_page(). In this case the page_count() is at least 1, and | 314 | * In this case, page_count still tracks the references, and should only |
| 357 | * all other fields are unused but should be 0 or NULL. The | 315 | * be used through the normal accessor functions. The top bits of page->flags |
| 358 | * management of this page is the responsibility of the one who uses | 316 | * and page->virtual store page management information, but all other fields |
| 359 | * it. | 317 | * are unused and could be used privately, carefully. The management of this |
| 318 | * page is the responsibility of the one who allocated it, and those who have | ||
| 319 | * subsequently been given references to it. | ||
| 360 | * | 320 | * |
| 361 | * The other pages (we may call them "process pages") are completely | 321 | * The other pages (we may call them "pagecache pages") are completely |
| 362 | * managed by the Linux memory manager: I/O, buffers, swapping etc. | 322 | * managed by the Linux memory manager: I/O, buffers, swapping etc. |
| 363 | * The following discussion applies only to them. | 323 | * The following discussion applies only to them. |
| 364 | * | 324 | * |
| 365 | * A page may belong to an inode's memory mapping. In this case, | 325 | * A pagecache page contains an opaque `private' member, which belongs to the |
| 366 | * page->mapping is the pointer to the inode, and page->index is the | 326 | * page's address_space. Usually, this is the address of a circular list of |
| 367 | * file offset of the page, in units of PAGE_CACHE_SIZE. | 327 | * the page's disk buffers. PG_private must be set to tell the VM to call |
| 328 | * into the filesystem to release these pages. | ||
| 368 | * | 329 | * |
| 369 | * A page contains an opaque `private' member, which belongs to the | 330 | * A page may belong to an inode's memory mapping. In this case, page->mapping |
| 370 | * page's address_space. Usually, this is the address of a circular | 331 | * is the pointer to the inode, and page->index is the file offset of the page, |
| 371 | * list of the page's disk buffers. | 332 | * in units of PAGE_CACHE_SIZE. |
| 372 | * | 333 | * |
| 373 | * For pages belonging to inodes, the page_count() is the number of | 334 | * If pagecache pages are not associated with an inode, they are said to be |
| 374 | * attaches, plus 1 if `private' contains something, plus one for | 335 | * anonymous pages. These may become associated with the swapcache, and in that |
| 375 | * the page cache itself. | 336 | * case PG_swapcache is set, and page->private is an offset into the swapcache. |
| 376 | * | 337 | * |
| 377 | * Instead of keeping dirty/clean pages in per address-space lists, we instead | 338 | * In either case (swapcache or inode backed), the pagecache itself holds one |
| 378 | * now tag pages as dirty/under writeback in the radix tree. | 339 | * reference to the page. Setting PG_private should also increment the |
| 340 | * refcount. The each user mapping also has a reference to the page. | ||
| 379 | * | 341 | * |
| 380 | * There is also a per-mapping radix tree mapping index to the page | 342 | * The pagecache pages are stored in a per-mapping radix tree, which is |
| 381 | * in memory if present. The tree is rooted at mapping->root. | 343 | * rooted at mapping->page_tree, and indexed by offset. |
| 344 | * Where 2.4 and early 2.6 kernels kept dirty/clean pages in per-address_space | ||
| 345 | * lists, we instead now tag pages as dirty/writeback in the radix tree. | ||
| 382 | * | 346 | * |
| 383 | * All process pages can do I/O: | 347 | * All pagecache pages may be subject to I/O: |
| 384 | * - inode pages may need to be read from disk, | 348 | * - inode pages may need to be read from disk, |
| 385 | * - inode pages which have been modified and are MAP_SHARED may need | 349 | * - inode pages which have been modified and are MAP_SHARED may need |
| 386 | * to be written to disk, | 350 | * to be written back to the inode on disk, |
| 387 | * - private pages which have been modified may need to be swapped out | 351 | * - anonymous pages (including MAP_PRIVATE file mappings) which have been |
| 388 | * to swap space and (later) to be read back into memory. | 352 | * modified may need to be swapped out to swap space and (later) to be read |
| 353 | * back into memory. | ||
| 389 | */ | 354 | */ |
| 390 | 355 | ||
| 391 | /* | 356 | /* |
| @@ -463,7 +428,7 @@ void split_page(struct page *page, unsigned int order); | |||
| 463 | #define SECTIONS_MASK ((1UL << SECTIONS_WIDTH) - 1) | 428 | #define SECTIONS_MASK ((1UL << SECTIONS_WIDTH) - 1) |
| 464 | #define ZONETABLE_MASK ((1UL << ZONETABLE_SHIFT) - 1) | 429 | #define ZONETABLE_MASK ((1UL << ZONETABLE_SHIFT) - 1) |
| 465 | 430 | ||
| 466 | static inline unsigned long page_zonenum(struct page *page) | 431 | static inline enum zone_type page_zonenum(struct page *page) |
| 467 | { | 432 | { |
| 468 | return (page->flags >> ZONES_PGSHIFT) & ZONES_MASK; | 433 | return (page->flags >> ZONES_PGSHIFT) & ZONES_MASK; |
| 469 | } | 434 | } |
| @@ -480,23 +445,33 @@ static inline struct zone *page_zone(struct page *page) | |||
| 480 | return zone_table[page_zone_id(page)]; | 445 | return zone_table[page_zone_id(page)]; |
| 481 | } | 446 | } |
| 482 | 447 | ||
| 448 | static inline unsigned long zone_to_nid(struct zone *zone) | ||
| 449 | { | ||
| 450 | #ifdef CONFIG_NUMA | ||
| 451 | return zone->node; | ||
| 452 | #else | ||
| 453 | return 0; | ||
| 454 | #endif | ||
| 455 | } | ||
| 456 | |||
| 483 | static inline unsigned long page_to_nid(struct page *page) | 457 | static inline unsigned long page_to_nid(struct page *page) |
| 484 | { | 458 | { |
| 485 | if (FLAGS_HAS_NODE) | 459 | if (FLAGS_HAS_NODE) |
| 486 | return (page->flags >> NODES_PGSHIFT) & NODES_MASK; | 460 | return (page->flags >> NODES_PGSHIFT) & NODES_MASK; |
| 487 | else | 461 | else |
| 488 | return page_zone(page)->zone_pgdat->node_id; | 462 | return zone_to_nid(page_zone(page)); |
| 489 | } | 463 | } |
| 490 | static inline unsigned long page_to_section(struct page *page) | 464 | static inline unsigned long page_to_section(struct page *page) |
| 491 | { | 465 | { |
| 492 | return (page->flags >> SECTIONS_PGSHIFT) & SECTIONS_MASK; | 466 | return (page->flags >> SECTIONS_PGSHIFT) & SECTIONS_MASK; |
| 493 | } | 467 | } |
| 494 | 468 | ||
| 495 | static inline void set_page_zone(struct page *page, unsigned long zone) | 469 | static inline void set_page_zone(struct page *page, enum zone_type zone) |
| 496 | { | 470 | { |
| 497 | page->flags &= ~(ZONES_MASK << ZONES_PGSHIFT); | 471 | page->flags &= ~(ZONES_MASK << ZONES_PGSHIFT); |
| 498 | page->flags |= (zone & ZONES_MASK) << ZONES_PGSHIFT; | 472 | page->flags |= (zone & ZONES_MASK) << ZONES_PGSHIFT; |
| 499 | } | 473 | } |
| 474 | |||
| 500 | static inline void set_page_node(struct page *page, unsigned long node) | 475 | static inline void set_page_node(struct page *page, unsigned long node) |
| 501 | { | 476 | { |
| 502 | page->flags &= ~(NODES_MASK << NODES_PGSHIFT); | 477 | page->flags &= ~(NODES_MASK << NODES_PGSHIFT); |
| @@ -508,7 +483,7 @@ static inline void set_page_section(struct page *page, unsigned long section) | |||
| 508 | page->flags |= (section & SECTIONS_MASK) << SECTIONS_PGSHIFT; | 483 | page->flags |= (section & SECTIONS_MASK) << SECTIONS_PGSHIFT; |
| 509 | } | 484 | } |
| 510 | 485 | ||
| 511 | static inline void set_page_links(struct page *page, unsigned long zone, | 486 | static inline void set_page_links(struct page *page, enum zone_type zone, |
| 512 | unsigned long node, unsigned long pfn) | 487 | unsigned long node, unsigned long pfn) |
| 513 | { | 488 | { |
| 514 | set_page_zone(page, zone); | 489 | set_page_zone(page, zone); |
| @@ -521,11 +496,6 @@ static inline void set_page_links(struct page *page, unsigned long zone, | |||
| 521 | */ | 496 | */ |
| 522 | #include <linux/vmstat.h> | 497 | #include <linux/vmstat.h> |
| 523 | 498 | ||
| 524 | #ifndef CONFIG_DISCONTIGMEM | ||
| 525 | /* The array of struct pages - for discontigmem use pgdat->lmem_map */ | ||
| 526 | extern struct page *mem_map; | ||
| 527 | #endif | ||
| 528 | |||
| 529 | static __always_inline void *lowmem_page_address(struct page *page) | 499 | static __always_inline void *lowmem_page_address(struct page *page) |
| 530 | { | 500 | { |
| 531 | return __va(page_to_pfn(page) << PAGE_SHIFT); | 501 | return __va(page_to_pfn(page) << PAGE_SHIFT); |
| @@ -625,6 +595,12 @@ static inline int page_mapped(struct page *page) | |||
| 625 | #define NOPAGE_OOM ((struct page *) (-1)) | 595 | #define NOPAGE_OOM ((struct page *) (-1)) |
| 626 | 596 | ||
| 627 | /* | 597 | /* |
| 598 | * Error return values for the *_nopfn functions | ||
| 599 | */ | ||
| 600 | #define NOPFN_SIGBUS ((unsigned long) -1) | ||
| 601 | #define NOPFN_OOM ((unsigned long) -2) | ||
| 602 | |||
| 603 | /* | ||
| 628 | * Different kinds of faults, as returned by handle_mm_fault(). | 604 | * Different kinds of faults, as returned by handle_mm_fault(). |
| 629 | * Used to decide whether a process gets delivered SIGBUS or | 605 | * Used to decide whether a process gets delivered SIGBUS or |
| 630 | * just gets major/minor fault counters bumped up. | 606 | * just gets major/minor fault counters bumped up. |
| @@ -767,7 +743,9 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, unsigned long | |||
| 767 | int len, int write, int force, struct page **pages, struct vm_area_struct **vmas); | 743 | int len, int write, int force, struct page **pages, struct vm_area_struct **vmas); |
| 768 | void print_bad_pte(struct vm_area_struct *, pte_t, unsigned long); | 744 | void print_bad_pte(struct vm_area_struct *, pte_t, unsigned long); |
| 769 | 745 | ||
| 770 | int __set_page_dirty_buffers(struct page *page); | 746 | extern int try_to_release_page(struct page * page, gfp_t gfp_mask); |
| 747 | extern void do_invalidatepage(struct page *page, unsigned long offset); | ||
| 748 | |||
| 771 | int __set_page_dirty_nobuffers(struct page *page); | 749 | int __set_page_dirty_nobuffers(struct page *page); |
| 772 | int redirty_page_for_writepage(struct writeback_control *wbc, | 750 | int redirty_page_for_writepage(struct writeback_control *wbc, |
| 773 | struct page *page); | 751 | struct page *page); |
| @@ -802,6 +780,39 @@ struct shrinker; | |||
| 802 | extern struct shrinker *set_shrinker(int, shrinker_t); | 780 | extern struct shrinker *set_shrinker(int, shrinker_t); |
| 803 | extern void remove_shrinker(struct shrinker *shrinker); | 781 | extern void remove_shrinker(struct shrinker *shrinker); |
| 804 | 782 | ||
| 783 | /* | ||
| 784 | * Some shared mappigns will want the pages marked read-only | ||
| 785 | * to track write events. If so, we'll downgrade vm_page_prot | ||
| 786 | * to the private version (using protection_map[] without the | ||
| 787 | * VM_SHARED bit). | ||
| 788 | */ | ||
| 789 | static inline int vma_wants_writenotify(struct vm_area_struct *vma) | ||
| 790 | { | ||
| 791 | unsigned int vm_flags = vma->vm_flags; | ||
| 792 | |||
| 793 | /* If it was private or non-writable, the write bit is already clear */ | ||
| 794 | if ((vm_flags & (VM_WRITE|VM_SHARED)) != ((VM_WRITE|VM_SHARED))) | ||
| 795 | return 0; | ||
| 796 | |||
| 797 | /* The backer wishes to know when pages are first written to? */ | ||
| 798 | if (vma->vm_ops && vma->vm_ops->page_mkwrite) | ||
| 799 | return 1; | ||
| 800 | |||
| 801 | /* The open routine did something to the protections already? */ | ||
| 802 | if (pgprot_val(vma->vm_page_prot) != | ||
| 803 | pgprot_val(protection_map[vm_flags & | ||
| 804 | (VM_READ|VM_WRITE|VM_EXEC|VM_SHARED)])) | ||
| 805 | return 0; | ||
| 806 | |||
| 807 | /* Specialty mapping? */ | ||
| 808 | if (vm_flags & (VM_PFNMAP|VM_INSERTPAGE)) | ||
| 809 | return 0; | ||
| 810 | |||
| 811 | /* Can the mapping track the dirty pages? */ | ||
| 812 | return vma->vm_file && vma->vm_file->f_mapping && | ||
| 813 | mapping_cap_account_dirty(vma->vm_file->f_mapping); | ||
| 814 | } | ||
| 815 | |||
| 805 | extern pte_t *FASTCALL(get_locked_pte(struct mm_struct *mm, unsigned long addr, spinlock_t **ptl)); | 816 | extern pte_t *FASTCALL(get_locked_pte(struct mm_struct *mm, unsigned long addr, spinlock_t **ptl)); |
| 806 | 817 | ||
| 807 | int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address); | 818 | int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address); |
| @@ -879,12 +890,64 @@ extern void free_area_init(unsigned long * zones_size); | |||
| 879 | extern void free_area_init_node(int nid, pg_data_t *pgdat, | 890 | extern void free_area_init_node(int nid, pg_data_t *pgdat, |
| 880 | unsigned long * zones_size, unsigned long zone_start_pfn, | 891 | unsigned long * zones_size, unsigned long zone_start_pfn, |
| 881 | unsigned long *zholes_size); | 892 | unsigned long *zholes_size); |
| 893 | #ifdef CONFIG_ARCH_POPULATES_NODE_MAP | ||
| 894 | /* | ||
| 895 | * With CONFIG_ARCH_POPULATES_NODE_MAP set, an architecture may initialise its | ||
| 896 | * zones, allocate the backing mem_map and account for memory holes in a more | ||
| 897 | * architecture independent manner. This is a substitute for creating the | ||
| 898 | * zone_sizes[] and zholes_size[] arrays and passing them to | ||
| 899 | * free_area_init_node() | ||
| 900 | * | ||
| 901 | * An architecture is expected to register range of page frames backed by | ||
| 902 | * physical memory with add_active_range() before calling | ||
| 903 | * free_area_init_nodes() passing in the PFN each zone ends at. At a basic | ||
| 904 | * usage, an architecture is expected to do something like | ||
| 905 | * | ||
| 906 | * unsigned long max_zone_pfns[MAX_NR_ZONES] = {max_dma, max_normal_pfn, | ||
| 907 | * max_highmem_pfn}; | ||
| 908 | * for_each_valid_physical_page_range() | ||
| 909 | * add_active_range(node_id, start_pfn, end_pfn) | ||
| 910 | * free_area_init_nodes(max_zone_pfns); | ||
| 911 | * | ||
| 912 | * If the architecture guarantees that there are no holes in the ranges | ||
| 913 | * registered with add_active_range(), free_bootmem_active_regions() | ||
| 914 | * will call free_bootmem_node() for each registered physical page range. | ||
| 915 | * Similarly sparse_memory_present_with_active_regions() calls | ||
| 916 | * memory_present() for each range when SPARSEMEM is enabled. | ||
| 917 | * | ||
| 918 | * See mm/page_alloc.c for more information on each function exposed by | ||
| 919 | * CONFIG_ARCH_POPULATES_NODE_MAP | ||
| 920 | */ | ||
| 921 | extern void free_area_init_nodes(unsigned long *max_zone_pfn); | ||
| 922 | extern void add_active_range(unsigned int nid, unsigned long start_pfn, | ||
| 923 | unsigned long end_pfn); | ||
| 924 | extern void shrink_active_range(unsigned int nid, unsigned long old_end_pfn, | ||
| 925 | unsigned long new_end_pfn); | ||
| 926 | extern void push_node_boundaries(unsigned int nid, unsigned long start_pfn, | ||
| 927 | unsigned long end_pfn); | ||
| 928 | extern void remove_all_active_ranges(void); | ||
| 929 | extern unsigned long absent_pages_in_range(unsigned long start_pfn, | ||
| 930 | unsigned long end_pfn); | ||
| 931 | extern void get_pfn_range_for_nid(unsigned int nid, | ||
| 932 | unsigned long *start_pfn, unsigned long *end_pfn); | ||
| 933 | extern unsigned long find_min_pfn_with_active_regions(void); | ||
| 934 | extern unsigned long find_max_pfn_with_active_regions(void); | ||
| 935 | extern void free_bootmem_with_active_regions(int nid, | ||
| 936 | unsigned long max_low_pfn); | ||
| 937 | extern void sparse_memory_present_with_active_regions(int nid); | ||
| 938 | #ifndef CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID | ||
| 939 | extern int early_pfn_to_nid(unsigned long pfn); | ||
| 940 | #endif /* CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID */ | ||
| 941 | #endif /* CONFIG_ARCH_POPULATES_NODE_MAP */ | ||
| 942 | extern void set_dma_reserve(unsigned long new_dma_reserve); | ||
| 882 | extern void memmap_init_zone(unsigned long, int, unsigned long, unsigned long); | 943 | extern void memmap_init_zone(unsigned long, int, unsigned long, unsigned long); |
| 883 | extern void setup_per_zone_pages_min(void); | 944 | extern void setup_per_zone_pages_min(void); |
| 884 | extern void mem_init(void); | 945 | extern void mem_init(void); |
| 885 | extern void show_mem(void); | 946 | extern void show_mem(void); |
| 886 | extern void si_meminfo(struct sysinfo * val); | 947 | extern void si_meminfo(struct sysinfo * val); |
| 887 | extern void si_meminfo_node(struct sysinfo *val, int nid); | 948 | extern void si_meminfo_node(struct sysinfo *val, int nid); |
| 949 | extern void zonetable_add(struct zone *zone, int nid, enum zone_type zid, | ||
| 950 | unsigned long pfn, unsigned long size); | ||
| 888 | 951 | ||
| 889 | #ifdef CONFIG_NUMA | 952 | #ifdef CONFIG_NUMA |
| 890 | extern void setup_per_cpu_pageset(void); | 953 | extern void setup_per_cpu_pageset(void); |
| @@ -1013,6 +1076,7 @@ static inline unsigned long vma_pages(struct vm_area_struct *vma) | |||
| 1013 | return (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; | 1076 | return (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; |
| 1014 | } | 1077 | } |
| 1015 | 1078 | ||
| 1079 | pgprot_t vm_get_page_prot(unsigned long vm_flags); | ||
| 1016 | struct vm_area_struct *find_extend_vma(struct mm_struct *, unsigned long addr); | 1080 | struct vm_area_struct *find_extend_vma(struct mm_struct *, unsigned long addr); |
| 1017 | struct page *vmalloc_to_page(void *addr); | 1081 | struct page *vmalloc_to_page(void *addr); |
| 1018 | unsigned long vmalloc_to_pfn(void *addr); | 1082 | unsigned long vmalloc_to_pfn(void *addr); |
| @@ -1071,7 +1135,7 @@ void drop_slab(void); | |||
| 1071 | extern int randomize_va_space; | 1135 | extern int randomize_va_space; |
| 1072 | #endif | 1136 | #endif |
| 1073 | 1137 | ||
| 1074 | const char *arch_vma_name(struct vm_area_struct *vma); | 1138 | __attribute__((weak)) const char *arch_vma_name(struct vm_area_struct *vma); |
| 1075 | 1139 | ||
| 1076 | #endif /* __KERNEL__ */ | 1140 | #endif /* __KERNEL__ */ |
| 1077 | #endif /* _LINUX_MM_H */ | 1141 | #endif /* _LINUX_MM_H */ |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h new file mode 100644 index 0000000000..c3852fd4a1 --- /dev/null +++ b/include/linux/mm_types.h | |||
| @@ -0,0 +1,67 @@ | |||
| 1 | #ifndef _LINUX_MM_TYPES_H | ||
| 2 | #define _LINUX_MM_TYPES_H | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | #include <linux/threads.h> | ||
| 6 | #include <linux/list.h> | ||
| 7 | #include <linux/spinlock.h> | ||
| 8 | |||
| 9 | struct address_space; | ||
| 10 | |||
| 11 | /* | ||
| 12 | * Each physical page in the system has a struct page associated with | ||
| 13 | * it to keep track of whatever it is we are using the page for at the | ||
| 14 | * moment. Note that we have no way to track which tasks are using | ||
| 15 | * a page, though if it is a pagecache page, rmap structures can tell us | ||
| 16 | * who is mapping it. | ||
| 17 | */ | ||
| 18 | struct page { | ||
| 19 | unsigned long flags; /* Atomic flags, some possibly | ||
| 20 | * updated asynchronously */ | ||
| 21 | atomic_t _count; /* Usage count, see below. */ | ||
| 22 | atomic_t _mapcount; /* Count of ptes mapped in mms, | ||
| 23 | * to show when page is mapped | ||
| 24 | * & limit reverse map searches. | ||
| 25 | */ | ||
| 26 | union { | ||
| 27 | struct { | ||
| 28 | unsigned long private; /* Mapping-private opaque data: | ||
| 29 | * usually used for buffer_heads | ||
| 30 | * if PagePrivate set; used for | ||
| 31 | * swp_entry_t if PageSwapCache; | ||
| 32 | * indicates order in the buddy | ||
| 33 | * system if PG_buddy is set. | ||
| 34 | */ | ||
| 35 | struct address_space *mapping; /* If low bit clear, points to | ||
| 36 | * inode address_space, or NULL. | ||
| 37 | * If page mapped as anonymous | ||
| 38 | * memory, low bit is set, and | ||
| 39 | * it points to anon_vma object: | ||
| 40 | * see PAGE_MAPPING_ANON below. | ||
| 41 | */ | ||
| 42 | }; | ||
| 43 | #if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS | ||
| 44 | spinlock_t ptl; | ||
| 45 | #endif | ||
| 46 | }; | ||
| 47 | pgoff_t index; /* Our offset within mapping. */ | ||
| 48 | struct list_head lru; /* Pageout list, eg. active_list | ||
| 49 | * protected by zone->lru_lock ! | ||
| 50 | */ | ||
| 51 | /* | ||
| 52 | * On machines where all RAM is mapped into kernel address space, | ||
| 53 | * we can simply calculate the virtual address. On machines with | ||
| 54 | * highmem some memory is mapped into kernel virtual memory | ||
| 55 | * dynamically, so we need a place to store that address. | ||
| 56 | * Note that this field could be 16 bits on x86 ... ;) | ||
| 57 | * | ||
| 58 | * Architectures with slow multiplication can define | ||
| 59 | * WANT_PAGE_VIRTUAL in asm/page.h | ||
| 60 | */ | ||
| 61 | #if defined(WANT_PAGE_VIRTUAL) | ||
| 62 | void *virtual; /* Kernel virtual address (NULL if | ||
| 63 | not kmapped, ie. highmem) */ | ||
| 64 | #endif /* WANT_PAGE_VIRTUAL */ | ||
| 65 | }; | ||
| 66 | |||
| 67 | #endif /* _LINUX_MM_TYPES_H */ | ||
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index ba095aebed..587264a58d 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
| @@ -85,6 +85,8 @@ struct mmc_host { | |||
| 85 | unsigned long caps; /* Host capabilities */ | 85 | unsigned long caps; /* Host capabilities */ |
| 86 | 86 | ||
| 87 | #define MMC_CAP_4_BIT_DATA (1 << 0) /* Can the host do 4 bit transfers */ | 87 | #define MMC_CAP_4_BIT_DATA (1 << 0) /* Can the host do 4 bit transfers */ |
| 88 | #define MMC_CAP_MULTIWRITE (1 << 1) /* Can accurately report bytes sent to card on error */ | ||
| 89 | #define MMC_CAP_BYTEBLOCK (1 << 2) /* Can do non-log2 block sizes */ | ||
| 88 | 90 | ||
| 89 | /* host specific block data */ | 91 | /* host specific block data */ |
| 90 | unsigned int max_seg_size; /* see blk_queue_max_segment_size */ | 92 | unsigned int max_seg_size; /* see blk_queue_max_segment_size */ |
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h index 627e2c08ce..a3594dfd69 100644 --- a/include/linux/mmc/mmc.h +++ b/include/linux/mmc/mmc.h | |||
| @@ -68,7 +68,6 @@ struct mmc_command { | |||
| 68 | struct mmc_data { | 68 | struct mmc_data { |
| 69 | unsigned int timeout_ns; /* data timeout (in ns, max 80ms) */ | 69 | unsigned int timeout_ns; /* data timeout (in ns, max 80ms) */ |
| 70 | unsigned int timeout_clks; /* data timeout (in clocks) */ | 70 | unsigned int timeout_clks; /* data timeout (in clocks) */ |
| 71 | unsigned int blksz_bits; /* data block size */ | ||
| 72 | unsigned int blksz; /* data block size */ | 71 | unsigned int blksz; /* data block size */ |
| 73 | unsigned int blocks; /* number of blocks */ | 72 | unsigned int blocks; /* number of blocks */ |
| 74 | unsigned int error; /* data error */ | 73 | unsigned int error; /* data error */ |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index f45163c528..59855b8718 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
| @@ -51,12 +51,14 @@ enum zone_stat_item { | |||
| 51 | NR_FILE_MAPPED, /* pagecache pages mapped into pagetables. | 51 | NR_FILE_MAPPED, /* pagecache pages mapped into pagetables. |
| 52 | only modified from process context */ | 52 | only modified from process context */ |
| 53 | NR_FILE_PAGES, | 53 | NR_FILE_PAGES, |
| 54 | NR_SLAB, /* Pages used by slab allocator */ | 54 | NR_SLAB_RECLAIMABLE, |
| 55 | NR_SLAB_UNRECLAIMABLE, | ||
| 55 | NR_PAGETABLE, /* used for pagetables */ | 56 | NR_PAGETABLE, /* used for pagetables */ |
| 56 | NR_FILE_DIRTY, | 57 | NR_FILE_DIRTY, |
| 57 | NR_WRITEBACK, | 58 | NR_WRITEBACK, |
| 58 | NR_UNSTABLE_NFS, /* NFS unstable pages */ | 59 | NR_UNSTABLE_NFS, /* NFS unstable pages */ |
| 59 | NR_BOUNCE, | 60 | NR_BOUNCE, |
| 61 | NR_VMSCAN_WRITE, | ||
| 60 | #ifdef CONFIG_NUMA | 62 | #ifdef CONFIG_NUMA |
| 61 | NUMA_HIT, /* allocated in intended node */ | 63 | NUMA_HIT, /* allocated in intended node */ |
| 62 | NUMA_MISS, /* allocated in non intended node */ | 64 | NUMA_MISS, /* allocated in non intended node */ |
| @@ -88,53 +90,68 @@ struct per_cpu_pageset { | |||
| 88 | #define zone_pcp(__z, __cpu) (&(__z)->pageset[(__cpu)]) | 90 | #define zone_pcp(__z, __cpu) (&(__z)->pageset[(__cpu)]) |
| 89 | #endif | 91 | #endif |
| 90 | 92 | ||
| 91 | #define ZONE_DMA 0 | 93 | enum zone_type { |
| 92 | #define ZONE_DMA32 1 | 94 | /* |
| 93 | #define ZONE_NORMAL 2 | 95 | * ZONE_DMA is used when there are devices that are not able |
| 94 | #define ZONE_HIGHMEM 3 | 96 | * to do DMA to all of addressable memory (ZONE_NORMAL). Then we |
| 95 | 97 | * carve out the portion of memory that is needed for these devices. | |
| 96 | #define MAX_NR_ZONES 4 /* Sync this with ZONES_SHIFT */ | 98 | * The range is arch specific. |
| 97 | #define ZONES_SHIFT 2 /* ceil(log2(MAX_NR_ZONES)) */ | 99 | * |
| 98 | 100 | * Some examples | |
| 101 | * | ||
| 102 | * Architecture Limit | ||
| 103 | * --------------------------- | ||
| 104 | * parisc, ia64, sparc <4G | ||
| 105 | * s390 <2G | ||
| 106 | * arm26 <48M | ||
| 107 | * arm Various | ||
| 108 | * alpha Unlimited or 0-16MB. | ||
| 109 | * | ||
| 110 | * i386, x86_64 and multiple other arches | ||
| 111 | * <16M. | ||
| 112 | */ | ||
| 113 | ZONE_DMA, | ||
| 114 | #ifdef CONFIG_ZONE_DMA32 | ||
| 115 | /* | ||
| 116 | * x86_64 needs two ZONE_DMAs because it supports devices that are | ||
| 117 | * only able to do DMA to the lower 16M but also 32 bit devices that | ||
| 118 | * can only do DMA areas below 4G. | ||
| 119 | */ | ||
| 120 | ZONE_DMA32, | ||
| 121 | #endif | ||
| 122 | /* | ||
| 123 | * Normal addressable memory is in ZONE_NORMAL. DMA operations can be | ||
| 124 | * performed on pages in ZONE_NORMAL if the DMA devices support | ||
| 125 | * transfers to all addressable memory. | ||
| 126 | */ | ||
| 127 | ZONE_NORMAL, | ||
| 128 | #ifdef CONFIG_HIGHMEM | ||
| 129 | /* | ||
| 130 | * A memory area that is only addressable by the kernel through | ||
| 131 | * mapping portions into its own address space. This is for example | ||
| 132 | * used by i386 to allow the kernel to address the memory beyond | ||
| 133 | * 900MB. The kernel will set up special mappings (page | ||
| 134 | * table entries on i386) for each page that the kernel needs to | ||
| 135 | * access. | ||
| 136 | */ | ||
| 137 | ZONE_HIGHMEM, | ||
| 138 | #endif | ||
| 139 | MAX_NR_ZONES | ||
| 140 | }; | ||
| 99 | 141 | ||
| 100 | /* | 142 | /* |
| 101 | * When a memory allocation must conform to specific limitations (such | 143 | * When a memory allocation must conform to specific limitations (such |
| 102 | * as being suitable for DMA) the caller will pass in hints to the | 144 | * as being suitable for DMA) the caller will pass in hints to the |
| 103 | * allocator in the gfp_mask, in the zone modifier bits. These bits | 145 | * allocator in the gfp_mask, in the zone modifier bits. These bits |
| 104 | * are used to select a priority ordered list of memory zones which | 146 | * are used to select a priority ordered list of memory zones which |
| 105 | * match the requested limits. GFP_ZONEMASK defines which bits within | 147 | * match the requested limits. See gfp_zone() in include/linux/gfp.h |
| 106 | * the gfp_mask should be considered as zone modifiers. Each valid | ||
| 107 | * combination of the zone modifier bits has a corresponding list | ||
| 108 | * of zones (in node_zonelists). Thus for two zone modifiers there | ||
| 109 | * will be a maximum of 4 (2 ** 2) zonelists, for 3 modifiers there will | ||
| 110 | * be 8 (2 ** 3) zonelists. GFP_ZONETYPES defines the number of possible | ||
| 111 | * combinations of zone modifiers in "zone modifier space". | ||
| 112 | * | ||
| 113 | * As an optimisation any zone modifier bits which are only valid when | ||
| 114 | * no other zone modifier bits are set (loners) should be placed in | ||
| 115 | * the highest order bits of this field. This allows us to reduce the | ||
| 116 | * extent of the zonelists thus saving space. For example in the case | ||
| 117 | * of three zone modifier bits, we could require up to eight zonelists. | ||
| 118 | * If the left most zone modifier is a "loner" then the highest valid | ||
| 119 | * zonelist would be four allowing us to allocate only five zonelists. | ||
| 120 | * Use the first form for GFP_ZONETYPES when the left most bit is not | ||
| 121 | * a "loner", otherwise use the second. | ||
| 122 | * | ||
| 123 | * NOTE! Make sure this matches the zones in <linux/gfp.h> | ||
| 124 | */ | 148 | */ |
| 125 | #define GFP_ZONEMASK 0x07 | ||
| 126 | /* #define GFP_ZONETYPES (GFP_ZONEMASK + 1) */ /* Non-loner */ | ||
| 127 | #define GFP_ZONETYPES ((GFP_ZONEMASK + 1) / 2 + 1) /* Loner */ | ||
| 128 | 149 | ||
| 129 | /* | 150 | #if !defined(CONFIG_ZONE_DMA32) && !defined(CONFIG_HIGHMEM) |
| 130 | * On machines where it is needed (eg PCs) we divide physical memory | 151 | #define ZONES_SHIFT 1 |
| 131 | * into multiple physical zones. On a 32bit PC we have 4 zones: | 152 | #else |
| 132 | * | 153 | #define ZONES_SHIFT 2 |
| 133 | * ZONE_DMA < 16 MB ISA DMA capable memory | 154 | #endif |
| 134 | * ZONE_DMA32 0 MB Empty | ||
| 135 | * ZONE_NORMAL 16-896 MB direct mapped by the kernel | ||
| 136 | * ZONE_HIGHMEM > 896 MB only page cache and user processes | ||
| 137 | */ | ||
| 138 | 155 | ||
| 139 | struct zone { | 156 | struct zone { |
| 140 | /* Fields commonly accessed by the page allocator */ | 157 | /* Fields commonly accessed by the page allocator */ |
| @@ -151,10 +168,12 @@ struct zone { | |||
| 151 | unsigned long lowmem_reserve[MAX_NR_ZONES]; | 168 | unsigned long lowmem_reserve[MAX_NR_ZONES]; |
| 152 | 169 | ||
| 153 | #ifdef CONFIG_NUMA | 170 | #ifdef CONFIG_NUMA |
| 171 | int node; | ||
| 154 | /* | 172 | /* |
| 155 | * zone reclaim becomes active if more unmapped pages exist. | 173 | * zone reclaim becomes active if more unmapped pages exist. |
| 156 | */ | 174 | */ |
| 157 | unsigned long min_unmapped_ratio; | 175 | unsigned long min_unmapped_pages; |
| 176 | unsigned long min_slab_pages; | ||
| 158 | struct per_cpu_pageset *pageset[NR_CPUS]; | 177 | struct per_cpu_pageset *pageset[NR_CPUS]; |
| 159 | #else | 178 | #else |
| 160 | struct per_cpu_pageset pageset[NR_CPUS]; | 179 | struct per_cpu_pageset pageset[NR_CPUS]; |
| @@ -266,7 +285,6 @@ struct zone { | |||
| 266 | char *name; | 285 | char *name; |
| 267 | } ____cacheline_internodealigned_in_smp; | 286 | } ____cacheline_internodealigned_in_smp; |
| 268 | 287 | ||
| 269 | |||
| 270 | /* | 288 | /* |
| 271 | * The "priority" of VM scanning is how much of the queues we will scan in one | 289 | * The "priority" of VM scanning is how much of the queues we will scan in one |
| 272 | * go. A value of 12 for DEF_PRIORITY implies that we will scan 1/4096th of the | 290 | * go. A value of 12 for DEF_PRIORITY implies that we will scan 1/4096th of the |
| @@ -289,6 +307,18 @@ struct zonelist { | |||
| 289 | struct zone *zones[MAX_NUMNODES * MAX_NR_ZONES + 1]; // NULL delimited | 307 | struct zone *zones[MAX_NUMNODES * MAX_NR_ZONES + 1]; // NULL delimited |
| 290 | }; | 308 | }; |
| 291 | 309 | ||
| 310 | #ifdef CONFIG_ARCH_POPULATES_NODE_MAP | ||
| 311 | struct node_active_region { | ||
| 312 | unsigned long start_pfn; | ||
| 313 | unsigned long end_pfn; | ||
| 314 | int nid; | ||
| 315 | }; | ||
| 316 | #endif /* CONFIG_ARCH_POPULATES_NODE_MAP */ | ||
| 317 | |||
| 318 | #ifndef CONFIG_DISCONTIGMEM | ||
| 319 | /* The array of struct pages - for discontigmem use pgdat->lmem_map */ | ||
| 320 | extern struct page *mem_map; | ||
| 321 | #endif | ||
| 292 | 322 | ||
| 293 | /* | 323 | /* |
| 294 | * The pg_data_t structure is used in machines with CONFIG_DISCONTIGMEM | 324 | * The pg_data_t structure is used in machines with CONFIG_DISCONTIGMEM |
| @@ -304,7 +334,7 @@ struct zonelist { | |||
| 304 | struct bootmem_data; | 334 | struct bootmem_data; |
| 305 | typedef struct pglist_data { | 335 | typedef struct pglist_data { |
| 306 | struct zone node_zones[MAX_NR_ZONES]; | 336 | struct zone node_zones[MAX_NR_ZONES]; |
| 307 | struct zonelist node_zonelists[GFP_ZONETYPES]; | 337 | struct zonelist node_zonelists[MAX_NR_ZONES]; |
| 308 | int nr_zones; | 338 | int nr_zones; |
| 309 | #ifdef CONFIG_FLAT_NODE_MEM_MAP | 339 | #ifdef CONFIG_FLAT_NODE_MEM_MAP |
| 310 | struct page *node_mem_map; | 340 | struct page *node_mem_map; |
| @@ -373,12 +403,16 @@ static inline int populated_zone(struct zone *zone) | |||
| 373 | return (!!zone->present_pages); | 403 | return (!!zone->present_pages); |
| 374 | } | 404 | } |
| 375 | 405 | ||
| 376 | static inline int is_highmem_idx(int idx) | 406 | static inline int is_highmem_idx(enum zone_type idx) |
| 377 | { | 407 | { |
| 408 | #ifdef CONFIG_HIGHMEM | ||
| 378 | return (idx == ZONE_HIGHMEM); | 409 | return (idx == ZONE_HIGHMEM); |
| 410 | #else | ||
| 411 | return 0; | ||
| 412 | #endif | ||
| 379 | } | 413 | } |
| 380 | 414 | ||
| 381 | static inline int is_normal_idx(int idx) | 415 | static inline int is_normal_idx(enum zone_type idx) |
| 382 | { | 416 | { |
| 383 | return (idx == ZONE_NORMAL); | 417 | return (idx == ZONE_NORMAL); |
| 384 | } | 418 | } |
| @@ -391,7 +425,11 @@ static inline int is_normal_idx(int idx) | |||
| 391 | */ | 425 | */ |
| 392 | static inline int is_highmem(struct zone *zone) | 426 | static inline int is_highmem(struct zone *zone) |
| 393 | { | 427 | { |
| 428 | #ifdef CONFIG_HIGHMEM | ||
| 394 | return zone == zone->zone_pgdat->node_zones + ZONE_HIGHMEM; | 429 | return zone == zone->zone_pgdat->node_zones + ZONE_HIGHMEM; |
| 430 | #else | ||
| 431 | return 0; | ||
| 432 | #endif | ||
| 395 | } | 433 | } |
| 396 | 434 | ||
| 397 | static inline int is_normal(struct zone *zone) | 435 | static inline int is_normal(struct zone *zone) |
| @@ -401,7 +439,11 @@ static inline int is_normal(struct zone *zone) | |||
| 401 | 439 | ||
| 402 | static inline int is_dma32(struct zone *zone) | 440 | static inline int is_dma32(struct zone *zone) |
| 403 | { | 441 | { |
| 442 | #ifdef CONFIG_ZONE_DMA32 | ||
| 404 | return zone == zone->zone_pgdat->node_zones + ZONE_DMA32; | 443 | return zone == zone->zone_pgdat->node_zones + ZONE_DMA32; |
| 444 | #else | ||
| 445 | return 0; | ||
| 446 | #endif | ||
| 405 | } | 447 | } |
| 406 | 448 | ||
| 407 | static inline int is_dma(struct zone *zone) | 449 | static inline int is_dma(struct zone *zone) |
| @@ -421,6 +463,8 @@ int percpu_pagelist_fraction_sysctl_handler(struct ctl_table *, int, struct file | |||
| 421 | void __user *, size_t *, loff_t *); | 463 | void __user *, size_t *, loff_t *); |
| 422 | int sysctl_min_unmapped_ratio_sysctl_handler(struct ctl_table *, int, | 464 | int sysctl_min_unmapped_ratio_sysctl_handler(struct ctl_table *, int, |
| 423 | struct file *, void __user *, size_t *, loff_t *); | 465 | struct file *, void __user *, size_t *, loff_t *); |
| 466 | int sysctl_min_slab_ratio_sysctl_handler(struct ctl_table *, int, | ||
| 467 | struct file *, void __user *, size_t *, loff_t *); | ||
| 424 | 468 | ||
| 425 | #include <linux/topology.h> | 469 | #include <linux/topology.h> |
| 426 | /* Returns the number of the current Node. */ | 470 | /* Returns the number of the current Node. */ |
| @@ -488,7 +532,8 @@ extern struct zone *next_zone(struct zone *zone); | |||
| 488 | 532 | ||
| 489 | #endif | 533 | #endif |
| 490 | 534 | ||
| 491 | #ifndef CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID | 535 | #if !defined(CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID) && \ |
| 536 | !defined(CONFIG_ARCH_POPULATES_NODE_MAP) | ||
| 492 | #define early_pfn_to_nid(nid) (0UL) | 537 | #define early_pfn_to_nid(nid) (0UL) |
| 493 | #endif | 538 | #endif |
| 494 | 539 | ||
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index f697770858..e0c393cc72 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h | |||
| @@ -148,6 +148,17 @@ struct ccw_device_id { | |||
| 148 | #define CCW_DEVICE_ID_MATCH_DEVICE_TYPE 0x04 | 148 | #define CCW_DEVICE_ID_MATCH_DEVICE_TYPE 0x04 |
| 149 | #define CCW_DEVICE_ID_MATCH_DEVICE_MODEL 0x08 | 149 | #define CCW_DEVICE_ID_MATCH_DEVICE_MODEL 0x08 |
| 150 | 150 | ||
| 151 | /* s390 AP bus devices */ | ||
| 152 | struct ap_device_id { | ||
| 153 | __u16 match_flags; /* which fields to match against */ | ||
| 154 | __u8 dev_type; /* device type */ | ||
| 155 | __u8 pad1; | ||
| 156 | __u32 pad2; | ||
| 157 | kernel_ulong_t driver_info; | ||
| 158 | }; | ||
| 159 | |||
| 160 | #define AP_DEVICE_ID_MATCH_DEVICE_TYPE 0x01 | ||
| 161 | |||
| 151 | 162 | ||
| 152 | #define PNP_ID_LEN 8 | 163 | #define PNP_ID_LEN 8 |
| 153 | #define PNP_MAX_DEVICES 8 | 164 | #define PNP_MAX_DEVICES 8 |
| @@ -297,4 +308,16 @@ struct input_device_id { | |||
| 297 | kernel_ulong_t driver_info; | 308 | kernel_ulong_t driver_info; |
| 298 | }; | 309 | }; |
| 299 | 310 | ||
| 311 | /* EISA */ | ||
| 312 | |||
| 313 | #define EISA_SIG_LEN 8 | ||
| 314 | |||
| 315 | /* The EISA signature, in ASCII form, null terminated */ | ||
| 316 | struct eisa_device_id { | ||
| 317 | char sig[EISA_SIG_LEN]; | ||
| 318 | kernel_ulong_t driver_data; | ||
| 319 | }; | ||
| 320 | |||
| 321 | #define EISA_DEVICE_MODALIAS_FMT "eisa:s%s" | ||
| 322 | |||
| 300 | #endif /* LINUX_MOD_DEVICETABLE_H */ | 323 | #endif /* LINUX_MOD_DEVICETABLE_H */ |
diff --git a/include/linux/module.h b/include/linux/module.h index 0dfb794c52..2c599175c5 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
| @@ -156,6 +156,11 @@ extern struct module __this_module; | |||
| 156 | */ | 156 | */ |
| 157 | #define MODULE_VERSION(_version) MODULE_INFO(version, _version) | 157 | #define MODULE_VERSION(_version) MODULE_INFO(version, _version) |
| 158 | 158 | ||
| 159 | /* Optional firmware file (or files) needed by the module | ||
| 160 | * format is simply firmware file name. Multiple firmware | ||
| 161 | * files require multiple MODULE_FIRMWARE() specifiers */ | ||
| 162 | #define MODULE_FIRMWARE(_firmware) MODULE_INFO(firmware, _firmware) | ||
| 163 | |||
| 159 | /* Given an address, look for it in the exception tables */ | 164 | /* Given an address, look for it in the exception tables */ |
| 160 | const struct exception_table_entry *search_exception_tables(unsigned long add); | 165 | const struct exception_table_entry *search_exception_tables(unsigned long add); |
| 161 | 166 | ||
| @@ -227,17 +232,17 @@ enum module_state | |||
| 227 | }; | 232 | }; |
| 228 | 233 | ||
| 229 | /* Similar stuff for section attributes. */ | 234 | /* Similar stuff for section attributes. */ |
| 230 | #define MODULE_SECT_NAME_LEN 32 | ||
| 231 | struct module_sect_attr | 235 | struct module_sect_attr |
| 232 | { | 236 | { |
| 233 | struct module_attribute mattr; | 237 | struct module_attribute mattr; |
| 234 | char name[MODULE_SECT_NAME_LEN]; | 238 | char *name; |
| 235 | unsigned long address; | 239 | unsigned long address; |
| 236 | }; | 240 | }; |
| 237 | 241 | ||
| 238 | struct module_sect_attrs | 242 | struct module_sect_attrs |
| 239 | { | 243 | { |
| 240 | struct attribute_group grp; | 244 | struct attribute_group grp; |
| 245 | int nsections; | ||
| 241 | struct module_sect_attr attrs[0]; | 246 | struct module_sect_attr attrs[0]; |
| 242 | }; | 247 | }; |
| 243 | 248 | ||
diff --git a/include/linux/mpage.h b/include/linux/mpage.h index 3ca880463c..cc5fb75af7 100644 --- a/include/linux/mpage.h +++ b/include/linux/mpage.h | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | * (And no, it doesn't do the #ifdef __MPAGE_H thing, and it doesn't do | 9 | * (And no, it doesn't do the #ifdef __MPAGE_H thing, and it doesn't do |
| 10 | * nested includes. Get it right in the .c file). | 10 | * nested includes. Get it right in the .c file). |
| 11 | */ | 11 | */ |
| 12 | #ifdef CONFIG_BLOCK | ||
| 12 | 13 | ||
| 13 | struct writeback_control; | 14 | struct writeback_control; |
| 14 | typedef int (writepage_t)(struct page *page, struct writeback_control *wbc); | 15 | typedef int (writepage_t)(struct page *page, struct writeback_control *wbc); |
| @@ -21,8 +22,4 @@ int mpage_writepages(struct address_space *mapping, | |||
| 21 | int mpage_writepage(struct page *page, get_block_t *get_block, | 22 | int mpage_writepage(struct page *page, get_block_t *get_block, |
| 22 | struct writeback_control *wbc); | 23 | struct writeback_control *wbc); |
| 23 | 24 | ||
| 24 | static inline int | 25 | #endif |
| 25 | generic_writepages(struct address_space *mapping, struct writeback_control *wbc) | ||
| 26 | { | ||
| 27 | return mpage_writepages(mapping, wbc, NULL); | ||
| 28 | } | ||
diff --git a/include/linux/mroute.h b/include/linux/mroute.h index e05d54a907..7da2cee8e1 100644 --- a/include/linux/mroute.h +++ b/include/linux/mroute.h | |||
| @@ -142,7 +142,7 @@ struct vif_device | |||
| 142 | unsigned long rate_limit; /* Traffic shaping (NI) */ | 142 | unsigned long rate_limit; /* Traffic shaping (NI) */ |
| 143 | unsigned char threshold; /* TTL threshold */ | 143 | unsigned char threshold; /* TTL threshold */ |
| 144 | unsigned short flags; /* Control flags */ | 144 | unsigned short flags; /* Control flags */ |
| 145 | __u32 local,remote; /* Addresses(remote for tunnels)*/ | 145 | __be32 local,remote; /* Addresses(remote for tunnels)*/ |
| 146 | int link; /* Physical interface index */ | 146 | int link; /* Physical interface index */ |
| 147 | }; | 147 | }; |
| 148 | 148 | ||
| @@ -151,8 +151,8 @@ struct vif_device | |||
| 151 | struct mfc_cache | 151 | struct mfc_cache |
| 152 | { | 152 | { |
| 153 | struct mfc_cache *next; /* Next entry on cache line */ | 153 | struct mfc_cache *next; /* Next entry on cache line */ |
| 154 | __u32 mfc_mcastgrp; /* Group the entry belongs to */ | 154 | __be32 mfc_mcastgrp; /* Group the entry belongs to */ |
| 155 | __u32 mfc_origin; /* Source of packet */ | 155 | __be32 mfc_origin; /* Source of packet */ |
| 156 | vifi_t mfc_parent; /* Source interface */ | 156 | vifi_t mfc_parent; /* Source interface */ |
| 157 | int mfc_flags; /* Flags on line */ | 157 | int mfc_flags; /* Flags on line */ |
| 158 | 158 | ||
| @@ -179,9 +179,9 @@ struct mfc_cache | |||
| 179 | #define MFC_LINES 64 | 179 | #define MFC_LINES 64 |
| 180 | 180 | ||
| 181 | #ifdef __BIG_ENDIAN | 181 | #ifdef __BIG_ENDIAN |
| 182 | #define MFC_HASH(a,b) ((((a)>>24)^((b)>>26))&(MFC_LINES-1)) | 182 | #define MFC_HASH(a,b) (((((__force u32)(__be32)a)>>24)^(((__force u32)(__be32)b)>>26))&(MFC_LINES-1)) |
| 183 | #else | 183 | #else |
| 184 | #define MFC_HASH(a,b) (((a)^((b)>>2))&(MFC_LINES-1)) | 184 | #define MFC_HASH(a,b) ((((__force u32)(__be32)a)^(((__force u32)(__be32)b)>>2))&(MFC_LINES-1)) |
| 185 | #endif | 185 | #endif |
| 186 | 186 | ||
| 187 | #endif | 187 | #endif |
| @@ -213,8 +213,8 @@ struct pimreghdr | |||
| 213 | { | 213 | { |
| 214 | __u8 type; | 214 | __u8 type; |
| 215 | __u8 reserved; | 215 | __u8 reserved; |
| 216 | __u16 csum; | 216 | __be16 csum; |
| 217 | __u32 flags; | 217 | __be32 flags; |
| 218 | }; | 218 | }; |
| 219 | 219 | ||
| 220 | extern int pim_rcv_v1(struct sk_buff *); | 220 | extern int pim_rcv_v1(struct sk_buff *); |
diff --git a/include/linux/msdos_fs.h b/include/linux/msdos_fs.h index d9035c73e5..ce6c85815c 100644 --- a/include/linux/msdos_fs.h +++ b/include/linux/msdos_fs.h | |||
| @@ -1,6 +1,8 @@ | |||
| 1 | #ifndef _LINUX_MSDOS_FS_H | 1 | #ifndef _LINUX_MSDOS_FS_H |
| 2 | #define _LINUX_MSDOS_FS_H | 2 | #define _LINUX_MSDOS_FS_H |
| 3 | 3 | ||
| 4 | #include <linux/magic.h> | ||
| 5 | |||
| 4 | /* | 6 | /* |
| 5 | * The MS-DOS filesystem constants/structures | 7 | * The MS-DOS filesystem constants/structures |
| 6 | */ | 8 | */ |
| @@ -18,8 +20,6 @@ | |||
| 18 | #define CT_LE_L(v) cpu_to_le32(v) | 20 | #define CT_LE_L(v) cpu_to_le32(v) |
| 19 | 21 | ||
| 20 | 22 | ||
| 21 | #define MSDOS_SUPER_MAGIC 0x4d44 /* MD */ | ||
| 22 | |||
| 23 | #define MSDOS_ROOT_INO 1 /* == MINIX_ROOT_INO */ | 23 | #define MSDOS_ROOT_INO 1 /* == MINIX_ROOT_INO */ |
| 24 | #define MSDOS_DIR_BITS 5 /* log2(sizeof(struct msdos_dir_entry)) */ | 24 | #define MSDOS_DIR_BITS 5 /* log2(sizeof(struct msdos_dir_entry)) */ |
| 25 | 25 | ||
| @@ -204,6 +204,7 @@ struct fat_mount_options { | |||
| 204 | unicode_xlate:1, /* create escape sequences for unhandled Unicode */ | 204 | unicode_xlate:1, /* create escape sequences for unhandled Unicode */ |
| 205 | numtail:1, /* Does first alias have a numeric '~1' type tail? */ | 205 | numtail:1, /* Does first alias have a numeric '~1' type tail? */ |
| 206 | atari:1, /* Use Atari GEMDOS variation of MS-DOS fs */ | 206 | atari:1, /* Use Atari GEMDOS variation of MS-DOS fs */ |
| 207 | flush:1, /* write things quickly */ | ||
| 207 | nocase:1; /* Does this need case conversion? 0=need case conversion*/ | 208 | nocase:1; /* Does this need case conversion? 0=need case conversion*/ |
| 208 | }; | 209 | }; |
| 209 | 210 | ||
| @@ -412,6 +413,8 @@ extern int fat_sync_inode(struct inode *inode); | |||
| 412 | extern int fat_fill_super(struct super_block *sb, void *data, int silent, | 413 | extern int fat_fill_super(struct super_block *sb, void *data, int silent, |
| 413 | struct inode_operations *fs_dir_inode_ops, int isvfat); | 414 | struct inode_operations *fs_dir_inode_ops, int isvfat); |
| 414 | 415 | ||
| 416 | extern int fat_flush_inodes(struct super_block *sb, struct inode *i1, | ||
| 417 | struct inode *i2); | ||
| 415 | /* fat/misc.c */ | 418 | /* fat/misc.c */ |
| 416 | extern void fat_fs_panic(struct super_block *s, const char *fmt, ...); | 419 | extern void fat_fs_panic(struct super_block *s, const char *fmt, ...); |
| 417 | extern void fat_clusters_flush(struct super_block *sb); | 420 | extern void fat_clusters_flush(struct super_block *sb); |
diff --git a/include/linux/namei.h b/include/linux/namei.h index 45511a5918..f5f19606ef 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | #ifndef _LINUX_NAMEI_H | 1 | #ifndef _LINUX_NAMEI_H |
| 2 | #define _LINUX_NAMEI_H | 2 | #define _LINUX_NAMEI_H |
| 3 | 3 | ||
| 4 | #include <linux/dcache.h> | ||
| 4 | #include <linux/linkage.h> | 5 | #include <linux/linkage.h> |
| 5 | 6 | ||
| 6 | struct vfsmount; | 7 | struct vfsmount; |
| @@ -54,6 +55,7 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND}; | |||
| 54 | #define LOOKUP_OPEN (0x0100) | 55 | #define LOOKUP_OPEN (0x0100) |
| 55 | #define LOOKUP_CREATE (0x0200) | 56 | #define LOOKUP_CREATE (0x0200) |
| 56 | #define LOOKUP_ACCESS (0x0400) | 57 | #define LOOKUP_ACCESS (0x0400) |
| 58 | #define LOOKUP_CHDIR (0x0800) | ||
| 57 | 59 | ||
| 58 | extern int FASTCALL(__user_walk(const char __user *, unsigned, struct nameidata *)); | 60 | extern int FASTCALL(__user_walk(const char __user *, unsigned, struct nameidata *)); |
| 59 | extern int FASTCALL(__user_walk_fd(int dfd, const char __user *, unsigned, struct nameidata *)); | 61 | extern int FASTCALL(__user_walk_fd(int dfd, const char __user *, unsigned, struct nameidata *)); |
diff --git a/include/linux/ncp_fs.h b/include/linux/ncp_fs.h index b208f0cd55..0ea7f89e61 100644 --- a/include/linux/ncp_fs.h +++ b/include/linux/ncp_fs.h | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #include <linux/fs.h> | 11 | #include <linux/fs.h> |
| 12 | #include <linux/in.h> | 12 | #include <linux/in.h> |
| 13 | #include <linux/types.h> | 13 | #include <linux/types.h> |
| 14 | #include <linux/magic.h> | ||
| 14 | 15 | ||
| 15 | #include <linux/ipx.h> | 16 | #include <linux/ipx.h> |
| 16 | #include <linux/ncp_no.h> | 17 | #include <linux/ncp_no.h> |
| @@ -185,10 +186,6 @@ struct ncp_entry_info { | |||
| 185 | __u8 file_handle[6]; | 186 | __u8 file_handle[6]; |
| 186 | }; | 187 | }; |
| 187 | 188 | ||
| 188 | /* Guess, what 0x564c is :-) */ | ||
| 189 | #define NCP_SUPER_MAGIC 0x564c | ||
| 190 | |||
| 191 | |||
| 192 | static inline struct ncp_server *NCP_SBP(struct super_block *sb) | 189 | static inline struct ncp_server *NCP_SBP(struct super_block *sb) |
| 193 | { | 190 | { |
| 194 | return sb->s_fs_info; | 191 | return sb->s_fs_info; |
| @@ -215,6 +212,7 @@ void ncp_date_unix2dos(int unix_date, __le16 * time, __le16 * date); | |||
| 215 | 212 | ||
| 216 | /* linux/fs/ncpfs/ioctl.c */ | 213 | /* linux/fs/ncpfs/ioctl.c */ |
| 217 | int ncp_ioctl(struct inode *, struct file *, unsigned int, unsigned long); | 214 | int ncp_ioctl(struct inode *, struct file *, unsigned int, unsigned long); |
| 215 | long ncp_compat_ioctl(struct file *, unsigned int, unsigned long); | ||
| 218 | 216 | ||
| 219 | /* linux/fs/ncpfs/sock.c */ | 217 | /* linux/fs/ncpfs/sock.c */ |
| 220 | int ncp_request2(struct ncp_server *server, int function, | 218 | int ncp_request2(struct ncp_server *server, int function, |
diff --git a/include/linux/neighbour.h b/include/linux/neighbour.h new file mode 100644 index 0000000000..bd3bbf668c --- /dev/null +++ b/include/linux/neighbour.h | |||
| @@ -0,0 +1,159 @@ | |||
| 1 | #ifndef __LINUX_NEIGHBOUR_H | ||
| 2 | #define __LINUX_NEIGHBOUR_H | ||
| 3 | |||
| 4 | #include <linux/netlink.h> | ||
| 5 | |||
| 6 | struct ndmsg | ||
| 7 | { | ||
| 8 | __u8 ndm_family; | ||
| 9 | __u8 ndm_pad1; | ||
| 10 | __u16 ndm_pad2; | ||
| 11 | __s32 ndm_ifindex; | ||
| 12 | __u16 ndm_state; | ||
| 13 | __u8 ndm_flags; | ||
| 14 | __u8 ndm_type; | ||
| 15 | }; | ||
| 16 | |||
| 17 | enum | ||
| 18 | { | ||
| 19 | NDA_UNSPEC, | ||
| 20 | NDA_DST, | ||
| 21 | NDA_LLADDR, | ||
| 22 | NDA_CACHEINFO, | ||
| 23 | NDA_PROBES, | ||
| 24 | __NDA_MAX | ||
| 25 | }; | ||
| 26 | |||
| 27 | #define NDA_MAX (__NDA_MAX - 1) | ||
| 28 | |||
| 29 | /* | ||
| 30 | * Neighbor Cache Entry Flags | ||
| 31 | */ | ||
| 32 | |||
| 33 | #define NTF_PROXY 0x08 /* == ATF_PUBL */ | ||
| 34 | #define NTF_ROUTER 0x80 | ||
| 35 | |||
| 36 | /* | ||
| 37 | * Neighbor Cache Entry States. | ||
| 38 | */ | ||
| 39 | |||
| 40 | #define NUD_INCOMPLETE 0x01 | ||
| 41 | #define NUD_REACHABLE 0x02 | ||
| 42 | #define NUD_STALE 0x04 | ||
| 43 | #define NUD_DELAY 0x08 | ||
| 44 | #define NUD_PROBE 0x10 | ||
| 45 | #define NUD_FAILED 0x20 | ||
| 46 | |||
| 47 | /* Dummy states */ | ||
| 48 | #define NUD_NOARP 0x40 | ||
| 49 | #define NUD_PERMANENT 0x80 | ||
| 50 | #define NUD_NONE 0x00 | ||
| 51 | |||
| 52 | /* NUD_NOARP & NUD_PERMANENT are pseudostates, they never change | ||
| 53 | and make no address resolution or NUD. | ||
| 54 | NUD_PERMANENT is also cannot be deleted by garbage collectors. | ||
| 55 | */ | ||
| 56 | |||
| 57 | struct nda_cacheinfo | ||
| 58 | { | ||
| 59 | __u32 ndm_confirmed; | ||
| 60 | __u32 ndm_used; | ||
| 61 | __u32 ndm_updated; | ||
| 62 | __u32 ndm_refcnt; | ||
| 63 | }; | ||
| 64 | |||
| 65 | /***************************************************************** | ||
| 66 | * Neighbour tables specific messages. | ||
| 67 | * | ||
| 68 | * To retrieve the neighbour tables send RTM_GETNEIGHTBL with the | ||
| 69 | * NLM_F_DUMP flag set. Every neighbour table configuration is | ||
| 70 | * spread over multiple messages to avoid running into message | ||
| 71 | * size limits on systems with many interfaces. The first message | ||
| 72 | * in the sequence transports all not device specific data such as | ||
| 73 | * statistics, configuration, and the default parameter set. | ||
| 74 | * This message is followed by 0..n messages carrying device | ||
| 75 | * specific parameter sets. | ||
| 76 | * Although the ordering should be sufficient, NDTA_NAME can be | ||
| 77 | * used to identify sequences. The initial message can be identified | ||
| 78 | * by checking for NDTA_CONFIG. The device specific messages do | ||
| 79 | * not contain this TLV but have NDTPA_IFINDEX set to the | ||
| 80 | * corresponding interface index. | ||
| 81 | * | ||
| 82 | * To change neighbour table attributes, send RTM_SETNEIGHTBL | ||
| 83 | * with NDTA_NAME set. Changeable attribute include NDTA_THRESH[1-3], | ||
| 84 | * NDTA_GC_INTERVAL, and all TLVs in NDTA_PARMS unless marked | ||
| 85 | * otherwise. Device specific parameter sets can be changed by | ||
| 86 | * setting NDTPA_IFINDEX to the interface index of the corresponding | ||
| 87 | * device. | ||
| 88 | ****/ | ||
| 89 | |||
| 90 | struct ndt_stats | ||
| 91 | { | ||
| 92 | __u64 ndts_allocs; | ||
| 93 | __u64 ndts_destroys; | ||
| 94 | __u64 ndts_hash_grows; | ||
| 95 | __u64 ndts_res_failed; | ||
| 96 | __u64 ndts_lookups; | ||
| 97 | __u64 ndts_hits; | ||
| 98 | __u64 ndts_rcv_probes_mcast; | ||
| 99 | __u64 ndts_rcv_probes_ucast; | ||
| 100 | __u64 ndts_periodic_gc_runs; | ||
| 101 | __u64 ndts_forced_gc_runs; | ||
| 102 | }; | ||
| 103 | |||
| 104 | enum { | ||
| 105 | NDTPA_UNSPEC, | ||
| 106 | NDTPA_IFINDEX, /* u32, unchangeable */ | ||
| 107 | NDTPA_REFCNT, /* u32, read-only */ | ||
| 108 | NDTPA_REACHABLE_TIME, /* u64, read-only, msecs */ | ||
| 109 | NDTPA_BASE_REACHABLE_TIME, /* u64, msecs */ | ||
| 110 | NDTPA_RETRANS_TIME, /* u64, msecs */ | ||
| 111 | NDTPA_GC_STALETIME, /* u64, msecs */ | ||
| 112 | NDTPA_DELAY_PROBE_TIME, /* u64, msecs */ | ||
| 113 | NDTPA_QUEUE_LEN, /* u32 */ | ||
| 114 | NDTPA_APP_PROBES, /* u32 */ | ||
| 115 | NDTPA_UCAST_PROBES, /* u32 */ | ||
| 116 | NDTPA_MCAST_PROBES, /* u32 */ | ||
| 117 | NDTPA_ANYCAST_DELAY, /* u64, msecs */ | ||
| 118 | NDTPA_PROXY_DELAY, /* u64, msecs */ | ||
| 119 | NDTPA_PROXY_QLEN, /* u32 */ | ||
| 120 | NDTPA_LOCKTIME, /* u64, msecs */ | ||
| 121 | __NDTPA_MAX | ||
| 122 | }; | ||
| 123 | #define NDTPA_MAX (__NDTPA_MAX - 1) | ||
| 124 | |||
| 125 | struct ndtmsg | ||
| 126 | { | ||
| 127 | __u8 ndtm_family; | ||
| 128 | __u8 ndtm_pad1; | ||
| 129 | __u16 ndtm_pad2; | ||
| 130 | }; | ||
| 131 | |||
| 132 | struct ndt_config | ||
| 133 | { | ||
| 134 | __u16 ndtc_key_len; | ||
| 135 | __u16 ndtc_entry_size; | ||
| 136 | __u32 ndtc_entries; | ||
| 137 | __u32 ndtc_last_flush; /* delta to now in msecs */ | ||
| 138 | __u32 ndtc_last_rand; /* delta to now in msecs */ | ||
| 139 | __u32 ndtc_hash_rnd; | ||
| 140 | __u32 ndtc_hash_mask; | ||
| 141 | __u32 ndtc_hash_chain_gc; | ||
| 142 | __u32 ndtc_proxy_qlen; | ||
| 143 | }; | ||
| 144 | |||
| 145 | enum { | ||
| 146 | NDTA_UNSPEC, | ||
| 147 | NDTA_NAME, /* char *, unchangeable */ | ||
| 148 | NDTA_THRESH1, /* u32 */ | ||
| 149 | NDTA_THRESH2, /* u32 */ | ||
| 150 | NDTA_THRESH3, /* u32 */ | ||
| 151 | NDTA_CONFIG, /* struct ndt_config, read-only */ | ||
| 152 | NDTA_PARMS, /* nested TLV NDTPA_* */ | ||
| 153 | NDTA_STATS, /* struct ndt_stats, read-only */ | ||
| 154 | NDTA_GC_INTERVAL, /* u64, msecs */ | ||
| 155 | __NDTA_MAX | ||
| 156 | }; | ||
| 157 | #define NDTA_MAX (__NDTA_MAX - 1) | ||
| 158 | |||
| 159 | #endif | ||
diff --git a/include/linux/net.h b/include/linux/net.h index b20c53c744..c257f716e0 100644 --- a/include/linux/net.h +++ b/include/linux/net.h | |||
| @@ -169,11 +169,6 @@ struct proto_ops { | |||
| 169 | struct net_proto_family { | 169 | struct net_proto_family { |
| 170 | int family; | 170 | int family; |
| 171 | int (*create)(struct socket *sock, int protocol); | 171 | int (*create)(struct socket *sock, int protocol); |
| 172 | /* These are counters for the number of different methods of | ||
| 173 | each we support */ | ||
| 174 | short authentication; | ||
| 175 | short encryption; | ||
| 176 | short encrypt_net; | ||
| 177 | struct module *owner; | 172 | struct module *owner; |
| 178 | }; | 173 | }; |
| 179 | 174 | ||
| @@ -181,8 +176,8 @@ struct iovec; | |||
| 181 | struct kvec; | 176 | struct kvec; |
| 182 | 177 | ||
| 183 | extern int sock_wake_async(struct socket *sk, int how, int band); | 178 | extern int sock_wake_async(struct socket *sk, int how, int band); |
| 184 | extern int sock_register(struct net_proto_family *fam); | 179 | extern int sock_register(const struct net_proto_family *fam); |
| 185 | extern int sock_unregister(int family); | 180 | extern void sock_unregister(int family); |
| 186 | extern int sock_create(int family, int type, int proto, | 181 | extern int sock_create(int family, int type, int proto, |
| 187 | struct socket **res); | 182 | struct socket **res); |
| 188 | extern int sock_create_kern(int family, int type, int proto, | 183 | extern int sock_create_kern(int family, int type, int proto, |
| @@ -208,6 +203,25 @@ extern int kernel_recvmsg(struct socket *sock, struct msghdr *msg, | |||
| 208 | struct kvec *vec, size_t num, | 203 | struct kvec *vec, size_t num, |
| 209 | size_t len, int flags); | 204 | size_t len, int flags); |
| 210 | 205 | ||
| 206 | extern int kernel_bind(struct socket *sock, struct sockaddr *addr, | ||
| 207 | int addrlen); | ||
| 208 | extern int kernel_listen(struct socket *sock, int backlog); | ||
| 209 | extern int kernel_accept(struct socket *sock, struct socket **newsock, | ||
| 210 | int flags); | ||
| 211 | extern int kernel_connect(struct socket *sock, struct sockaddr *addr, | ||
| 212 | int addrlen, int flags); | ||
| 213 | extern int kernel_getsockname(struct socket *sock, struct sockaddr *addr, | ||
| 214 | int *addrlen); | ||
| 215 | extern int kernel_getpeername(struct socket *sock, struct sockaddr *addr, | ||
| 216 | int *addrlen); | ||
| 217 | extern int kernel_getsockopt(struct socket *sock, int level, int optname, | ||
| 218 | char *optval, int *optlen); | ||
| 219 | extern int kernel_setsockopt(struct socket *sock, int level, int optname, | ||
| 220 | char *optval, int optlen); | ||
| 221 | extern int kernel_sendpage(struct socket *sock, struct page *page, int offset, | ||
| 222 | size_t size, int flags); | ||
| 223 | extern int kernel_sock_ioctl(struct socket *sock, int cmd, unsigned long arg); | ||
| 224 | |||
| 211 | #ifndef CONFIG_SMP | 225 | #ifndef CONFIG_SMP |
| 212 | #define SOCKOPS_WRAPPED(name) name | 226 | #define SOCKOPS_WRAPPED(name) name |
| 213 | #define SOCKOPS_WRAP(name, fam) | 227 | #define SOCKOPS_WRAP(name, fam) |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 50a4719512..9264139bd8 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
| @@ -187,7 +187,7 @@ struct hh_cache | |||
| 187 | { | 187 | { |
| 188 | struct hh_cache *hh_next; /* Next entry */ | 188 | struct hh_cache *hh_next; /* Next entry */ |
| 189 | atomic_t hh_refcnt; /* number of users */ | 189 | atomic_t hh_refcnt; /* number of users */ |
| 190 | unsigned short hh_type; /* protocol identifier, f.e ETH_P_IP | 190 | __be16 hh_type; /* protocol identifier, f.e ETH_P_IP |
| 191 | * NOTE: For VLANs, this will be the | 191 | * NOTE: For VLANs, this will be the |
| 192 | * encapuslated type. --BLG | 192 | * encapuslated type. --BLG |
| 193 | */ | 193 | */ |
| @@ -334,7 +334,6 @@ struct net_device | |||
| 334 | 334 | ||
| 335 | 335 | ||
| 336 | struct net_device_stats* (*get_stats)(struct net_device *dev); | 336 | struct net_device_stats* (*get_stats)(struct net_device *dev); |
| 337 | struct iw_statistics* (*get_wireless_stats)(struct net_device *dev); | ||
| 338 | 337 | ||
| 339 | /* List of functions to handle Wireless Extensions (instead of ioctl). | 338 | /* List of functions to handle Wireless Extensions (instead of ioctl). |
| 340 | * See <net/iw_handler.h> for details. Jean II */ | 339 | * See <net/iw_handler.h> for details. Jean II */ |
| @@ -342,7 +341,7 @@ struct net_device | |||
| 342 | /* Instance data managed by the core of Wireless Extensions. */ | 341 | /* Instance data managed by the core of Wireless Extensions. */ |
| 343 | struct iw_public_data * wireless_data; | 342 | struct iw_public_data * wireless_data; |
| 344 | 343 | ||
| 345 | struct ethtool_ops *ethtool_ops; | 344 | const struct ethtool_ops *ethtool_ops; |
| 346 | 345 | ||
| 347 | /* | 346 | /* |
| 348 | * This marks the end of the "visible" part of the structure. All | 347 | * This marks the end of the "visible" part of the structure. All |
| @@ -976,7 +975,7 @@ extern void dev_mcast_init(void); | |||
| 976 | extern int netdev_max_backlog; | 975 | extern int netdev_max_backlog; |
| 977 | extern int weight_p; | 976 | extern int weight_p; |
| 978 | extern int netdev_set_master(struct net_device *dev, struct net_device *master); | 977 | extern int netdev_set_master(struct net_device *dev, struct net_device *master); |
| 979 | extern int skb_checksum_help(struct sk_buff *skb, int inward); | 978 | extern int skb_checksum_help(struct sk_buff *skb); |
| 980 | extern struct sk_buff *skb_gso_segment(struct sk_buff *skb, int features); | 979 | extern struct sk_buff *skb_gso_segment(struct sk_buff *skb, int features); |
| 981 | #ifdef CONFIG_BUG | 980 | #ifdef CONFIG_BUG |
| 982 | extern void netdev_rx_csum_fault(struct net_device *dev); | 981 | extern void netdev_rx_csum_fault(struct net_device *dev); |
| @@ -1012,11 +1011,12 @@ static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb) | |||
| 1012 | { | 1011 | { |
| 1013 | return skb_is_gso(skb) && | 1012 | return skb_is_gso(skb) && |
| 1014 | (!skb_gso_ok(skb, dev->features) || | 1013 | (!skb_gso_ok(skb, dev->features) || |
| 1015 | unlikely(skb->ip_summed != CHECKSUM_HW)); | 1014 | unlikely(skb->ip_summed != CHECKSUM_PARTIAL)); |
| 1016 | } | 1015 | } |
| 1017 | 1016 | ||
| 1018 | /* On bonding slaves other than the currently active slave, suppress | 1017 | /* On bonding slaves other than the currently active slave, suppress |
| 1019 | * duplicates except for 802.3ad ETH_P_SLOW and alb non-mcast/bcast. | 1018 | * duplicates except for 802.3ad ETH_P_SLOW, alb non-mcast/bcast, and |
| 1019 | * ARP on active-backup slaves with arp_validate enabled. | ||
| 1020 | */ | 1020 | */ |
| 1021 | static inline int skb_bond_should_drop(struct sk_buff *skb) | 1021 | static inline int skb_bond_should_drop(struct sk_buff *skb) |
| 1022 | { | 1022 | { |
| @@ -1025,6 +1025,10 @@ static inline int skb_bond_should_drop(struct sk_buff *skb) | |||
| 1025 | 1025 | ||
| 1026 | if (master && | 1026 | if (master && |
| 1027 | (dev->priv_flags & IFF_SLAVE_INACTIVE)) { | 1027 | (dev->priv_flags & IFF_SLAVE_INACTIVE)) { |
| 1028 | if ((dev->priv_flags & IFF_SLAVE_NEEDARP) && | ||
| 1029 | skb->protocol == __constant_htons(ETH_P_ARP)) | ||
| 1030 | return 0; | ||
| 1031 | |||
| 1028 | if (master->priv_flags & IFF_MASTER_ALB) { | 1032 | if (master->priv_flags & IFF_MASTER_ALB) { |
| 1029 | if (skb->pkt_type != PACKET_BROADCAST && | 1033 | if (skb->pkt_type != PACKET_BROADCAST && |
| 1030 | skb->pkt_type != PACKET_MULTICAST) | 1034 | skb->pkt_type != PACKET_MULTICAST) |
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h index 10168e26a8..b7e67d1d43 100644 --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h | |||
| @@ -282,6 +282,12 @@ extern void nf_invalidate_cache(int pf); | |||
| 282 | Returns true or false. */ | 282 | Returns true or false. */ |
| 283 | extern int skb_make_writable(struct sk_buff **pskb, unsigned int writable_len); | 283 | extern int skb_make_writable(struct sk_buff **pskb, unsigned int writable_len); |
| 284 | 284 | ||
| 285 | extern u_int16_t nf_csum_update(u_int32_t oldval, u_int32_t newval, | ||
| 286 | u_int32_t csum); | ||
| 287 | extern u_int16_t nf_proto_csum_update(struct sk_buff *skb, | ||
| 288 | u_int32_t oldval, u_int32_t newval, | ||
| 289 | u_int16_t csum, int pseudohdr); | ||
| 290 | |||
| 285 | struct nf_afinfo { | 291 | struct nf_afinfo { |
| 286 | unsigned short family; | 292 | unsigned short family; |
| 287 | unsigned int (*checksum)(struct sk_buff *skb, unsigned int hook, | 293 | unsigned int (*checksum)(struct sk_buff *skb, unsigned int hook, |
diff --git a/include/linux/netfilter/Kbuild b/include/linux/netfilter/Kbuild index 1d3a14e2da..312bd2ffee 100644 --- a/include/linux/netfilter/Kbuild +++ b/include/linux/netfilter/Kbuild | |||
| @@ -1,11 +1,40 @@ | |||
| 1 | header-y := nf_conntrack_sctp.h nf_conntrack_tuple_common.h \ | 1 | header-y += nf_conntrack_sctp.h |
| 2 | nfnetlink_conntrack.h nfnetlink_log.h nfnetlink_queue.h \ | 2 | header-y += nf_conntrack_tuple_common.h |
| 3 | xt_CLASSIFY.h xt_comment.h xt_connbytes.h xt_connmark.h \ | 3 | header-y += nfnetlink_conntrack.h |
| 4 | xt_CONNMARK.h xt_conntrack.h xt_dccp.h xt_esp.h \ | 4 | header-y += nfnetlink_log.h |
| 5 | xt_helper.h xt_length.h xt_limit.h xt_mac.h xt_mark.h \ | 5 | header-y += nfnetlink_queue.h |
| 6 | xt_MARK.h xt_multiport.h xt_NFQUEUE.h xt_pkttype.h \ | 6 | header-y += xt_CLASSIFY.h |
| 7 | xt_policy.h xt_realm.h xt_sctp.h xt_state.h xt_string.h \ | 7 | header-y += xt_comment.h |
| 8 | xt_tcpmss.h xt_tcpudp.h xt_SECMARK.h xt_CONNSECMARK.h | 8 | header-y += xt_connbytes.h |
| 9 | header-y += xt_connmark.h | ||
| 10 | header-y += xt_CONNMARK.h | ||
| 11 | header-y += xt_conntrack.h | ||
| 12 | header-y += xt_dccp.h | ||
| 13 | header-y += xt_dscp.h | ||
| 14 | header-y += xt_DSCP.h | ||
| 15 | header-y += xt_esp.h | ||
| 16 | header-y += xt_helper.h | ||
| 17 | header-y += xt_length.h | ||
| 18 | header-y += xt_limit.h | ||
| 19 | header-y += xt_mac.h | ||
| 20 | header-y += xt_mark.h | ||
| 21 | header-y += xt_MARK.h | ||
| 22 | header-y += xt_multiport.h | ||
| 23 | header-y += xt_NFQUEUE.h | ||
| 24 | header-y += xt_pkttype.h | ||
| 25 | header-y += xt_policy.h | ||
| 26 | header-y += xt_realm.h | ||
| 27 | header-y += xt_sctp.h | ||
| 28 | header-y += xt_state.h | ||
| 29 | header-y += xt_string.h | ||
| 30 | header-y += xt_tcpmss.h | ||
| 31 | header-y += xt_tcpudp.h | ||
| 32 | header-y += xt_SECMARK.h | ||
| 33 | header-y += xt_CONNSECMARK.h | ||
| 9 | 34 | ||
| 10 | unifdef-y := nf_conntrack_common.h nf_conntrack_ftp.h \ | 35 | unifdef-y += nf_conntrack_common.h |
| 11 | nf_conntrack_tcp.h nfnetlink.h x_tables.h xt_physdev.h | 36 | unifdef-y += nf_conntrack_ftp.h |
| 37 | unifdef-y += nf_conntrack_tcp.h | ||
| 38 | unifdef-y += nfnetlink.h | ||
| 39 | unifdef-y += x_tables.h | ||
| 40 | unifdef-y += xt_physdev.h | ||
diff --git a/include/linux/netfilter/nf_conntrack_common.h b/include/linux/netfilter/nf_conntrack_common.h index d2e4bd7a7a..9e0dae0786 100644 --- a/include/linux/netfilter/nf_conntrack_common.h +++ b/include/linux/netfilter/nf_conntrack_common.h | |||
| @@ -125,6 +125,10 @@ enum ip_conntrack_events | |||
| 125 | /* Counter highest bit has been set */ | 125 | /* Counter highest bit has been set */ |
| 126 | IPCT_COUNTER_FILLING_BIT = 11, | 126 | IPCT_COUNTER_FILLING_BIT = 11, |
| 127 | IPCT_COUNTER_FILLING = (1 << IPCT_COUNTER_FILLING_BIT), | 127 | IPCT_COUNTER_FILLING = (1 << IPCT_COUNTER_FILLING_BIT), |
| 128 | |||
| 129 | /* Mark is set */ | ||
| 130 | IPCT_MARK_BIT = 12, | ||
| 131 | IPCT_MARK = (1 << IPCT_MARK_BIT), | ||
| 128 | }; | 132 | }; |
| 129 | 133 | ||
| 130 | enum ip_conntrack_expect_events { | 134 | enum ip_conntrack_expect_events { |
diff --git a/include/linux/netfilter/nf_conntrack_tcp.h b/include/linux/netfilter/nf_conntrack_tcp.h index b2feeffde3..6b01ba2977 100644 --- a/include/linux/netfilter/nf_conntrack_tcp.h +++ b/include/linux/netfilter/nf_conntrack_tcp.h | |||
| @@ -49,6 +49,7 @@ struct ip_ct_tcp | |||
| 49 | u_int32_t last_seq; /* Last sequence number seen in dir */ | 49 | u_int32_t last_seq; /* Last sequence number seen in dir */ |
| 50 | u_int32_t last_ack; /* Last sequence number seen in opposite dir */ | 50 | u_int32_t last_ack; /* Last sequence number seen in opposite dir */ |
| 51 | u_int32_t last_end; /* Last seq + len */ | 51 | u_int32_t last_end; /* Last seq + len */ |
| 52 | u_int16_t last_win; /* Last window advertisement seen in dir */ | ||
| 52 | }; | 53 | }; |
| 53 | 54 | ||
| 54 | #endif /* __KERNEL__ */ | 55 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h index 9f5b12cf48..6d8e3e5a80 100644 --- a/include/linux/netfilter/nfnetlink.h +++ b/include/linux/netfilter/nfnetlink.h | |||
| @@ -43,7 +43,7 @@ struct nfattr | |||
| 43 | u_int16_t nfa_len; | 43 | u_int16_t nfa_len; |
| 44 | u_int16_t nfa_type; /* we use 15 bits for the type, and the highest | 44 | u_int16_t nfa_type; /* we use 15 bits for the type, and the highest |
| 45 | * bit to indicate whether the payload is nested */ | 45 | * bit to indicate whether the payload is nested */ |
| 46 | } __attribute__ ((packed)); | 46 | }; |
| 47 | 47 | ||
| 48 | /* FIXME: Apart from NFNL_NFA_NESTED shamelessly copy and pasted from | 48 | /* FIXME: Apart from NFNL_NFA_NESTED shamelessly copy and pasted from |
| 49 | * rtnetlink.h, it's time to put this in a generic file */ | 49 | * rtnetlink.h, it's time to put this in a generic file */ |
| @@ -79,7 +79,7 @@ struct nfgenmsg { | |||
| 79 | u_int8_t nfgen_family; /* AF_xxx */ | 79 | u_int8_t nfgen_family; /* AF_xxx */ |
| 80 | u_int8_t version; /* nfnetlink version */ | 80 | u_int8_t version; /* nfnetlink version */ |
| 81 | u_int16_t res_id; /* resource id */ | 81 | u_int16_t res_id; /* resource id */ |
| 82 | } __attribute__ ((packed)); | 82 | }; |
| 83 | 83 | ||
| 84 | #define NFNETLINK_V0 0 | 84 | #define NFNETLINK_V0 0 |
| 85 | 85 | ||
diff --git a/include/linux/netfilter/nfnetlink_log.h b/include/linux/netfilter/nfnetlink_log.h index a7497c7436..87b92f8b98 100644 --- a/include/linux/netfilter/nfnetlink_log.h +++ b/include/linux/netfilter/nfnetlink_log.h | |||
| @@ -19,18 +19,18 @@ struct nfulnl_msg_packet_hdr { | |||
| 19 | u_int16_t hw_protocol; /* hw protocol (network order) */ | 19 | u_int16_t hw_protocol; /* hw protocol (network order) */ |
| 20 | u_int8_t hook; /* netfilter hook */ | 20 | u_int8_t hook; /* netfilter hook */ |
| 21 | u_int8_t _pad; | 21 | u_int8_t _pad; |
| 22 | } __attribute__ ((packed)); | 22 | }; |
| 23 | 23 | ||
| 24 | struct nfulnl_msg_packet_hw { | 24 | struct nfulnl_msg_packet_hw { |
| 25 | u_int16_t hw_addrlen; | 25 | u_int16_t hw_addrlen; |
| 26 | u_int16_t _pad; | 26 | u_int16_t _pad; |
| 27 | u_int8_t hw_addr[8]; | 27 | u_int8_t hw_addr[8]; |
| 28 | } __attribute__ ((packed)); | 28 | }; |
| 29 | 29 | ||
| 30 | struct nfulnl_msg_packet_timestamp { | 30 | struct nfulnl_msg_packet_timestamp { |
| 31 | aligned_u64 sec; | 31 | aligned_u64 sec; |
| 32 | aligned_u64 usec; | 32 | aligned_u64 usec; |
| 33 | } __attribute__ ((packed)); | 33 | }; |
| 34 | 34 | ||
| 35 | #define NFULNL_PREFIXLEN 30 /* just like old log target */ | 35 | #define NFULNL_PREFIXLEN 30 /* just like old log target */ |
| 36 | 36 | ||
diff --git a/include/linux/netfilter/nfnetlink_queue.h b/include/linux/netfilter/nfnetlink_queue.h index 9e77437324..36af0360b5 100644 --- a/include/linux/netfilter/nfnetlink_queue.h +++ b/include/linux/netfilter/nfnetlink_queue.h | |||
| @@ -22,12 +22,12 @@ struct nfqnl_msg_packet_hw { | |||
| 22 | u_int16_t hw_addrlen; | 22 | u_int16_t hw_addrlen; |
| 23 | u_int16_t _pad; | 23 | u_int16_t _pad; |
| 24 | u_int8_t hw_addr[8]; | 24 | u_int8_t hw_addr[8]; |
| 25 | } __attribute__ ((packed)); | 25 | }; |
| 26 | 26 | ||
| 27 | struct nfqnl_msg_packet_timestamp { | 27 | struct nfqnl_msg_packet_timestamp { |
| 28 | aligned_u64 sec; | 28 | aligned_u64 sec; |
| 29 | aligned_u64 usec; | 29 | aligned_u64 usec; |
| 30 | } __attribute__ ((packed)); | 30 | }; |
| 31 | 31 | ||
| 32 | enum nfqnl_attr_type { | 32 | enum nfqnl_attr_type { |
| 33 | NFQA_UNSPEC, | 33 | NFQA_UNSPEC, |
| @@ -49,7 +49,7 @@ enum nfqnl_attr_type { | |||
| 49 | struct nfqnl_msg_verdict_hdr { | 49 | struct nfqnl_msg_verdict_hdr { |
| 50 | u_int32_t verdict; | 50 | u_int32_t verdict; |
| 51 | u_int32_t id; | 51 | u_int32_t id; |
| 52 | } __attribute__ ((packed)); | 52 | }; |
| 53 | 53 | ||
| 54 | 54 | ||
| 55 | enum nfqnl_msg_config_cmds { | 55 | enum nfqnl_msg_config_cmds { |
| @@ -64,7 +64,7 @@ struct nfqnl_msg_config_cmd { | |||
| 64 | u_int8_t command; /* nfqnl_msg_config_cmds */ | 64 | u_int8_t command; /* nfqnl_msg_config_cmds */ |
| 65 | u_int8_t _pad; | 65 | u_int8_t _pad; |
| 66 | u_int16_t pf; /* AF_xxx for PF_[UN]BIND */ | 66 | u_int16_t pf; /* AF_xxx for PF_[UN]BIND */ |
| 67 | } __attribute__ ((packed)); | 67 | }; |
| 68 | 68 | ||
| 69 | enum nfqnl_config_mode { | 69 | enum nfqnl_config_mode { |
| 70 | NFQNL_COPY_NONE, | 70 | NFQNL_COPY_NONE, |
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h index 48cc32d83f..04319a7610 100644 --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h | |||
| @@ -138,16 +138,6 @@ struct xt_counters_info | |||
| 138 | 138 | ||
| 139 | #include <linux/netdevice.h> | 139 | #include <linux/netdevice.h> |
| 140 | 140 | ||
| 141 | #define ASSERT_READ_LOCK(x) | ||
| 142 | #define ASSERT_WRITE_LOCK(x) | ||
| 143 | #include <linux/netfilter_ipv4/listhelp.h> | ||
| 144 | |||
| 145 | #ifdef CONFIG_COMPAT | ||
| 146 | #define COMPAT_TO_USER 1 | ||
| 147 | #define COMPAT_FROM_USER -1 | ||
| 148 | #define COMPAT_CALC_SIZE 0 | ||
| 149 | #endif | ||
| 150 | |||
| 151 | struct xt_match | 141 | struct xt_match |
| 152 | { | 142 | { |
| 153 | struct list_head list; | 143 | struct list_head list; |
| @@ -174,21 +164,24 @@ struct xt_match | |||
| 174 | const void *ip, | 164 | const void *ip, |
| 175 | const struct xt_match *match, | 165 | const struct xt_match *match, |
| 176 | void *matchinfo, | 166 | void *matchinfo, |
| 177 | unsigned int matchinfosize, | ||
| 178 | unsigned int hook_mask); | 167 | unsigned int hook_mask); |
| 179 | 168 | ||
| 180 | /* Called when entry of this type deleted. */ | 169 | /* Called when entry of this type deleted. */ |
| 181 | void (*destroy)(const struct xt_match *match, void *matchinfo, | 170 | void (*destroy)(const struct xt_match *match, void *matchinfo); |
| 182 | unsigned int matchinfosize); | ||
| 183 | 171 | ||
| 184 | /* Called when userspace align differs from kernel space one */ | 172 | /* Called when userspace align differs from kernel space one */ |
| 185 | int (*compat)(void *match, void **dstptr, int *size, int convert); | 173 | void (*compat_from_user)(void *dst, void *src); |
| 174 | int (*compat_to_user)(void __user *dst, void *src); | ||
| 186 | 175 | ||
| 187 | /* Set this to THIS_MODULE if you are a module, otherwise NULL */ | 176 | /* Set this to THIS_MODULE if you are a module, otherwise NULL */ |
| 188 | struct module *me; | 177 | struct module *me; |
| 189 | 178 | ||
| 179 | /* Free to use by each match */ | ||
| 180 | unsigned long data; | ||
| 181 | |||
| 190 | char *table; | 182 | char *table; |
| 191 | unsigned int matchsize; | 183 | unsigned int matchsize; |
| 184 | unsigned int compatsize; | ||
| 192 | unsigned int hooks; | 185 | unsigned int hooks; |
| 193 | unsigned short proto; | 186 | unsigned short proto; |
| 194 | 187 | ||
| @@ -211,8 +204,7 @@ struct xt_target | |||
| 211 | const struct net_device *out, | 204 | const struct net_device *out, |
| 212 | unsigned int hooknum, | 205 | unsigned int hooknum, |
| 213 | const struct xt_target *target, | 206 | const struct xt_target *target, |
| 214 | const void *targinfo, | 207 | const void *targinfo); |
| 215 | void *userdata); | ||
| 216 | 208 | ||
| 217 | /* Called when user tries to insert an entry of this type: | 209 | /* Called when user tries to insert an entry of this type: |
| 218 | hook_mask is a bitmask of hooks from which it can be | 210 | hook_mask is a bitmask of hooks from which it can be |
| @@ -222,21 +214,21 @@ struct xt_target | |||
| 222 | const void *entry, | 214 | const void *entry, |
| 223 | const struct xt_target *target, | 215 | const struct xt_target *target, |
| 224 | void *targinfo, | 216 | void *targinfo, |
| 225 | unsigned int targinfosize, | ||
| 226 | unsigned int hook_mask); | 217 | unsigned int hook_mask); |
| 227 | 218 | ||
| 228 | /* Called when entry of this type deleted. */ | 219 | /* Called when entry of this type deleted. */ |
| 229 | void (*destroy)(const struct xt_target *target, void *targinfo, | 220 | void (*destroy)(const struct xt_target *target, void *targinfo); |
| 230 | unsigned int targinfosize); | ||
| 231 | 221 | ||
| 232 | /* Called when userspace align differs from kernel space one */ | 222 | /* Called when userspace align differs from kernel space one */ |
| 233 | int (*compat)(void *target, void **dstptr, int *size, int convert); | 223 | void (*compat_from_user)(void *dst, void *src); |
| 224 | int (*compat_to_user)(void __user *dst, void *src); | ||
| 234 | 225 | ||
| 235 | /* Set this to THIS_MODULE if you are a module, otherwise NULL */ | 226 | /* Set this to THIS_MODULE if you are a module, otherwise NULL */ |
| 236 | struct module *me; | 227 | struct module *me; |
| 237 | 228 | ||
| 238 | char *table; | 229 | char *table; |
| 239 | unsigned int targetsize; | 230 | unsigned int targetsize; |
| 231 | unsigned int compatsize; | ||
| 240 | unsigned int hooks; | 232 | unsigned int hooks; |
| 241 | unsigned short proto; | 233 | unsigned short proto; |
| 242 | 234 | ||
| @@ -290,8 +282,13 @@ struct xt_table_info | |||
| 290 | 282 | ||
| 291 | extern int xt_register_target(struct xt_target *target); | 283 | extern int xt_register_target(struct xt_target *target); |
| 292 | extern void xt_unregister_target(struct xt_target *target); | 284 | extern void xt_unregister_target(struct xt_target *target); |
| 285 | extern int xt_register_targets(struct xt_target *target, unsigned int n); | ||
| 286 | extern void xt_unregister_targets(struct xt_target *target, unsigned int n); | ||
| 287 | |||
| 293 | extern int xt_register_match(struct xt_match *target); | 288 | extern int xt_register_match(struct xt_match *target); |
| 294 | extern void xt_unregister_match(struct xt_match *target); | 289 | extern void xt_unregister_match(struct xt_match *target); |
| 290 | extern int xt_register_matches(struct xt_match *match, unsigned int n); | ||
| 291 | extern void xt_unregister_matches(struct xt_match *match, unsigned int n); | ||
| 295 | 292 | ||
| 296 | extern int xt_check_match(const struct xt_match *match, unsigned short family, | 293 | extern int xt_check_match(const struct xt_match *match, unsigned short family, |
| 297 | unsigned int size, const char *table, unsigned int hook, | 294 | unsigned int size, const char *table, unsigned int hook, |
| @@ -388,9 +385,18 @@ struct compat_xt_counters_info | |||
| 388 | 385 | ||
| 389 | extern void xt_compat_lock(int af); | 386 | extern void xt_compat_lock(int af); |
| 390 | extern void xt_compat_unlock(int af); | 387 | extern void xt_compat_unlock(int af); |
| 391 | extern int xt_compat_match(void *match, void **dstptr, int *size, int convert); | 388 | |
| 392 | extern int xt_compat_target(void *target, void **dstptr, int *size, | 389 | extern int xt_compat_match_offset(struct xt_match *match); |
| 393 | int convert); | 390 | extern void xt_compat_match_from_user(struct xt_entry_match *m, |
| 391 | void **dstptr, int *size); | ||
| 392 | extern int xt_compat_match_to_user(struct xt_entry_match *m, | ||
| 393 | void __user **dstptr, int *size); | ||
| 394 | |||
| 395 | extern int xt_compat_target_offset(struct xt_target *target); | ||
| 396 | extern void xt_compat_target_from_user(struct xt_entry_target *t, | ||
| 397 | void **dstptr, int *size); | ||
| 398 | extern int xt_compat_target_to_user(struct xt_entry_target *t, | ||
| 399 | void __user **dstptr, int *size); | ||
| 394 | 400 | ||
| 395 | #endif /* CONFIG_COMPAT */ | 401 | #endif /* CONFIG_COMPAT */ |
| 396 | #endif /* __KERNEL__ */ | 402 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/netfilter/xt_DSCP.h b/include/linux/netfilter/xt_DSCP.h new file mode 100644 index 0000000000..3c7c963997 --- /dev/null +++ b/include/linux/netfilter/xt_DSCP.h | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | /* x_tables module for setting the IPv4/IPv6 DSCP field | ||
| 2 | * | ||
| 3 | * (C) 2002 Harald Welte <laforge@gnumonks.org> | ||
| 4 | * based on ipt_FTOS.c (C) 2000 by Matthew G. Marsh <mgm@paktronix.com> | ||
| 5 | * This software is distributed under GNU GPL v2, 1991 | ||
| 6 | * | ||
| 7 | * See RFC2474 for a description of the DSCP field within the IP Header. | ||
| 8 | * | ||
| 9 | * xt_DSCP.h,v 1.7 2002/03/14 12:03:13 laforge Exp | ||
| 10 | */ | ||
| 11 | #ifndef _XT_DSCP_TARGET_H | ||
| 12 | #define _XT_DSCP_TARGET_H | ||
| 13 | #include <linux/netfilter/xt_dscp.h> | ||
| 14 | |||
| 15 | /* target info */ | ||
| 16 | struct xt_DSCP_info { | ||
| 17 | u_int8_t dscp; | ||
| 18 | }; | ||
| 19 | |||
| 20 | #endif /* _XT_DSCP_TARGET_H */ | ||
diff --git a/include/linux/netfilter/xt_dscp.h b/include/linux/netfilter/xt_dscp.h new file mode 100644 index 0000000000..1da61e6aca --- /dev/null +++ b/include/linux/netfilter/xt_dscp.h | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | /* x_tables module for matching the IPv4/IPv6 DSCP field | ||
| 2 | * | ||
| 3 | * (C) 2002 Harald Welte <laforge@gnumonks.org> | ||
| 4 | * This software is distributed under GNU GPL v2, 1991 | ||
| 5 | * | ||
| 6 | * See RFC2474 for a description of the DSCP field within the IP Header. | ||
| 7 | * | ||
| 8 | * xt_dscp.h,v 1.3 2002/08/05 19:00:21 laforge Exp | ||
| 9 | */ | ||
| 10 | #ifndef _XT_DSCP_H | ||
| 11 | #define _XT_DSCP_H | ||
| 12 | |||
| 13 | #define XT_DSCP_MASK 0xfc /* 11111100 */ | ||
| 14 | #define XT_DSCP_SHIFT 2 | ||
| 15 | #define XT_DSCP_MAX 0x3f /* 00111111 */ | ||
| 16 | |||
| 17 | /* match info */ | ||
| 18 | struct xt_dscp_info { | ||
| 19 | u_int8_t dscp; | ||
| 20 | u_int8_t invert; | ||
| 21 | }; | ||
| 22 | |||
| 23 | #endif /* _XT_DSCP_H */ | ||
diff --git a/include/linux/netfilter_arp/Kbuild b/include/linux/netfilter_arp/Kbuild index 198ec5e7b1..4f13dfcb92 100644 --- a/include/linux/netfilter_arp/Kbuild +++ b/include/linux/netfilter_arp/Kbuild | |||
| @@ -1,2 +1,3 @@ | |||
| 1 | header-y := arpt_mangle.h | 1 | header-y += arpt_mangle.h |
| 2 | unifdef-y := arp_tables.h | 2 | |
| 3 | unifdef-y += arp_tables.h | ||
diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h index 62cc27daca..44e39b61d9 100644 --- a/include/linux/netfilter_arp/arp_tables.h +++ b/include/linux/netfilter_arp/arp_tables.h | |||
| @@ -46,11 +46,11 @@ struct arpt_arp { | |||
| 46 | struct arpt_devaddr_info tgt_devaddr; | 46 | struct arpt_devaddr_info tgt_devaddr; |
| 47 | 47 | ||
| 48 | /* ARP operation code. */ | 48 | /* ARP operation code. */ |
| 49 | u_int16_t arpop, arpop_mask; | 49 | __be16 arpop, arpop_mask; |
| 50 | 50 | ||
| 51 | /* ARP hardware address and protocol address format. */ | 51 | /* ARP hardware address and protocol address format. */ |
| 52 | u_int16_t arhrd, arhrd_mask; | 52 | __be16 arhrd, arhrd_mask; |
| 53 | u_int16_t arpro, arpro_mask; | 53 | __be16 arpro, arpro_mask; |
| 54 | 54 | ||
| 55 | /* The protocol address length is only accepted if it is 4 | 55 | /* The protocol address length is only accepted if it is 4 |
| 56 | * so there is no use in offering a way to do filtering on it. | 56 | * so there is no use in offering a way to do filtering on it. |
| @@ -248,8 +248,7 @@ extern unsigned int arpt_do_table(struct sk_buff **pskb, | |||
| 248 | unsigned int hook, | 248 | unsigned int hook, |
| 249 | const struct net_device *in, | 249 | const struct net_device *in, |
| 250 | const struct net_device *out, | 250 | const struct net_device *out, |
| 251 | struct arpt_table *table, | 251 | struct arpt_table *table); |
| 252 | void *userdata); | ||
| 253 | 252 | ||
| 254 | #define ARPT_ALIGN(s) (((s) + (__alignof__(struct arpt_entry)-1)) & ~(__alignof__(struct arpt_entry)-1)) | 253 | #define ARPT_ALIGN(s) (((s) + (__alignof__(struct arpt_entry)-1)) & ~(__alignof__(struct arpt_entry)-1)) |
| 255 | #endif /*__KERNEL__*/ | 254 | #endif /*__KERNEL__*/ |
diff --git a/include/linux/netfilter_bridge.h b/include/linux/netfilter_bridge.h index 427c67ff89..9a4dd11af8 100644 --- a/include/linux/netfilter_bridge.h +++ b/include/linux/netfilter_bridge.h | |||
| @@ -5,9 +5,8 @@ | |||
| 5 | */ | 5 | */ |
| 6 | 6 | ||
| 7 | #include <linux/netfilter.h> | 7 | #include <linux/netfilter.h> |
| 8 | #if defined(__KERNEL__) && defined(CONFIG_BRIDGE_NETFILTER) | ||
| 9 | #include <linux/if_ether.h> | 8 | #include <linux/if_ether.h> |
| 10 | #endif | 9 | #include <linux/if_vlan.h> |
| 11 | 10 | ||
| 12 | /* Bridge Hooks */ | 11 | /* Bridge Hooks */ |
| 13 | /* After promisc drops, checksum checks. */ | 12 | /* After promisc drops, checksum checks. */ |
| @@ -47,40 +46,20 @@ enum nf_br_hook_priorities { | |||
| 47 | 46 | ||
| 48 | 47 | ||
| 49 | /* Only used in br_forward.c */ | 48 | /* Only used in br_forward.c */ |
| 50 | static inline | 49 | extern int nf_bridge_copy_header(struct sk_buff *skb); |
| 51 | int nf_bridge_maybe_copy_header(struct sk_buff *skb) | 50 | static inline int nf_bridge_maybe_copy_header(struct sk_buff *skb) |
| 52 | { | 51 | { |
| 53 | int err; | 52 | if (skb->nf_bridge) |
| 54 | 53 | return nf_bridge_copy_header(skb); | |
| 55 | if (skb->nf_bridge) { | 54 | return 0; |
| 56 | if (skb->protocol == __constant_htons(ETH_P_8021Q)) { | ||
| 57 | err = skb_cow(skb, 18); | ||
| 58 | if (err) | ||
| 59 | return err; | ||
| 60 | memcpy(skb->data - 18, skb->nf_bridge->data, 18); | ||
| 61 | skb_push(skb, 4); | ||
| 62 | } else { | ||
| 63 | err = skb_cow(skb, 16); | ||
| 64 | if (err) | ||
| 65 | return err; | ||
| 66 | memcpy(skb->data - 16, skb->nf_bridge->data, 16); | ||
| 67 | } | ||
| 68 | } | ||
| 69 | return 0; | ||
| 70 | } | 55 | } |
| 71 | 56 | ||
| 72 | /* This is called by the IP fragmenting code and it ensures there is | 57 | /* This is called by the IP fragmenting code and it ensures there is |
| 73 | * enough room for the encapsulating header (if there is one). */ | 58 | * enough room for the encapsulating header (if there is one). */ |
| 74 | static inline | 59 | static inline int nf_bridge_pad(const struct sk_buff *skb) |
| 75 | int nf_bridge_pad(struct sk_buff *skb) | ||
| 76 | { | 60 | { |
| 77 | if (skb->protocol == __constant_htons(ETH_P_IP)) | 61 | return (skb->nf_bridge && skb->protocol == htons(ETH_P_8021Q)) |
| 78 | return 0; | 62 | ? VLAN_HLEN : 0; |
| 79 | if (skb->nf_bridge) { | ||
| 80 | if (skb->protocol == __constant_htons(ETH_P_8021Q)) | ||
| 81 | return 4; | ||
| 82 | } | ||
| 83 | return 0; | ||
| 84 | } | 63 | } |
| 85 | 64 | ||
| 86 | struct bridge_skb_cb { | 65 | struct bridge_skb_cb { |
| @@ -90,6 +69,9 @@ struct bridge_skb_cb { | |||
| 90 | }; | 69 | }; |
| 91 | 70 | ||
| 92 | extern int brnf_deferred_hooks; | 71 | extern int brnf_deferred_hooks; |
| 72 | #else | ||
| 73 | #define nf_bridge_maybe_copy_header(skb) (0) | ||
| 74 | #define nf_bridge_pad(skb) (0) | ||
| 93 | #endif /* CONFIG_BRIDGE_NETFILTER */ | 75 | #endif /* CONFIG_BRIDGE_NETFILTER */ |
| 94 | 76 | ||
| 95 | #endif /* __KERNEL__ */ | 77 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/netfilter_bridge/Kbuild b/include/linux/netfilter_bridge/Kbuild index 5b1aba6abb..76ff4c47d8 100644 --- a/include/linux/netfilter_bridge/Kbuild +++ b/include/linux/netfilter_bridge/Kbuild | |||
| @@ -1,4 +1,17 @@ | |||
| 1 | header-y += ebt_among.h ebt_arp.h ebt_arpreply.h ebt_ip.h ebt_limit.h \ | 1 | header-y += ebt_among.h |
| 2 | ebt_log.h ebt_mark_m.h ebt_mark_t.h ebt_nat.h ebt_pkttype.h \ | 2 | header-y += ebt_arp.h |
| 3 | ebt_redirect.h ebt_stp.h ebt_ulog.h ebt_vlan.h | 3 | header-y += ebt_arpreply.h |
| 4 | unifdef-y := ebtables.h ebt_802_3.h | 4 | header-y += ebt_ip.h |
| 5 | header-y += ebt_limit.h | ||
| 6 | header-y += ebt_log.h | ||
| 7 | header-y += ebt_mark_m.h | ||
| 8 | header-y += ebt_mark_t.h | ||
| 9 | header-y += ebt_nat.h | ||
| 10 | header-y += ebt_pkttype.h | ||
| 11 | header-y += ebt_redirect.h | ||
| 12 | header-y += ebt_stp.h | ||
| 13 | header-y += ebt_ulog.h | ||
| 14 | header-y += ebt_vlan.h | ||
| 15 | |||
| 16 | unifdef-y += ebtables.h | ||
| 17 | unifdef-y += ebt_802_3.h | ||
diff --git a/include/linux/netfilter_ipv4/Kbuild b/include/linux/netfilter_ipv4/Kbuild index 04e4d27216..591c1a809c 100644 --- a/include/linux/netfilter_ipv4/Kbuild +++ b/include/linux/netfilter_ipv4/Kbuild | |||
| @@ -1,21 +1,63 @@ | |||
| 1 | header-y += ip_conntrack_helper.h | ||
| 2 | header-y += ip_conntrack_helper_h323_asn1.h | ||
| 3 | header-y += ip_conntrack_helper_h323_types.h | ||
| 4 | header-y += ip_conntrack_protocol.h | ||
| 5 | header-y += ip_conntrack_sctp.h | ||
| 6 | header-y += ip_conntrack_tcp.h | ||
| 7 | header-y += ip_conntrack_tftp.h | ||
| 8 | header-y += ip_nat_pptp.h | ||
| 9 | header-y += ipt_addrtype.h | ||
| 10 | header-y += ipt_ah.h | ||
| 11 | header-y += ipt_CLASSIFY.h | ||
| 12 | header-y += ipt_CLUSTERIP.h | ||
| 13 | header-y += ipt_comment.h | ||
| 14 | header-y += ipt_connbytes.h | ||
| 15 | header-y += ipt_connmark.h | ||
| 16 | header-y += ipt_CONNMARK.h | ||
| 17 | header-y += ipt_conntrack.h | ||
| 18 | header-y += ipt_dccp.h | ||
| 19 | header-y += ipt_dscp.h | ||
| 20 | header-y += ipt_DSCP.h | ||
| 21 | header-y += ipt_ecn.h | ||
| 22 | header-y += ipt_ECN.h | ||
| 23 | header-y += ipt_esp.h | ||
| 24 | header-y += ipt_hashlimit.h | ||
| 25 | header-y += ipt_helper.h | ||
| 26 | header-y += ipt_iprange.h | ||
| 27 | header-y += ipt_length.h | ||
| 28 | header-y += ipt_limit.h | ||
| 29 | header-y += ipt_LOG.h | ||
| 30 | header-y += ipt_mac.h | ||
| 31 | header-y += ipt_mark.h | ||
| 32 | header-y += ipt_MARK.h | ||
| 33 | header-y += ipt_multiport.h | ||
| 34 | header-y += ipt_NFQUEUE.h | ||
| 35 | header-y += ipt_owner.h | ||
| 36 | header-y += ipt_physdev.h | ||
| 37 | header-y += ipt_pkttype.h | ||
| 38 | header-y += ipt_policy.h | ||
| 39 | header-y += ipt_realm.h | ||
| 40 | header-y += ipt_recent.h | ||
| 41 | header-y += ipt_REJECT.h | ||
| 42 | header-y += ipt_SAME.h | ||
| 43 | header-y += ipt_sctp.h | ||
| 44 | header-y += ipt_state.h | ||
| 45 | header-y += ipt_string.h | ||
| 46 | header-y += ipt_tcpmss.h | ||
| 47 | header-y += ipt_TCPMSS.h | ||
| 48 | header-y += ipt_tos.h | ||
| 49 | header-y += ipt_TOS.h | ||
| 50 | header-y += ipt_ttl.h | ||
| 51 | header-y += ipt_TTL.h | ||
| 52 | header-y += ipt_ULOG.h | ||
| 1 | 53 | ||
| 2 | header-y := ip_conntrack_helper.h ip_conntrack_helper_h323_asn1.h \ | 54 | unifdef-y += ip_conntrack.h |
| 3 | ip_conntrack_helper_h323_types.h ip_conntrack_protocol.h \ | 55 | unifdef-y += ip_conntrack_h323.h |
| 4 | ip_conntrack_sctp.h ip_conntrack_tcp.h ip_conntrack_tftp.h \ | 56 | unifdef-y += ip_conntrack_irc.h |
| 5 | ip_nat_pptp.h ipt_addrtype.h ipt_ah.h \ | 57 | unifdef-y += ip_conntrack_pptp.h |
| 6 | ipt_CLASSIFY.h ipt_CLUSTERIP.h ipt_comment.h \ | 58 | unifdef-y += ip_conntrack_proto_gre.h |
| 7 | ipt_connbytes.h ipt_connmark.h ipt_CONNMARK.h \ | 59 | unifdef-y += ip_conntrack_tuple.h |
| 8 | ipt_conntrack.h ipt_dccp.h ipt_dscp.h ipt_DSCP.h ipt_ecn.h \ | 60 | unifdef-y += ip_nat.h |
| 9 | ipt_ECN.h ipt_esp.h ipt_hashlimit.h ipt_helper.h \ | 61 | unifdef-y += ip_nat_rule.h |
| 10 | ipt_iprange.h ipt_length.h ipt_limit.h ipt_LOG.h ipt_mac.h \ | 62 | unifdef-y += ip_queue.h |
| 11 | ipt_mark.h ipt_MARK.h ipt_multiport.h ipt_NFQUEUE.h \ | 63 | unifdef-y += ip_tables.h |
| 12 | ipt_owner.h ipt_physdev.h ipt_pkttype.h ipt_policy.h \ | ||
| 13 | ipt_realm.h ipt_recent.h ipt_REJECT.h ipt_SAME.h \ | ||
| 14 | ipt_sctp.h ipt_state.h ipt_string.h ipt_tcpmss.h \ | ||
| 15 | ipt_TCPMSS.h ipt_tos.h ipt_TOS.h ipt_ttl.h ipt_TTL.h \ | ||
| 16 | ipt_ULOG.h | ||
| 17 | |||
| 18 | unifdef-y := ip_conntrack.h ip_conntrack_h323.h ip_conntrack_irc.h \ | ||
| 19 | ip_conntrack_pptp.h ip_conntrack_proto_gre.h \ | ||
| 20 | ip_conntrack_tuple.h ip_nat.h ip_nat_rule.h ip_queue.h \ | ||
| 21 | ip_tables.h | ||
diff --git a/include/linux/netfilter_ipv4/ip_conntrack.h b/include/linux/netfilter_ipv4/ip_conntrack.h index 51dbec1892..64e868034c 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack.h +++ b/include/linux/netfilter_ipv4/ip_conntrack.h | |||
| @@ -157,7 +157,7 @@ struct ip_conntrack_expect | |||
| 157 | unsigned int flags; | 157 | unsigned int flags; |
| 158 | 158 | ||
| 159 | #ifdef CONFIG_IP_NF_NAT_NEEDED | 159 | #ifdef CONFIG_IP_NF_NAT_NEEDED |
| 160 | u_int32_t saved_ip; | 160 | __be32 saved_ip; |
| 161 | /* This is the original per-proto part, used to map the | 161 | /* This is the original per-proto part, used to map the |
| 162 | * expected connection the way the recipient expects. */ | 162 | * expected connection the way the recipient expects. */ |
| 163 | union ip_conntrack_manip_proto saved_proto; | 163 | union ip_conntrack_manip_proto saved_proto; |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_h323.h b/include/linux/netfilter_ipv4/ip_conntrack_h323.h index 3cbff73790..943cc6a487 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_h323.h +++ b/include/linux/netfilter_ipv4/ip_conntrack_h323.h | |||
| @@ -30,7 +30,7 @@ struct ip_ct_h323_master { | |||
| 30 | struct ip_conntrack_expect; | 30 | struct ip_conntrack_expect; |
| 31 | 31 | ||
| 32 | extern int get_h225_addr(unsigned char *data, TransportAddress * addr, | 32 | extern int get_h225_addr(unsigned char *data, TransportAddress * addr, |
| 33 | u_int32_t * ip, u_int16_t * port); | 33 | __be32 * ip, u_int16_t * port); |
| 34 | extern void ip_conntrack_h245_expect(struct ip_conntrack *new, | 34 | extern void ip_conntrack_h245_expect(struct ip_conntrack *new, |
| 35 | struct ip_conntrack_expect *this); | 35 | struct ip_conntrack_expect *this); |
| 36 | extern void ip_conntrack_q931_expect(struct ip_conntrack *new, | 36 | extern void ip_conntrack_q931_expect(struct ip_conntrack *new, |
| @@ -38,11 +38,11 @@ extern void ip_conntrack_q931_expect(struct ip_conntrack *new, | |||
| 38 | extern int (*set_h245_addr_hook) (struct sk_buff ** pskb, | 38 | extern int (*set_h245_addr_hook) (struct sk_buff ** pskb, |
| 39 | unsigned char **data, int dataoff, | 39 | unsigned char **data, int dataoff, |
| 40 | H245_TransportAddress * addr, | 40 | H245_TransportAddress * addr, |
| 41 | u_int32_t ip, u_int16_t port); | 41 | __be32 ip, u_int16_t port); |
| 42 | extern int (*set_h225_addr_hook) (struct sk_buff ** pskb, | 42 | extern int (*set_h225_addr_hook) (struct sk_buff ** pskb, |
| 43 | unsigned char **data, int dataoff, | 43 | unsigned char **data, int dataoff, |
| 44 | TransportAddress * addr, | 44 | TransportAddress * addr, |
| 45 | u_int32_t ip, u_int16_t port); | 45 | __be32 ip, u_int16_t port); |
| 46 | extern int (*set_sig_addr_hook) (struct sk_buff ** pskb, | 46 | extern int (*set_sig_addr_hook) (struct sk_buff ** pskb, |
| 47 | struct ip_conntrack * ct, | 47 | struct ip_conntrack * ct, |
| 48 | enum ip_conntrack_info ctinfo, | 48 | enum ip_conntrack_info ctinfo, |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_helper.h b/include/linux/netfilter_ipv4/ip_conntrack_helper.h index 8d69279ccf..77fe868d36 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_helper.h +++ b/include/linux/netfilter_ipv4/ip_conntrack_helper.h | |||
| @@ -25,6 +25,8 @@ struct ip_conntrack_helper | |||
| 25 | struct ip_conntrack *ct, | 25 | struct ip_conntrack *ct, |
| 26 | enum ip_conntrack_info conntrackinfo); | 26 | enum ip_conntrack_info conntrackinfo); |
| 27 | 27 | ||
| 28 | void (*destroy)(struct ip_conntrack *ct); | ||
| 29 | |||
| 28 | int (*to_nfattr)(struct sk_buff *skb, const struct ip_conntrack *ct); | 30 | int (*to_nfattr)(struct sk_buff *skb, const struct ip_conntrack *ct); |
| 29 | }; | 31 | }; |
| 30 | 32 | ||
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_pptp.h b/include/linux/netfilter_ipv4/ip_conntrack_pptp.h index 816144c75d..2644b1fadd 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_pptp.h +++ b/include/linux/netfilter_ipv4/ip_conntrack_pptp.h | |||
| @@ -31,8 +31,8 @@ struct ip_ct_pptp_master { | |||
| 31 | /* everything below is going to be per-expectation in newnat, | 31 | /* everything below is going to be per-expectation in newnat, |
| 32 | * since there could be more than one call within one session */ | 32 | * since there could be more than one call within one session */ |
| 33 | enum pptp_ctrlcall_state cstate; /* call state */ | 33 | enum pptp_ctrlcall_state cstate; /* call state */ |
| 34 | u_int16_t pac_call_id; /* call id of PAC, host byte order */ | 34 | __be16 pac_call_id; /* call id of PAC, host byte order */ |
| 35 | u_int16_t pns_call_id; /* call id of PNS, host byte order */ | 35 | __be16 pns_call_id; /* call id of PNS, host byte order */ |
| 36 | 36 | ||
| 37 | /* in pre-2.6.11 this used to be per-expect. Now it is per-conntrack | 37 | /* in pre-2.6.11 this used to be per-expect. Now it is per-conntrack |
| 38 | * and therefore imposes a fixed limit on the number of maps */ | 38 | * and therefore imposes a fixed limit on the number of maps */ |
| @@ -42,8 +42,8 @@ struct ip_ct_pptp_master { | |||
| 42 | /* conntrack_expect private member */ | 42 | /* conntrack_expect private member */ |
| 43 | struct ip_ct_pptp_expect { | 43 | struct ip_ct_pptp_expect { |
| 44 | enum pptp_ctrlcall_state cstate; /* call state */ | 44 | enum pptp_ctrlcall_state cstate; /* call state */ |
| 45 | u_int16_t pac_call_id; /* call id of PAC */ | 45 | __be16 pac_call_id; /* call id of PAC */ |
| 46 | u_int16_t pns_call_id; /* call id of PNS */ | 46 | __be16 pns_call_id; /* call id of PNS */ |
| 47 | }; | 47 | }; |
| 48 | 48 | ||
| 49 | 49 | ||
| @@ -107,8 +107,7 @@ struct PptpControlHeader { | |||
| 107 | 107 | ||
| 108 | struct PptpStartSessionRequest { | 108 | struct PptpStartSessionRequest { |
| 109 | __be16 protocolVersion; | 109 | __be16 protocolVersion; |
| 110 | __u8 reserved1; | 110 | __u16 reserved1; |
| 111 | __u8 reserved2; | ||
| 112 | __be32 framingCapability; | 111 | __be32 framingCapability; |
| 113 | __be32 bearerCapability; | 112 | __be32 bearerCapability; |
| 114 | __be16 maxChannels; | 113 | __be16 maxChannels; |
| @@ -143,6 +142,8 @@ struct PptpStartSessionReply { | |||
| 143 | 142 | ||
| 144 | struct PptpStopSessionRequest { | 143 | struct PptpStopSessionRequest { |
| 145 | __u8 reason; | 144 | __u8 reason; |
| 145 | __u8 reserved1; | ||
| 146 | __u16 reserved2; | ||
| 146 | }; | 147 | }; |
| 147 | 148 | ||
| 148 | /* PptpStopSessionResultCode */ | 149 | /* PptpStopSessionResultCode */ |
| @@ -152,6 +153,7 @@ struct PptpStopSessionRequest { | |||
| 152 | struct PptpStopSessionReply { | 153 | struct PptpStopSessionReply { |
| 153 | __u8 resultCode; | 154 | __u8 resultCode; |
| 154 | __u8 generalErrorCode; | 155 | __u8 generalErrorCode; |
| 156 | __u16 reserved1; | ||
| 155 | }; | 157 | }; |
| 156 | 158 | ||
| 157 | struct PptpEchoRequest { | 159 | struct PptpEchoRequest { |
| @@ -188,9 +190,8 @@ struct PptpOutCallRequest { | |||
| 188 | __be32 framingType; | 190 | __be32 framingType; |
| 189 | __be16 packetWindow; | 191 | __be16 packetWindow; |
| 190 | __be16 packetProcDelay; | 192 | __be16 packetProcDelay; |
| 191 | __u16 reserved1; | ||
| 192 | __be16 phoneNumberLength; | 193 | __be16 phoneNumberLength; |
| 193 | __u16 reserved2; | 194 | __u16 reserved1; |
| 194 | __u8 phoneNumber[64]; | 195 | __u8 phoneNumber[64]; |
| 195 | __u8 subAddress[64]; | 196 | __u8 subAddress[64]; |
| 196 | }; | 197 | }; |
| @@ -285,19 +286,19 @@ struct PptpSetLinkInfo { | |||
| 285 | }; | 286 | }; |
| 286 | 287 | ||
| 287 | union pptp_ctrl_union { | 288 | union pptp_ctrl_union { |
| 288 | struct PptpStartSessionRequest sreq; | 289 | struct PptpStartSessionRequest sreq; |
| 289 | struct PptpStartSessionReply srep; | 290 | struct PptpStartSessionReply srep; |
| 290 | struct PptpStopSessionRequest streq; | 291 | struct PptpStopSessionRequest streq; |
| 291 | struct PptpStopSessionReply strep; | 292 | struct PptpStopSessionReply strep; |
| 292 | struct PptpOutCallRequest ocreq; | 293 | struct PptpOutCallRequest ocreq; |
| 293 | struct PptpOutCallReply ocack; | 294 | struct PptpOutCallReply ocack; |
| 294 | struct PptpInCallRequest icreq; | 295 | struct PptpInCallRequest icreq; |
| 295 | struct PptpInCallReply icack; | 296 | struct PptpInCallReply icack; |
| 296 | struct PptpInCallConnected iccon; | 297 | struct PptpInCallConnected iccon; |
| 297 | struct PptpClearCallRequest clrreq; | 298 | struct PptpClearCallRequest clrreq; |
| 298 | struct PptpCallDisconnectNotify disc; | 299 | struct PptpCallDisconnectNotify disc; |
| 299 | struct PptpWanErrorNotify wanerr; | 300 | struct PptpWanErrorNotify wanerr; |
| 300 | struct PptpSetLinkInfo setlink; | 301 | struct PptpSetLinkInfo setlink; |
| 301 | }; | 302 | }; |
| 302 | 303 | ||
| 303 | extern int | 304 | extern int |
| @@ -314,7 +315,7 @@ extern int | |||
| 314 | struct PptpControlHeader *ctlh, | 315 | struct PptpControlHeader *ctlh, |
| 315 | union pptp_ctrl_union *pptpReq); | 316 | union pptp_ctrl_union *pptpReq); |
| 316 | 317 | ||
| 317 | extern int | 318 | extern void |
| 318 | (*ip_nat_pptp_hook_exp_gre)(struct ip_conntrack_expect *exp_orig, | 319 | (*ip_nat_pptp_hook_exp_gre)(struct ip_conntrack_expect *exp_orig, |
| 319 | struct ip_conntrack_expect *exp_reply); | 320 | struct ip_conntrack_expect *exp_reply); |
| 320 | 321 | ||
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h b/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h index 8d090ef82f..1d853aa873 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h +++ b/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h | |||
| @@ -49,18 +49,18 @@ struct gre_hdr { | |||
| 49 | #else | 49 | #else |
| 50 | #error "Adjust your <asm/byteorder.h> defines" | 50 | #error "Adjust your <asm/byteorder.h> defines" |
| 51 | #endif | 51 | #endif |
| 52 | __u16 protocol; | 52 | __be16 protocol; |
| 53 | }; | 53 | }; |
| 54 | 54 | ||
| 55 | /* modified GRE header for PPTP */ | 55 | /* modified GRE header for PPTP */ |
| 56 | struct gre_hdr_pptp { | 56 | struct gre_hdr_pptp { |
| 57 | __u8 flags; /* bitfield */ | 57 | __u8 flags; /* bitfield */ |
| 58 | __u8 version; /* should be GRE_VERSION_PPTP */ | 58 | __u8 version; /* should be GRE_VERSION_PPTP */ |
| 59 | __u16 protocol; /* should be GRE_PROTOCOL_PPTP */ | 59 | __be16 protocol; /* should be GRE_PROTOCOL_PPTP */ |
| 60 | __u16 payload_len; /* size of ppp payload, not inc. gre header */ | 60 | __be16 payload_len; /* size of ppp payload, not inc. gre header */ |
| 61 | __u16 call_id; /* peer's call_id for this session */ | 61 | __be16 call_id; /* peer's call_id for this session */ |
| 62 | __u32 seq; /* sequence number. Present if S==1 */ | 62 | __be32 seq; /* sequence number. Present if S==1 */ |
| 63 | __u32 ack; /* seq number of highest packet recieved by */ | 63 | __be32 ack; /* seq number of highest packet recieved by */ |
| 64 | /* sender in this session */ | 64 | /* sender in this session */ |
| 65 | }; | 65 | }; |
| 66 | 66 | ||
| @@ -92,13 +92,13 @@ void ip_ct_gre_keymap_destroy(struct ip_conntrack *ct); | |||
| 92 | 92 | ||
| 93 | 93 | ||
| 94 | /* get pointer to gre key, if present */ | 94 | /* get pointer to gre key, if present */ |
| 95 | static inline u_int32_t *gre_key(struct gre_hdr *greh) | 95 | static inline __be32 *gre_key(struct gre_hdr *greh) |
| 96 | { | 96 | { |
| 97 | if (!greh->key) | 97 | if (!greh->key) |
| 98 | return NULL; | 98 | return NULL; |
| 99 | if (greh->csum || greh->routing) | 99 | if (greh->csum || greh->routing) |
| 100 | return (u_int32_t *) (greh+sizeof(*greh)+4); | 100 | return (__be32 *) (greh+sizeof(*greh)+4); |
| 101 | return (u_int32_t *) (greh+sizeof(*greh)); | 101 | return (__be32 *) (greh+sizeof(*greh)); |
| 102 | } | 102 | } |
| 103 | 103 | ||
| 104 | /* get pointer ot gre csum, if present */ | 104 | /* get pointer ot gre csum, if present */ |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_tuple.h b/include/linux/netfilter_ipv4/ip_conntrack_tuple.h index 2fdabdb4c0..c228bde74c 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_tuple.h +++ b/include/linux/netfilter_ipv4/ip_conntrack_tuple.h | |||
| @@ -23,13 +23,13 @@ union ip_conntrack_manip_proto | |||
| 23 | __be16 port; | 23 | __be16 port; |
| 24 | } tcp; | 24 | } tcp; |
| 25 | struct { | 25 | struct { |
| 26 | u_int16_t port; | 26 | __be16 port; |
| 27 | } udp; | 27 | } udp; |
| 28 | struct { | 28 | struct { |
| 29 | u_int16_t id; | 29 | __be16 id; |
| 30 | } icmp; | 30 | } icmp; |
| 31 | struct { | 31 | struct { |
| 32 | u_int16_t port; | 32 | __be16 port; |
| 33 | } sctp; | 33 | } sctp; |
| 34 | struct { | 34 | struct { |
| 35 | __be16 key; /* key is 32bit, pptp only uses 16 */ | 35 | __be16 key; /* key is 32bit, pptp only uses 16 */ |
| @@ -39,7 +39,7 @@ union ip_conntrack_manip_proto | |||
| 39 | /* The manipulable part of the tuple. */ | 39 | /* The manipulable part of the tuple. */ |
| 40 | struct ip_conntrack_manip | 40 | struct ip_conntrack_manip |
| 41 | { | 41 | { |
| 42 | u_int32_t ip; | 42 | __be32 ip; |
| 43 | union ip_conntrack_manip_proto u; | 43 | union ip_conntrack_manip_proto u; |
| 44 | }; | 44 | }; |
| 45 | 45 | ||
| @@ -50,22 +50,22 @@ struct ip_conntrack_tuple | |||
| 50 | 50 | ||
| 51 | /* These are the parts of the tuple which are fixed. */ | 51 | /* These are the parts of the tuple which are fixed. */ |
| 52 | struct { | 52 | struct { |
| 53 | u_int32_t ip; | 53 | __be32 ip; |
| 54 | union { | 54 | union { |
| 55 | /* Add other protocols here. */ | 55 | /* Add other protocols here. */ |
| 56 | u_int16_t all; | 56 | u_int16_t all; |
| 57 | 57 | ||
| 58 | struct { | 58 | struct { |
| 59 | u_int16_t port; | 59 | __be16 port; |
| 60 | } tcp; | 60 | } tcp; |
| 61 | struct { | 61 | struct { |
| 62 | u_int16_t port; | 62 | __be16 port; |
| 63 | } udp; | 63 | } udp; |
| 64 | struct { | 64 | struct { |
| 65 | u_int8_t type, code; | 65 | u_int8_t type, code; |
| 66 | } icmp; | 66 | } icmp; |
| 67 | struct { | 67 | struct { |
| 68 | u_int16_t port; | 68 | __be16 port; |
| 69 | } sctp; | 69 | } sctp; |
| 70 | struct { | 70 | struct { |
| 71 | __be16 key; /* key is 32bit, | 71 | __be16 key; /* key is 32bit, |
diff --git a/include/linux/netfilter_ipv4/ip_nat.h b/include/linux/netfilter_ipv4/ip_nat.h index e9f5ed1d9f..bdf553620c 100644 --- a/include/linux/netfilter_ipv4/ip_nat.h +++ b/include/linux/netfilter_ipv4/ip_nat.h | |||
| @@ -33,7 +33,7 @@ struct ip_nat_range | |||
| 33 | unsigned int flags; | 33 | unsigned int flags; |
| 34 | 34 | ||
| 35 | /* Inclusive: network order. */ | 35 | /* Inclusive: network order. */ |
| 36 | u_int32_t min_ip, max_ip; | 36 | __be32 min_ip, max_ip; |
| 37 | 37 | ||
| 38 | /* Inclusive: network order */ | 38 | /* Inclusive: network order */ |
| 39 | union ip_conntrack_manip_proto min, max; | 39 | union ip_conntrack_manip_proto min, max; |
| @@ -72,10 +72,6 @@ extern unsigned int ip_nat_setup_info(struct ip_conntrack *conntrack, | |||
| 72 | extern int ip_nat_used_tuple(const struct ip_conntrack_tuple *tuple, | 72 | extern int ip_nat_used_tuple(const struct ip_conntrack_tuple *tuple, |
| 73 | const struct ip_conntrack *ignored_conntrack); | 73 | const struct ip_conntrack *ignored_conntrack); |
| 74 | 74 | ||
| 75 | /* Calculate relative checksum. */ | ||
| 76 | extern u_int16_t ip_nat_cheat_check(u_int32_t oldvalinv, | ||
| 77 | u_int32_t newval, | ||
| 78 | u_int16_t oldcheck); | ||
| 79 | #else /* !__KERNEL__: iptables wants this to compile. */ | 75 | #else /* !__KERNEL__: iptables wants this to compile. */ |
| 80 | #define ip_nat_multi_range ip_nat_multi_range_compat | 76 | #define ip_nat_multi_range ip_nat_multi_range_compat |
| 81 | #endif /*__KERNEL__*/ | 77 | #endif /*__KERNEL__*/ |
diff --git a/include/linux/netfilter_ipv4/ip_nat_core.h b/include/linux/netfilter_ipv4/ip_nat_core.h index 30db23f06b..60566f9fd7 100644 --- a/include/linux/netfilter_ipv4/ip_nat_core.h +++ b/include/linux/netfilter_ipv4/ip_nat_core.h | |||
| @@ -11,8 +11,8 @@ extern unsigned int ip_nat_packet(struct ip_conntrack *ct, | |||
| 11 | unsigned int hooknum, | 11 | unsigned int hooknum, |
| 12 | struct sk_buff **pskb); | 12 | struct sk_buff **pskb); |
| 13 | 13 | ||
| 14 | extern int ip_nat_icmp_reply_translation(struct sk_buff **pskb, | 14 | extern int ip_nat_icmp_reply_translation(struct ip_conntrack *ct, |
| 15 | struct ip_conntrack *ct, | 15 | enum ip_conntrack_info ctinfo, |
| 16 | enum ip_nat_manip_type manip, | 16 | unsigned int hooknum, |
| 17 | enum ip_conntrack_dir dir); | 17 | struct sk_buff **pskb); |
| 18 | #endif /* _IP_NAT_CORE_H */ | 18 | #endif /* _IP_NAT_CORE_H */ |
diff --git a/include/linux/netfilter_ipv4/ip_nat_pptp.h b/include/linux/netfilter_ipv4/ip_nat_pptp.h index eaf66c2e8f..36668bf0f3 100644 --- a/include/linux/netfilter_ipv4/ip_nat_pptp.h +++ b/include/linux/netfilter_ipv4/ip_nat_pptp.h | |||
| @@ -4,8 +4,8 @@ | |||
| 4 | 4 | ||
| 5 | /* conntrack private data */ | 5 | /* conntrack private data */ |
| 6 | struct ip_nat_pptp { | 6 | struct ip_nat_pptp { |
| 7 | u_int16_t pns_call_id; /* NAT'ed PNS call id */ | 7 | __be16 pns_call_id; /* NAT'ed PNS call id */ |
| 8 | u_int16_t pac_call_id; /* NAT'ed PAC call id */ | 8 | __be16 pac_call_id; /* NAT'ed PAC call id */ |
| 9 | }; | 9 | }; |
| 10 | 10 | ||
| 11 | #endif /* _NAT_PPTP_H */ | 11 | #endif /* _NAT_PPTP_H */ |
diff --git a/include/linux/netfilter_ipv4/ip_queue.h b/include/linux/netfilter_ipv4/ip_queue.h index aa08d68c48..a03507f465 100644 --- a/include/linux/netfilter_ipv4/ip_queue.h +++ b/include/linux/netfilter_ipv4/ip_queue.h | |||
| @@ -26,7 +26,7 @@ typedef struct ipq_packet_msg { | |||
| 26 | unsigned int hook; /* Netfilter hook we rode in on */ | 26 | unsigned int hook; /* Netfilter hook we rode in on */ |
| 27 | char indev_name[IFNAMSIZ]; /* Name of incoming interface */ | 27 | char indev_name[IFNAMSIZ]; /* Name of incoming interface */ |
| 28 | char outdev_name[IFNAMSIZ]; /* Name of outgoing interface */ | 28 | char outdev_name[IFNAMSIZ]; /* Name of outgoing interface */ |
| 29 | unsigned short hw_protocol; /* Hardware protocol (network order) */ | 29 | __be16 hw_protocol; /* Hardware protocol (network order) */ |
| 30 | unsigned short hw_type; /* Hardware type */ | 30 | unsigned short hw_type; /* Hardware type */ |
| 31 | unsigned char hw_addrlen; /* Hardware address length */ | 31 | unsigned char hw_addrlen; /* Hardware address length */ |
| 32 | unsigned char hw_addr[8]; /* Hardware address */ | 32 | unsigned char hw_addr[8]; /* Hardware address */ |
diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h index c0dac16e19..a536bbdef1 100644 --- a/include/linux/netfilter_ipv4/ip_tables.h +++ b/include/linux/netfilter_ipv4/ip_tables.h | |||
| @@ -312,8 +312,7 @@ extern unsigned int ipt_do_table(struct sk_buff **pskb, | |||
| 312 | unsigned int hook, | 312 | unsigned int hook, |
| 313 | const struct net_device *in, | 313 | const struct net_device *in, |
| 314 | const struct net_device *out, | 314 | const struct net_device *out, |
| 315 | struct ipt_table *table, | 315 | struct ipt_table *table); |
| 316 | void *userdata); | ||
| 317 | 316 | ||
| 318 | #define IPT_ALIGN(s) XT_ALIGN(s) | 317 | #define IPT_ALIGN(s) XT_ALIGN(s) |
| 319 | 318 | ||
diff --git a/include/linux/netfilter_ipv4/ipt_DSCP.h b/include/linux/netfilter_ipv4/ipt_DSCP.h index b30f510b5b..3491e524d5 100644 --- a/include/linux/netfilter_ipv4/ipt_DSCP.h +++ b/include/linux/netfilter_ipv4/ipt_DSCP.h | |||
| @@ -11,10 +11,8 @@ | |||
| 11 | #ifndef _IPT_DSCP_TARGET_H | 11 | #ifndef _IPT_DSCP_TARGET_H |
| 12 | #define _IPT_DSCP_TARGET_H | 12 | #define _IPT_DSCP_TARGET_H |
| 13 | #include <linux/netfilter_ipv4/ipt_dscp.h> | 13 | #include <linux/netfilter_ipv4/ipt_dscp.h> |
| 14 | #include <linux/netfilter/xt_DSCP.h> | ||
| 14 | 15 | ||
| 15 | /* target info */ | 16 | #define ipt_DSCP_info xt_DSCP_info |
| 16 | struct ipt_DSCP_info { | ||
| 17 | u_int8_t dscp; | ||
| 18 | }; | ||
| 19 | 17 | ||
| 20 | #endif /* _IPT_DSCP_TARGET_H */ | 18 | #endif /* _IPT_DSCP_TARGET_H */ |
diff --git a/include/linux/netfilter_ipv4/ipt_dscp.h b/include/linux/netfilter_ipv4/ipt_dscp.h index 2fa6dfe928..4b82ca912b 100644 --- a/include/linux/netfilter_ipv4/ipt_dscp.h +++ b/include/linux/netfilter_ipv4/ipt_dscp.h | |||
| @@ -10,14 +10,12 @@ | |||
| 10 | #ifndef _IPT_DSCP_H | 10 | #ifndef _IPT_DSCP_H |
| 11 | #define _IPT_DSCP_H | 11 | #define _IPT_DSCP_H |
| 12 | 12 | ||
| 13 | #define IPT_DSCP_MASK 0xfc /* 11111100 */ | 13 | #include <linux/netfilter/xt_dscp.h> |
| 14 | #define IPT_DSCP_SHIFT 2 | ||
| 15 | #define IPT_DSCP_MAX 0x3f /* 00111111 */ | ||
| 16 | 14 | ||
| 17 | /* match info */ | 15 | #define IPT_DSCP_MASK XT_DSCP_MASK |
| 18 | struct ipt_dscp_info { | 16 | #define IPT_DSCP_SHIFT XT_DSCP_SHIFT |
| 19 | u_int8_t dscp; | 17 | #define IPT_DSCP_MAX XT_DSCP_MAX |
| 20 | u_int8_t invert; | 18 | |
| 21 | }; | 19 | #define ipt_dscp_info xt_dscp_info |
| 22 | 20 | ||
| 23 | #endif /* _IPT_DSCP_H */ | 21 | #endif /* _IPT_DSCP_H */ |
diff --git a/include/linux/netfilter_ipv4/ipt_iprange.h b/include/linux/netfilter_ipv4/ipt_iprange.h index 3ecb3bd636..34ab0fb736 100644 --- a/include/linux/netfilter_ipv4/ipt_iprange.h +++ b/include/linux/netfilter_ipv4/ipt_iprange.h | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | 8 | ||
| 9 | struct ipt_iprange { | 9 | struct ipt_iprange { |
| 10 | /* Inclusive: network order. */ | 10 | /* Inclusive: network order. */ |
| 11 | u_int32_t min_ip, max_ip; | 11 | __be32 min_ip, max_ip; |
| 12 | }; | 12 | }; |
| 13 | 13 | ||
| 14 | struct ipt_iprange_info | 14 | struct ipt_iprange_info |
diff --git a/include/linux/netfilter_ipv4/listhelp.h b/include/linux/netfilter_ipv4/listhelp.h deleted file mode 100644 index 5d92cf044d..0000000000 --- a/include/linux/netfilter_ipv4/listhelp.h +++ /dev/null | |||
| @@ -1,123 +0,0 @@ | |||
| 1 | #ifndef _LISTHELP_H | ||
| 2 | #define _LISTHELP_H | ||
| 3 | #include <linux/list.h> | ||
| 4 | |||
| 5 | /* Header to do more comprehensive job than linux/list.h; assume list | ||
| 6 | is first entry in structure. */ | ||
| 7 | |||
| 8 | /* Return pointer to first true entry, if any, or NULL. A macro | ||
| 9 | required to allow inlining of cmpfn. */ | ||
| 10 | #define LIST_FIND(head, cmpfn, type, args...) \ | ||
| 11 | ({ \ | ||
| 12 | const struct list_head *__i, *__j = NULL; \ | ||
| 13 | \ | ||
| 14 | ASSERT_READ_LOCK(head); \ | ||
| 15 | list_for_each(__i, (head)) \ | ||
| 16 | if (cmpfn((const type)__i , ## args)) { \ | ||
| 17 | __j = __i; \ | ||
| 18 | break; \ | ||
| 19 | } \ | ||
| 20 | (type)__j; \ | ||
| 21 | }) | ||
| 22 | |||
| 23 | #define LIST_FIND_W(head, cmpfn, type, args...) \ | ||
| 24 | ({ \ | ||
| 25 | const struct list_head *__i, *__j = NULL; \ | ||
| 26 | \ | ||
| 27 | ASSERT_WRITE_LOCK(head); \ | ||
| 28 | list_for_each(__i, (head)) \ | ||
| 29 | if (cmpfn((type)__i , ## args)) { \ | ||
| 30 | __j = __i; \ | ||
| 31 | break; \ | ||
| 32 | } \ | ||
| 33 | (type)__j; \ | ||
| 34 | }) | ||
| 35 | |||
| 36 | /* Just like LIST_FIND but we search backwards */ | ||
| 37 | #define LIST_FIND_B(head, cmpfn, type, args...) \ | ||
| 38 | ({ \ | ||
| 39 | const struct list_head *__i, *__j = NULL; \ | ||
| 40 | \ | ||
| 41 | ASSERT_READ_LOCK(head); \ | ||
| 42 | list_for_each_prev(__i, (head)) \ | ||
| 43 | if (cmpfn((const type)__i , ## args)) { \ | ||
| 44 | __j = __i; \ | ||
| 45 | break; \ | ||
| 46 | } \ | ||
| 47 | (type)__j; \ | ||
| 48 | }) | ||
| 49 | |||
| 50 | static inline int | ||
| 51 | __list_cmp_same(const void *p1, const void *p2) { return p1 == p2; } | ||
| 52 | |||
| 53 | /* Is this entry in the list? */ | ||
| 54 | static inline int | ||
| 55 | list_inlist(struct list_head *head, const void *entry) | ||
| 56 | { | ||
| 57 | return LIST_FIND(head, __list_cmp_same, void *, entry) != NULL; | ||
| 58 | } | ||
| 59 | |||
| 60 | /* Delete from list. */ | ||
| 61 | #ifdef CONFIG_NETFILTER_DEBUG | ||
| 62 | #define LIST_DELETE(head, oldentry) \ | ||
| 63 | do { \ | ||
| 64 | ASSERT_WRITE_LOCK(head); \ | ||
| 65 | if (!list_inlist(head, oldentry)) \ | ||
| 66 | printk("LIST_DELETE: %s:%u `%s'(%p) not in %s.\n", \ | ||
| 67 | __FILE__, __LINE__, #oldentry, oldentry, #head); \ | ||
| 68 | else list_del((struct list_head *)oldentry); \ | ||
| 69 | } while(0) | ||
| 70 | #else | ||
| 71 | #define LIST_DELETE(head, oldentry) list_del((struct list_head *)oldentry) | ||
| 72 | #endif | ||
| 73 | |||
| 74 | /* Append. */ | ||
| 75 | static inline void | ||
| 76 | list_append(struct list_head *head, void *new) | ||
| 77 | { | ||
| 78 | ASSERT_WRITE_LOCK(head); | ||
| 79 | list_add((new), (head)->prev); | ||
| 80 | } | ||
| 81 | |||
| 82 | /* Prepend. */ | ||
| 83 | static inline void | ||
| 84 | list_prepend(struct list_head *head, void *new) | ||
| 85 | { | ||
| 86 | ASSERT_WRITE_LOCK(head); | ||
| 87 | list_add(new, head); | ||
| 88 | } | ||
| 89 | |||
| 90 | /* Insert according to ordering function; insert before first true. */ | ||
| 91 | #define LIST_INSERT(head, new, cmpfn) \ | ||
| 92 | do { \ | ||
| 93 | struct list_head *__i; \ | ||
| 94 | ASSERT_WRITE_LOCK(head); \ | ||
| 95 | list_for_each(__i, (head)) \ | ||
| 96 | if ((new), (typeof (new))__i) \ | ||
| 97 | break; \ | ||
| 98 | list_add((struct list_head *)(new), __i->prev); \ | ||
| 99 | } while(0) | ||
| 100 | |||
| 101 | /* If the field after the list_head is a nul-terminated string, you | ||
| 102 | can use these functions. */ | ||
| 103 | static inline int __list_cmp_name(const void *i, const char *name) | ||
| 104 | { | ||
| 105 | return strcmp(name, i+sizeof(struct list_head)) == 0; | ||
| 106 | } | ||
| 107 | |||
| 108 | /* Returns false if same name already in list, otherwise does insert. */ | ||
| 109 | static inline int | ||
| 110 | list_named_insert(struct list_head *head, void *new) | ||
| 111 | { | ||
| 112 | if (LIST_FIND(head, __list_cmp_name, void *, | ||
| 113 | new + sizeof(struct list_head))) | ||
| 114 | return 0; | ||
| 115 | list_prepend(head, new); | ||
| 116 | return 1; | ||
| 117 | } | ||
| 118 | |||
| 119 | /* Find this named element in the list. */ | ||
| 120 | #define list_named_find(head, name) \ | ||
| 121 | LIST_FIND(head, __list_cmp_name, void *, name) | ||
| 122 | |||
| 123 | #endif /*_LISTHELP_H*/ | ||
diff --git a/include/linux/netfilter_ipv6.h b/include/linux/netfilter_ipv6.h index 52a7b9e764..d97e268cdf 100644 --- a/include/linux/netfilter_ipv6.h +++ b/include/linux/netfilter_ipv6.h | |||
| @@ -73,6 +73,7 @@ enum nf_ip6_hook_priorities { | |||
| 73 | }; | 73 | }; |
| 74 | 74 | ||
| 75 | #ifdef CONFIG_NETFILTER | 75 | #ifdef CONFIG_NETFILTER |
| 76 | extern int ip6_route_me_harder(struct sk_buff *skb); | ||
| 76 | extern unsigned int nf_ip6_checksum(struct sk_buff *skb, unsigned int hook, | 77 | extern unsigned int nf_ip6_checksum(struct sk_buff *skb, unsigned int hook, |
| 77 | unsigned int dataoff, u_int8_t protocol); | 78 | unsigned int dataoff, u_int8_t protocol); |
| 78 | 79 | ||
diff --git a/include/linux/netfilter_ipv6/Kbuild b/include/linux/netfilter_ipv6/Kbuild index 913ddbf55b..9dd978d149 100644 --- a/include/linux/netfilter_ipv6/Kbuild +++ b/include/linux/netfilter_ipv6/Kbuild | |||
| @@ -1,6 +1,21 @@ | |||
| 1 | header-y += ip6t_HL.h ip6t_LOG.h ip6t_MARK.h ip6t_REJECT.h ip6t_ah.h \ | 1 | header-y += ip6t_HL.h |
| 2 | ip6t_esp.h ip6t_frag.h ip6t_hl.h ip6t_ipv6header.h \ | 2 | header-y += ip6t_LOG.h |
| 3 | ip6t_length.h ip6t_limit.h ip6t_mac.h ip6t_mark.h \ | 3 | header-y += ip6t_MARK.h |
| 4 | ip6t_multiport.h ip6t_opts.h ip6t_owner.h ip6t_policy.h \ | 4 | header-y += ip6t_REJECT.h |
| 5 | ip6t_physdev.h ip6t_rt.h | 5 | header-y += ip6t_ah.h |
| 6 | unifdef-y := ip6_tables.h | 6 | header-y += ip6t_esp.h |
| 7 | header-y += ip6t_frag.h | ||
| 8 | header-y += ip6t_hl.h | ||
| 9 | header-y += ip6t_ipv6header.h | ||
| 10 | header-y += ip6t_length.h | ||
| 11 | header-y += ip6t_limit.h | ||
| 12 | header-y += ip6t_mac.h | ||
| 13 | header-y += ip6t_mark.h | ||
| 14 | header-y += ip6t_multiport.h | ||
| 15 | header-y += ip6t_opts.h | ||
| 16 | header-y += ip6t_owner.h | ||
| 17 | header-y += ip6t_policy.h | ||
| 18 | header-y += ip6t_physdev.h | ||
| 19 | header-y += ip6t_rt.h | ||
| 20 | |||
| 21 | unifdef-y += ip6_tables.h | ||
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h index d0d5d1ee4b..d7a8e9c0da 100644 --- a/include/linux/netfilter_ipv6/ip6_tables.h +++ b/include/linux/netfilter_ipv6/ip6_tables.h | |||
| @@ -300,8 +300,7 @@ extern unsigned int ip6t_do_table(struct sk_buff **pskb, | |||
| 300 | unsigned int hook, | 300 | unsigned int hook, |
| 301 | const struct net_device *in, | 301 | const struct net_device *in, |
| 302 | const struct net_device *out, | 302 | const struct net_device *out, |
| 303 | struct ip6t_table *table, | 303 | struct ip6t_table *table); |
| 304 | void *userdata); | ||
| 305 | 304 | ||
| 306 | /* Check for an extension */ | 305 | /* Check for an extension */ |
| 307 | extern int ip6t_ext_hdr(u8 nexthdr); | 306 | extern int ip6t_ext_hdr(u8 nexthdr); |
diff --git a/include/linux/netfilter_logging.h b/include/linux/netfilter_logging.h deleted file mode 100644 index 562bb6aad4..0000000000 --- a/include/linux/netfilter_logging.h +++ /dev/null | |||
| @@ -1,33 +0,0 @@ | |||
| 1 | /* Internal logging interface, which relies on the real | ||
| 2 | LOG target modules */ | ||
| 3 | #ifndef __LINUX_NETFILTER_LOGGING_H | ||
| 4 | #define __LINUX_NETFILTER_LOGGING_H | ||
| 5 | |||
| 6 | #ifdef __KERNEL__ | ||
| 7 | #include <asm/atomic.h> | ||
| 8 | |||
| 9 | struct nf_logging_t { | ||
| 10 | void (*nf_log_packet)(struct sk_buff **pskb, | ||
| 11 | unsigned int hooknum, | ||
| 12 | const struct net_device *in, | ||
| 13 | const struct net_device *out, | ||
| 14 | const char *prefix); | ||
| 15 | void (*nf_log)(char *pfh, size_t len, | ||
| 16 | const char *prefix); | ||
| 17 | }; | ||
| 18 | |||
| 19 | extern void nf_log_register(int pf, const struct nf_logging_t *logging); | ||
| 20 | extern void nf_log_unregister(int pf, const struct nf_logging_t *logging); | ||
| 21 | |||
| 22 | extern void nf_log_packet(int pf, | ||
| 23 | struct sk_buff **pskb, | ||
| 24 | unsigned int hooknum, | ||
| 25 | const struct net_device *in, | ||
| 26 | const struct net_device *out, | ||
| 27 | const char *fmt, ...); | ||
| 28 | extern void nf_log(int pf, | ||
| 29 | char *pfh, size_t len, | ||
| 30 | const char *fmt, ...); | ||
| 31 | #endif /*__KERNEL__*/ | ||
| 32 | |||
| 33 | #endif /*__LINUX_NETFILTER_LOGGING_H*/ | ||
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index 855b44668c..66411622e0 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
| @@ -21,6 +21,8 @@ | |||
| 21 | #define NETLINK_DNRTMSG 14 /* DECnet routing messages */ | 21 | #define NETLINK_DNRTMSG 14 /* DECnet routing messages */ |
| 22 | #define NETLINK_KOBJECT_UEVENT 15 /* Kernel messages to userspace */ | 22 | #define NETLINK_KOBJECT_UEVENT 15 /* Kernel messages to userspace */ |
| 23 | #define NETLINK_GENERIC 16 | 23 | #define NETLINK_GENERIC 16 |
| 24 | /* leave room for NETLINK_DM (DM Events) */ | ||
| 25 | #define NETLINK_SCSITRANSPORT 18 /* SCSI Transports */ | ||
| 24 | 26 | ||
| 25 | #define MAX_LINKS 32 | 27 | #define MAX_LINKS 32 |
| 26 | 28 | ||
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 6c2066caea..76ff54846a 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
| @@ -9,6 +9,8 @@ | |||
| 9 | #ifndef _LINUX_NFS_FS_H | 9 | #ifndef _LINUX_NFS_FS_H |
| 10 | #define _LINUX_NFS_FS_H | 10 | #define _LINUX_NFS_FS_H |
| 11 | 11 | ||
| 12 | #include <linux/magic.h> | ||
| 13 | |||
| 12 | /* | 14 | /* |
| 13 | * Enable debugging support for nfs client. | 15 | * Enable debugging support for nfs client. |
| 14 | * Requires RPC_DEBUG. | 16 | * Requires RPC_DEBUG. |
| @@ -22,11 +24,6 @@ | |||
| 22 | #define NFS_MAX_TCP_TIMEOUT (600*HZ) | 24 | #define NFS_MAX_TCP_TIMEOUT (600*HZ) |
| 23 | 25 | ||
| 24 | /* | 26 | /* |
| 25 | * superblock magic number for NFS | ||
| 26 | */ | ||
| 27 | #define NFS_SUPER_MAGIC 0x6969 | ||
| 28 | |||
| 29 | /* | ||
| 30 | * When flushing a cluster of dirty pages, there can be different | 27 | * When flushing a cluster of dirty pages, there can be different |
| 31 | * strategies: | 28 | * strategies: |
| 32 | */ | 29 | */ |
| @@ -42,6 +39,7 @@ | |||
| 42 | #include <linux/in.h> | 39 | #include <linux/in.h> |
| 43 | #include <linux/mm.h> | 40 | #include <linux/mm.h> |
| 44 | #include <linux/pagemap.h> | 41 | #include <linux/pagemap.h> |
| 42 | #include <linux/rbtree.h> | ||
| 45 | #include <linux/rwsem.h> | 43 | #include <linux/rwsem.h> |
| 46 | #include <linux/wait.h> | 44 | #include <linux/wait.h> |
| 47 | 45 | ||
| @@ -69,6 +67,8 @@ | |||
| 69 | * NFSv3/v4 Access mode cache entry | 67 | * NFSv3/v4 Access mode cache entry |
| 70 | */ | 68 | */ |
| 71 | struct nfs_access_entry { | 69 | struct nfs_access_entry { |
| 70 | struct rb_node rb_node; | ||
| 71 | struct list_head lru; | ||
| 72 | unsigned long jiffies; | 72 | unsigned long jiffies; |
| 73 | struct rpc_cred * cred; | 73 | struct rpc_cred * cred; |
| 74 | int mask; | 74 | int mask; |
| @@ -145,7 +145,9 @@ struct nfs_inode { | |||
| 145 | */ | 145 | */ |
| 146 | atomic_t data_updates; | 146 | atomic_t data_updates; |
| 147 | 147 | ||
| 148 | struct nfs_access_entry cache_access; | 148 | struct rb_root access_cache; |
| 149 | struct list_head access_cache_entry_lru; | ||
| 150 | struct list_head access_cache_inode_lru; | ||
| 149 | #ifdef CONFIG_NFS_V3_ACL | 151 | #ifdef CONFIG_NFS_V3_ACL |
| 150 | struct posix_acl *acl_access; | 152 | struct posix_acl *acl_access; |
| 151 | struct posix_acl *acl_default; | 153 | struct posix_acl *acl_default; |
| @@ -199,6 +201,7 @@ struct nfs_inode { | |||
| 199 | #define NFS_INO_REVALIDATING (0) /* revalidating attrs */ | 201 | #define NFS_INO_REVALIDATING (0) /* revalidating attrs */ |
| 200 | #define NFS_INO_ADVISE_RDPLUS (1) /* advise readdirplus */ | 202 | #define NFS_INO_ADVISE_RDPLUS (1) /* advise readdirplus */ |
| 201 | #define NFS_INO_STALE (2) /* possible stale inode */ | 203 | #define NFS_INO_STALE (2) /* possible stale inode */ |
| 204 | #define NFS_INO_ACL_LRU_SET (3) /* Inode is on the LRU list */ | ||
| 202 | 205 | ||
| 203 | static inline struct nfs_inode *NFS_I(struct inode *inode) | 206 | static inline struct nfs_inode *NFS_I(struct inode *inode) |
| 204 | { | 207 | { |
| @@ -209,8 +212,7 @@ static inline struct nfs_inode *NFS_I(struct inode *inode) | |||
| 209 | #define NFS_FH(inode) (&NFS_I(inode)->fh) | 212 | #define NFS_FH(inode) (&NFS_I(inode)->fh) |
| 210 | #define NFS_SERVER(inode) (NFS_SB(inode->i_sb)) | 213 | #define NFS_SERVER(inode) (NFS_SB(inode->i_sb)) |
| 211 | #define NFS_CLIENT(inode) (NFS_SERVER(inode)->client) | 214 | #define NFS_CLIENT(inode) (NFS_SERVER(inode)->client) |
| 212 | #define NFS_PROTO(inode) (NFS_SERVER(inode)->rpc_ops) | 215 | #define NFS_PROTO(inode) (NFS_SERVER(inode)->nfs_client->rpc_ops) |
| 213 | #define NFS_ADDR(inode) (RPC_PEERADDR(NFS_CLIENT(inode))) | ||
| 214 | #define NFS_COOKIEVERF(inode) (NFS_I(inode)->cookieverf) | 216 | #define NFS_COOKIEVERF(inode) (NFS_I(inode)->cookieverf) |
| 215 | #define NFS_READTIME(inode) (NFS_I(inode)->read_cache_jiffies) | 217 | #define NFS_READTIME(inode) (NFS_I(inode)->read_cache_jiffies) |
| 216 | #define NFS_CHANGE_ATTR(inode) (NFS_I(inode)->change_attr) | 218 | #define NFS_CHANGE_ATTR(inode) (NFS_I(inode)->change_attr) |
| @@ -297,6 +299,7 @@ extern int nfs_getattr(struct vfsmount *, struct dentry *, struct kstat *); | |||
| 297 | extern int nfs_permission(struct inode *, int, struct nameidata *); | 299 | extern int nfs_permission(struct inode *, int, struct nameidata *); |
| 298 | extern int nfs_access_get_cached(struct inode *, struct rpc_cred *, struct nfs_access_entry *); | 300 | extern int nfs_access_get_cached(struct inode *, struct rpc_cred *, struct nfs_access_entry *); |
| 299 | extern void nfs_access_add_cache(struct inode *, struct nfs_access_entry *); | 301 | extern void nfs_access_add_cache(struct inode *, struct nfs_access_entry *); |
| 302 | extern void nfs_access_zap_cache(struct inode *inode); | ||
| 300 | extern int nfs_open(struct inode *, struct file *); | 303 | extern int nfs_open(struct inode *, struct file *); |
| 301 | extern int nfs_release(struct inode *, struct file *); | 304 | extern int nfs_release(struct inode *, struct file *); |
| 302 | extern int nfs_attribute_timeout(struct inode *inode); | 305 | extern int nfs_attribute_timeout(struct inode *inode); |
| @@ -312,10 +315,6 @@ extern void nfs_end_data_update(struct inode *); | |||
| 312 | extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx); | 315 | extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx); |
| 313 | extern void put_nfs_open_context(struct nfs_open_context *ctx); | 316 | extern void put_nfs_open_context(struct nfs_open_context *ctx); |
| 314 | extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, int mode); | 317 | extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, int mode); |
| 315 | extern struct vfsmount *nfs_do_submount(const struct vfsmount *mnt_parent, | ||
| 316 | const struct dentry *dentry, | ||
| 317 | struct nfs_fh *fh, | ||
| 318 | struct nfs_fattr *fattr); | ||
| 319 | 318 | ||
| 320 | /* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */ | 319 | /* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */ |
| 321 | extern u32 root_nfs_parse_addr(char *name); /*__init*/ | 320 | extern u32 root_nfs_parse_addr(char *name); /*__init*/ |
| @@ -368,10 +367,12 @@ extern int nfs3_removexattr (struct dentry *, const char *name); | |||
| 368 | */ | 367 | */ |
| 369 | extern ssize_t nfs_direct_IO(int, struct kiocb *, const struct iovec *, loff_t, | 368 | extern ssize_t nfs_direct_IO(int, struct kiocb *, const struct iovec *, loff_t, |
| 370 | unsigned long); | 369 | unsigned long); |
| 371 | extern ssize_t nfs_file_direct_read(struct kiocb *iocb, char __user *buf, | 370 | extern ssize_t nfs_file_direct_read(struct kiocb *iocb, |
| 372 | size_t count, loff_t pos); | 371 | const struct iovec *iov, unsigned long nr_segs, |
| 373 | extern ssize_t nfs_file_direct_write(struct kiocb *iocb, const char __user *buf, | 372 | loff_t pos); |
| 374 | size_t count, loff_t pos); | 373 | extern ssize_t nfs_file_direct_write(struct kiocb *iocb, |
| 374 | const struct iovec *iov, unsigned long nr_segs, | ||
| 375 | loff_t pos); | ||
| 375 | 376 | ||
| 376 | /* | 377 | /* |
| 377 | * linux/fs/nfs/dir.c | 378 | * linux/fs/nfs/dir.c |
| @@ -579,6 +580,7 @@ extern void * nfs_root_data(void); | |||
| 579 | #define NFSDBG_FILE 0x0040 | 580 | #define NFSDBG_FILE 0x0040 |
| 580 | #define NFSDBG_ROOT 0x0080 | 581 | #define NFSDBG_ROOT 0x0080 |
| 581 | #define NFSDBG_CALLBACK 0x0100 | 582 | #define NFSDBG_CALLBACK 0x0100 |
| 583 | #define NFSDBG_CLIENT 0x0200 | ||
| 582 | #define NFSDBG_ALL 0xFFFF | 584 | #define NFSDBG_ALL 0xFFFF |
| 583 | 585 | ||
| 584 | #ifdef __KERNEL__ | 586 | #ifdef __KERNEL__ |
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h index 6b4a13c794..7ccfc7ef0a 100644 --- a/include/linux/nfs_fs_sb.h +++ b/include/linux/nfs_fs_sb.h | |||
| @@ -7,13 +7,79 @@ | |||
| 7 | struct nfs_iostats; | 7 | struct nfs_iostats; |
| 8 | 8 | ||
| 9 | /* | 9 | /* |
| 10 | * The nfs_client identifies our client state to the server. | ||
| 11 | */ | ||
| 12 | struct nfs_client { | ||
| 13 | atomic_t cl_count; | ||
| 14 | int cl_cons_state; /* current construction state (-ve: init error) */ | ||
| 15 | #define NFS_CS_READY 0 /* ready to be used */ | ||
| 16 | #define NFS_CS_INITING 1 /* busy initialising */ | ||
| 17 | int cl_nfsversion; /* NFS protocol version */ | ||
| 18 | unsigned long cl_res_state; /* NFS resources state */ | ||
| 19 | #define NFS_CS_RPCIOD 0 /* - rpciod started */ | ||
| 20 | #define NFS_CS_CALLBACK 1 /* - callback started */ | ||
| 21 | #define NFS_CS_IDMAP 2 /* - idmap started */ | ||
| 22 | #define NFS_CS_RENEWD 3 /* - renewd started */ | ||
| 23 | struct sockaddr_in cl_addr; /* server identifier */ | ||
| 24 | char * cl_hostname; /* hostname of server */ | ||
| 25 | struct list_head cl_share_link; /* link in global client list */ | ||
| 26 | struct list_head cl_superblocks; /* List of nfs_server structs */ | ||
| 27 | |||
| 28 | struct rpc_clnt * cl_rpcclient; | ||
| 29 | const struct nfs_rpc_ops *rpc_ops; /* NFS protocol vector */ | ||
| 30 | unsigned long retrans_timeo; /* retransmit timeout */ | ||
| 31 | unsigned int retrans_count; /* number of retransmit tries */ | ||
| 32 | |||
| 33 | #ifdef CONFIG_NFS_V4 | ||
| 34 | u64 cl_clientid; /* constant */ | ||
| 35 | nfs4_verifier cl_confirm; | ||
| 36 | unsigned long cl_state; | ||
| 37 | |||
| 38 | u32 cl_lockowner_id; | ||
| 39 | |||
| 40 | /* | ||
| 41 | * The following rwsem ensures exclusive access to the server | ||
| 42 | * while we recover the state following a lease expiration. | ||
| 43 | */ | ||
| 44 | struct rw_semaphore cl_sem; | ||
| 45 | |||
| 46 | struct list_head cl_delegations; | ||
| 47 | struct list_head cl_state_owners; | ||
| 48 | struct list_head cl_unused; | ||
| 49 | int cl_nunused; | ||
| 50 | spinlock_t cl_lock; | ||
| 51 | |||
| 52 | unsigned long cl_lease_time; | ||
| 53 | unsigned long cl_last_renewal; | ||
| 54 | struct work_struct cl_renewd; | ||
| 55 | |||
| 56 | struct rpc_wait_queue cl_rpcwaitq; | ||
| 57 | |||
| 58 | /* used for the setclientid verifier */ | ||
| 59 | struct timespec cl_boot_time; | ||
| 60 | |||
| 61 | /* idmapper */ | ||
| 62 | struct idmap * cl_idmap; | ||
| 63 | |||
| 64 | /* Our own IP address, as a null-terminated string. | ||
| 65 | * This is used to generate the clientid, and the callback address. | ||
| 66 | */ | ||
| 67 | char cl_ipaddr[16]; | ||
| 68 | unsigned char cl_id_uniquifier; | ||
| 69 | #endif | ||
| 70 | }; | ||
| 71 | |||
| 72 | /* | ||
| 10 | * NFS client parameters stored in the superblock. | 73 | * NFS client parameters stored in the superblock. |
| 11 | */ | 74 | */ |
| 12 | struct nfs_server { | 75 | struct nfs_server { |
| 76 | struct nfs_client * nfs_client; /* shared client and NFS4 state */ | ||
| 77 | struct list_head client_link; /* List of other nfs_server structs | ||
| 78 | * that share the same client | ||
| 79 | */ | ||
| 80 | struct list_head master_link; /* link in master servers list */ | ||
| 13 | struct rpc_clnt * client; /* RPC client handle */ | 81 | struct rpc_clnt * client; /* RPC client handle */ |
| 14 | struct rpc_clnt * client_sys; /* 2nd handle for FSINFO */ | ||
| 15 | struct rpc_clnt * client_acl; /* ACL RPC client handle */ | 82 | struct rpc_clnt * client_acl; /* ACL RPC client handle */ |
| 16 | struct nfs_rpc_ops * rpc_ops; /* NFS protocol vector */ | ||
| 17 | struct nfs_iostats * io_stats; /* I/O statistics */ | 83 | struct nfs_iostats * io_stats; /* I/O statistics */ |
| 18 | struct backing_dev_info backing_dev_info; | 84 | struct backing_dev_info backing_dev_info; |
| 19 | int flags; /* various flags */ | 85 | int flags; /* various flags */ |
| @@ -29,24 +95,14 @@ struct nfs_server { | |||
| 29 | unsigned int acregmax; | 95 | unsigned int acregmax; |
| 30 | unsigned int acdirmin; | 96 | unsigned int acdirmin; |
| 31 | unsigned int acdirmax; | 97 | unsigned int acdirmax; |
| 32 | unsigned long retrans_timeo; /* retransmit timeout */ | ||
| 33 | unsigned int retrans_count; /* number of retransmit tries */ | ||
| 34 | unsigned int namelen; | 98 | unsigned int namelen; |
| 35 | char * hostname; /* remote hostname */ | 99 | |
| 36 | struct nfs_fh fh; | ||
| 37 | struct sockaddr_in addr; | ||
| 38 | struct nfs_fsid fsid; | 100 | struct nfs_fsid fsid; |
| 101 | __u64 maxfilesize; /* maximum file size */ | ||
| 39 | unsigned long mount_time; /* when this fs was mounted */ | 102 | unsigned long mount_time; /* when this fs was mounted */ |
| 103 | dev_t s_dev; /* superblock dev numbers */ | ||
| 104 | |||
| 40 | #ifdef CONFIG_NFS_V4 | 105 | #ifdef CONFIG_NFS_V4 |
| 41 | /* Our own IP address, as a null-terminated string. | ||
| 42 | * This is used to generate the clientid, and the callback address. | ||
| 43 | */ | ||
| 44 | char ip_addr[16]; | ||
| 45 | char * mnt_path; | ||
| 46 | struct nfs4_client * nfs4_state; /* all NFSv4 state starts here */ | ||
| 47 | struct list_head nfs4_siblings; /* List of other nfs_server structs | ||
| 48 | * that share the same clientid | ||
| 49 | */ | ||
| 50 | u32 attr_bitmask[2];/* V4 bitmask representing the set | 106 | u32 attr_bitmask[2];/* V4 bitmask representing the set |
| 51 | of attributes supported on this | 107 | of attributes supported on this |
| 52 | filesystem */ | 108 | filesystem */ |
| @@ -54,6 +110,7 @@ struct nfs_server { | |||
| 54 | that are supported on this | 110 | that are supported on this |
| 55 | filesystem */ | 111 | filesystem */ |
| 56 | #endif | 112 | #endif |
| 113 | void (*destroy)(struct nfs_server *); | ||
| 57 | }; | 114 | }; |
| 58 | 115 | ||
| 59 | /* Server capabilities */ | 116 | /* Server capabilities */ |
diff --git a/include/linux/nfs_idmap.h b/include/linux/nfs_idmap.h index 102e560942..15a9f3b728 100644 --- a/include/linux/nfs_idmap.h +++ b/include/linux/nfs_idmap.h | |||
| @@ -62,15 +62,15 @@ struct idmap_msg { | |||
| 62 | #ifdef __KERNEL__ | 62 | #ifdef __KERNEL__ |
| 63 | 63 | ||
| 64 | /* Forward declaration to make this header independent of others */ | 64 | /* Forward declaration to make this header independent of others */ |
| 65 | struct nfs4_client; | 65 | struct nfs_client; |
| 66 | 66 | ||
| 67 | void nfs_idmap_new(struct nfs4_client *); | 67 | int nfs_idmap_new(struct nfs_client *); |
| 68 | void nfs_idmap_delete(struct nfs4_client *); | 68 | void nfs_idmap_delete(struct nfs_client *); |
| 69 | 69 | ||
| 70 | int nfs_map_name_to_uid(struct nfs4_client *, const char *, size_t, __u32 *); | 70 | int nfs_map_name_to_uid(struct nfs_client *, const char *, size_t, __u32 *); |
| 71 | int nfs_map_group_to_gid(struct nfs4_client *, const char *, size_t, __u32 *); | 71 | int nfs_map_group_to_gid(struct nfs_client *, const char *, size_t, __u32 *); |
| 72 | int nfs_map_uid_to_name(struct nfs4_client *, __u32, char *); | 72 | int nfs_map_uid_to_name(struct nfs_client *, __u32, char *); |
| 73 | int nfs_map_gid_to_group(struct nfs4_client *, __u32, char *); | 73 | int nfs_map_gid_to_group(struct nfs_client *, __u32, char *); |
| 74 | 74 | ||
| 75 | extern unsigned int nfs_idmap_cache_timeout; | 75 | extern unsigned int nfs_idmap_cache_timeout; |
| 76 | #endif /* __KERNEL__ */ | 76 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 41e5a19199..dc5397d9d2 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
| @@ -1,7 +1,6 @@ | |||
| 1 | #ifndef _LINUX_NFS_XDR_H | 1 | #ifndef _LINUX_NFS_XDR_H |
| 2 | #define _LINUX_NFS_XDR_H | 2 | #define _LINUX_NFS_XDR_H |
| 3 | 3 | ||
| 4 | #include <linux/sunrpc/xprt.h> | ||
| 5 | #include <linux/nfsacl.h> | 4 | #include <linux/nfsacl.h> |
| 6 | 5 | ||
| 7 | /* | 6 | /* |
| @@ -359,8 +358,8 @@ struct nfs_symlinkargs { | |||
| 359 | struct nfs_fh * fromfh; | 358 | struct nfs_fh * fromfh; |
| 360 | const char * fromname; | 359 | const char * fromname; |
| 361 | unsigned int fromlen; | 360 | unsigned int fromlen; |
| 362 | const char * topath; | 361 | struct page ** pages; |
| 363 | unsigned int tolen; | 362 | unsigned int pathlen; |
| 364 | struct iattr * sattr; | 363 | struct iattr * sattr; |
| 365 | }; | 364 | }; |
| 366 | 365 | ||
| @@ -435,8 +434,8 @@ struct nfs3_symlinkargs { | |||
| 435 | struct nfs_fh * fromfh; | 434 | struct nfs_fh * fromfh; |
| 436 | const char * fromname; | 435 | const char * fromname; |
| 437 | unsigned int fromlen; | 436 | unsigned int fromlen; |
| 438 | const char * topath; | 437 | struct page ** pages; |
| 439 | unsigned int tolen; | 438 | unsigned int pathlen; |
| 440 | struct iattr * sattr; | 439 | struct iattr * sattr; |
| 441 | }; | 440 | }; |
| 442 | 441 | ||
| @@ -534,7 +533,10 @@ struct nfs4_accessres { | |||
| 534 | struct nfs4_create_arg { | 533 | struct nfs4_create_arg { |
| 535 | u32 ftype; | 534 | u32 ftype; |
| 536 | union { | 535 | union { |
| 537 | struct qstr * symlink; /* NF4LNK */ | 536 | struct { |
| 537 | struct page ** pages; | ||
| 538 | unsigned int len; | ||
| 539 | } symlink; /* NF4LNK */ | ||
| 538 | struct { | 540 | struct { |
| 539 | u32 specdata1; | 541 | u32 specdata1; |
| 540 | u32 specdata2; | 542 | u32 specdata2; |
| @@ -770,6 +772,9 @@ struct nfs_rpc_ops { | |||
| 770 | 772 | ||
| 771 | int (*getroot) (struct nfs_server *, struct nfs_fh *, | 773 | int (*getroot) (struct nfs_server *, struct nfs_fh *, |
| 772 | struct nfs_fsinfo *); | 774 | struct nfs_fsinfo *); |
| 775 | int (*lookupfh)(struct nfs_server *, struct nfs_fh *, | ||
| 776 | struct qstr *, struct nfs_fh *, | ||
| 777 | struct nfs_fattr *); | ||
| 773 | int (*getattr) (struct nfs_server *, struct nfs_fh *, | 778 | int (*getattr) (struct nfs_server *, struct nfs_fh *, |
| 774 | struct nfs_fattr *); | 779 | struct nfs_fattr *); |
| 775 | int (*setattr) (struct dentry *, struct nfs_fattr *, | 780 | int (*setattr) (struct dentry *, struct nfs_fattr *, |
| @@ -791,9 +796,8 @@ struct nfs_rpc_ops { | |||
| 791 | int (*rename) (struct inode *, struct qstr *, | 796 | int (*rename) (struct inode *, struct qstr *, |
| 792 | struct inode *, struct qstr *); | 797 | struct inode *, struct qstr *); |
| 793 | int (*link) (struct inode *, struct inode *, struct qstr *); | 798 | int (*link) (struct inode *, struct inode *, struct qstr *); |
| 794 | int (*symlink) (struct inode *, struct qstr *, struct qstr *, | 799 | int (*symlink) (struct inode *, struct dentry *, struct page *, |
| 795 | struct iattr *, struct nfs_fh *, | 800 | unsigned int, struct iattr *); |
| 796 | struct nfs_fattr *); | ||
| 797 | int (*mkdir) (struct inode *, struct dentry *, struct iattr *); | 801 | int (*mkdir) (struct inode *, struct dentry *, struct iattr *); |
| 798 | int (*rmdir) (struct inode *, struct qstr *); | 802 | int (*rmdir) (struct inode *, struct qstr *); |
| 799 | int (*readdir) (struct dentry *, struct rpc_cred *, | 803 | int (*readdir) (struct dentry *, struct rpc_cred *, |
| @@ -806,6 +810,7 @@ struct nfs_rpc_ops { | |||
| 806 | struct nfs_fsinfo *); | 810 | struct nfs_fsinfo *); |
| 807 | int (*pathconf) (struct nfs_server *, struct nfs_fh *, | 811 | int (*pathconf) (struct nfs_server *, struct nfs_fh *, |
| 808 | struct nfs_pathconf *); | 812 | struct nfs_pathconf *); |
| 813 | int (*set_capabilities)(struct nfs_server *, struct nfs_fh *); | ||
| 809 | u32 * (*decode_dirent)(u32 *, struct nfs_entry *, int plus); | 814 | u32 * (*decode_dirent)(u32 *, struct nfs_entry *, int plus); |
| 810 | void (*read_setup) (struct nfs_read_data *); | 815 | void (*read_setup) (struct nfs_read_data *); |
| 811 | int (*read_done) (struct rpc_task *, struct nfs_read_data *); | 816 | int (*read_done) (struct rpc_task *, struct nfs_read_data *); |
| @@ -829,9 +834,9 @@ struct nfs_rpc_ops { | |||
| 829 | /* | 834 | /* |
| 830 | * Function vectors etc. for the NFS client | 835 | * Function vectors etc. for the NFS client |
| 831 | */ | 836 | */ |
| 832 | extern struct nfs_rpc_ops nfs_v2_clientops; | 837 | extern const struct nfs_rpc_ops nfs_v2_clientops; |
| 833 | extern struct nfs_rpc_ops nfs_v3_clientops; | 838 | extern const struct nfs_rpc_ops nfs_v3_clientops; |
| 834 | extern struct nfs_rpc_ops nfs_v4_clientops; | 839 | extern const struct nfs_rpc_ops nfs_v4_clientops; |
| 835 | extern struct rpc_version nfs_version2; | 840 | extern struct rpc_version nfs_version2; |
| 836 | extern struct rpc_version nfs_version3; | 841 | extern struct rpc_version nfs_version3; |
| 837 | extern struct rpc_version nfs_version4; | 842 | extern struct rpc_version nfs_version4; |
diff --git a/include/linux/nfsd/Kbuild b/include/linux/nfsd/Kbuild index c8c5456658..d9c5455808 100644 --- a/include/linux/nfsd/Kbuild +++ b/include/linux/nfsd/Kbuild | |||
| @@ -1,2 +1,7 @@ | |||
| 1 | unifdef-y := const.h export.h stats.h syscall.h nfsfh.h debug.h auth.h | 1 | unifdef-y += const.h |
| 2 | 2 | unifdef-y += export.h | |
| 3 | unifdef-y += stats.h | ||
| 4 | unifdef-y += syscall.h | ||
| 5 | unifdef-y += nfsfh.h | ||
| 6 | unifdef-y += debug.h | ||
| 7 | unifdef-y += auth.h | ||
diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h index f9edcd2ff3..31a3cb617c 100644 --- a/include/linux/nfsd/nfsfh.h +++ b/include/linux/nfsd/nfsfh.h | |||
| @@ -269,14 +269,8 @@ fill_post_wcc(struct svc_fh *fhp) | |||
| 269 | fhp->fh_post_uid = inode->i_uid; | 269 | fhp->fh_post_uid = inode->i_uid; |
| 270 | fhp->fh_post_gid = inode->i_gid; | 270 | fhp->fh_post_gid = inode->i_gid; |
| 271 | fhp->fh_post_size = inode->i_size; | 271 | fhp->fh_post_size = inode->i_size; |
| 272 | if (inode->i_blksize) { | 272 | fhp->fh_post_blksize = BLOCK_SIZE; |
| 273 | fhp->fh_post_blksize = inode->i_blksize; | 273 | fhp->fh_post_blocks = inode->i_blocks; |
| 274 | fhp->fh_post_blocks = inode->i_blocks; | ||
| 275 | } else { | ||
| 276 | fhp->fh_post_blksize = BLOCK_SIZE; | ||
| 277 | /* how much do we care for accuracy with MinixFS? */ | ||
| 278 | fhp->fh_post_blocks = (inode->i_size+511) >> 9; | ||
| 279 | } | ||
| 280 | fhp->fh_post_rdev[0] = htonl((u32)imajor(inode)); | 274 | fhp->fh_post_rdev[0] = htonl((u32)imajor(inode)); |
| 281 | fhp->fh_post_rdev[1] = htonl((u32)iminor(inode)); | 275 | fhp->fh_post_rdev[1] = htonl((u32)iminor(inode)); |
| 282 | fhp->fh_post_atime = inode->i_atime; | 276 | fhp->fh_post_atime = inode->i_atime; |
diff --git a/include/linux/nmi.h b/include/linux/nmi.h index c8f4d2f627..e16904e28c 100644 --- a/include/linux/nmi.h +++ b/include/linux/nmi.h | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | #ifndef LINUX_NMI_H | 4 | #ifndef LINUX_NMI_H |
| 5 | #define LINUX_NMI_H | 5 | #define LINUX_NMI_H |
| 6 | 6 | ||
| 7 | #include <linux/sched.h> | ||
| 7 | #include <asm/irq.h> | 8 | #include <asm/irq.h> |
| 8 | 9 | ||
| 9 | /** | 10 | /** |
| @@ -16,7 +17,7 @@ | |||
| 16 | #ifdef ARCH_HAS_NMI_WATCHDOG | 17 | #ifdef ARCH_HAS_NMI_WATCHDOG |
| 17 | extern void touch_nmi_watchdog(void); | 18 | extern void touch_nmi_watchdog(void); |
| 18 | #else | 19 | #else |
| 19 | # define touch_nmi_watchdog() do { } while(0) | 20 | # define touch_nmi_watchdog() touch_softlockup_watchdog() |
| 20 | #endif | 21 | #endif |
| 21 | 22 | ||
| 22 | #endif | 23 | #endif |
diff --git a/include/linux/openprom_fs.h b/include/linux/openprom_fs.h deleted file mode 100644 index a837aab821..0000000000 --- a/include/linux/openprom_fs.h +++ /dev/null | |||
| @@ -1,10 +0,0 @@ | |||
| 1 | #ifndef _LINUX_OPENPROM_FS_H | ||
| 2 | #define _LINUX_OPENPROM_FS_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * The openprom filesystem constants/structures | ||
| 6 | */ | ||
| 7 | |||
| 8 | #define OPENPROM_SUPER_MAGIC 0x9fa1 | ||
| 9 | |||
| 10 | #endif /* _LINUX_OPENPROM_FS_H */ | ||
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 5748642e9f..4830a3bedf 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
| @@ -13,24 +13,25 @@ | |||
| 13 | * PG_reserved is set for special pages, which can never be swapped out. Some | 13 | * PG_reserved is set for special pages, which can never be swapped out. Some |
| 14 | * of them might not even exist (eg empty_bad_page)... | 14 | * of them might not even exist (eg empty_bad_page)... |
| 15 | * | 15 | * |
| 16 | * The PG_private bitflag is set if page->private contains a valid value. | 16 | * The PG_private bitflag is set on pagecache pages if they contain filesystem |
| 17 | * specific data (which is normally at page->private). It can be used by | ||
| 18 | * private allocations for its own usage. | ||
| 17 | * | 19 | * |
| 18 | * During disk I/O, PG_locked is used. This bit is set before I/O and | 20 | * During initiation of disk I/O, PG_locked is set. This bit is set before I/O |
| 19 | * reset when I/O completes. page_waitqueue(page) is a wait queue of all tasks | 21 | * and cleared when writeback _starts_ or when read _completes_. PG_writeback |
| 20 | * waiting for the I/O on this page to complete. | 22 | * is set before writeback starts and cleared when it finishes. |
| 23 | * | ||
| 24 | * PG_locked also pins a page in pagecache, and blocks truncation of the file | ||
| 25 | * while it is held. | ||
| 26 | * | ||
| 27 | * page_waitqueue(page) is a wait queue of all tasks waiting for the page | ||
| 28 | * to become unlocked. | ||
| 21 | * | 29 | * |
| 22 | * PG_uptodate tells whether the page's contents is valid. When a read | 30 | * PG_uptodate tells whether the page's contents is valid. When a read |
| 23 | * completes, the page becomes uptodate, unless a disk I/O error happened. | 31 | * completes, the page becomes uptodate, unless a disk I/O error happened. |
| 24 | * | 32 | * |
| 25 | * For choosing which pages to swap out, inode pages carry a PG_referenced bit, | 33 | * PG_referenced, PG_reclaim are used for page reclaim for anonymous and |
| 26 | * which is set any time the system accesses that page through the (mapping, | 34 | * file-backed pagecache (see mm/vmscan.c). |
| 27 | * index) hash table. This referenced bit, together with the referenced bit | ||
| 28 | * in the page tables, is used to manipulate page->age and move the page across | ||
| 29 | * the active, inactive_dirty and inactive_clean lists. | ||
| 30 | * | ||
| 31 | * Note that the referenced bit, the page->lru list_head and the active, | ||
| 32 | * inactive_dirty and inactive_clean lists are protected by the | ||
| 33 | * zone->lru_lock, and *NOT* by the usual PG_locked bit! | ||
| 34 | * | 35 | * |
| 35 | * PG_error is set to indicate that an I/O error occurred on this page. | 36 | * PG_error is set to indicate that an I/O error occurred on this page. |
| 36 | * | 37 | * |
| @@ -42,6 +43,10 @@ | |||
| 42 | * space, they need to be kmapped separately for doing IO on the pages. The | 43 | * space, they need to be kmapped separately for doing IO on the pages. The |
| 43 | * struct page (these bits with information) are always mapped into kernel | 44 | * struct page (these bits with information) are always mapped into kernel |
| 44 | * address space... | 45 | * address space... |
| 46 | * | ||
| 47 | * PG_buddy is set to indicate that the page is free and in the buddy system | ||
| 48 | * (see mm/page_alloc.c). | ||
| 49 | * | ||
| 45 | */ | 50 | */ |
| 46 | 51 | ||
| 47 | /* | 52 | /* |
| @@ -74,7 +79,7 @@ | |||
| 74 | #define PG_checked 8 /* kill me in 2.5.<early>. */ | 79 | #define PG_checked 8 /* kill me in 2.5.<early>. */ |
| 75 | #define PG_arch_1 9 | 80 | #define PG_arch_1 9 |
| 76 | #define PG_reserved 10 | 81 | #define PG_reserved 10 |
| 77 | #define PG_private 11 /* Has something at ->private */ | 82 | #define PG_private 11 /* If pagecache, has fs-private data */ |
| 78 | 83 | ||
| 79 | #define PG_writeback 12 /* Page is under writeback */ | 84 | #define PG_writeback 12 /* Page is under writeback */ |
| 80 | #define PG_nosave 13 /* Used for system suspend/resume */ | 85 | #define PG_nosave 13 /* Used for system suspend/resume */ |
| @@ -83,7 +88,7 @@ | |||
| 83 | 88 | ||
| 84 | #define PG_mappedtodisk 16 /* Has blocks allocated on-disk */ | 89 | #define PG_mappedtodisk 16 /* Has blocks allocated on-disk */ |
| 85 | #define PG_reclaim 17 /* To be reclaimed asap */ | 90 | #define PG_reclaim 17 /* To be reclaimed asap */ |
| 86 | #define PG_nosave_free 18 /* Free, should not be written */ | 91 | #define PG_nosave_free 18 /* Used for system suspend/resume */ |
| 87 | #define PG_buddy 19 /* Page is free, on buddy lists */ | 92 | #define PG_buddy 19 /* Page is free, on buddy lists */ |
| 88 | 93 | ||
| 89 | 94 | ||
| @@ -123,12 +128,11 @@ | |||
| 123 | 128 | ||
| 124 | #define PageUptodate(page) test_bit(PG_uptodate, &(page)->flags) | 129 | #define PageUptodate(page) test_bit(PG_uptodate, &(page)->flags) |
| 125 | #ifdef CONFIG_S390 | 130 | #ifdef CONFIG_S390 |
| 126 | #define SetPageUptodate(_page) \ | 131 | static inline void SetPageUptodate(struct page *page) |
| 127 | do { \ | 132 | { |
| 128 | struct page *__page = (_page); \ | 133 | if (!test_and_set_bit(PG_uptodate, &page->flags)) |
| 129 | if (!test_and_set_bit(PG_uptodate, &__page->flags)) \ | 134 | page_test_and_clear_dirty(page); |
| 130 | page_test_and_clear_dirty(_page); \ | 135 | } |
| 131 | } while (0) | ||
| 132 | #else | 136 | #else |
| 133 | #define SetPageUptodate(page) set_bit(PG_uptodate, &(page)->flags) | 137 | #define SetPageUptodate(page) set_bit(PG_uptodate, &(page)->flags) |
| 134 | #endif | 138 | #endif |
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 0a2f5d27f6..64f9509251 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
| @@ -130,14 +130,29 @@ static inline pgoff_t linear_page_index(struct vm_area_struct *vma, | |||
| 130 | } | 130 | } |
| 131 | 131 | ||
| 132 | extern void FASTCALL(__lock_page(struct page *page)); | 132 | extern void FASTCALL(__lock_page(struct page *page)); |
| 133 | extern void FASTCALL(__lock_page_nosync(struct page *page)); | ||
| 133 | extern void FASTCALL(unlock_page(struct page *page)); | 134 | extern void FASTCALL(unlock_page(struct page *page)); |
| 134 | 135 | ||
| 136 | /* | ||
| 137 | * lock_page may only be called if we have the page's inode pinned. | ||
| 138 | */ | ||
| 135 | static inline void lock_page(struct page *page) | 139 | static inline void lock_page(struct page *page) |
| 136 | { | 140 | { |
| 137 | might_sleep(); | 141 | might_sleep(); |
| 138 | if (TestSetPageLocked(page)) | 142 | if (TestSetPageLocked(page)) |
| 139 | __lock_page(page); | 143 | __lock_page(page); |
| 140 | } | 144 | } |
| 145 | |||
| 146 | /* | ||
| 147 | * lock_page_nosync should only be used if we can't pin the page's inode. | ||
| 148 | * Doesn't play quite so well with block device plugging. | ||
| 149 | */ | ||
| 150 | static inline void lock_page_nosync(struct page *page) | ||
| 151 | { | ||
| 152 | might_sleep(); | ||
| 153 | if (TestSetPageLocked(page)) | ||
| 154 | __lock_page_nosync(page); | ||
| 155 | } | ||
| 141 | 156 | ||
| 142 | /* | 157 | /* |
| 143 | * This is exported only for wait_on_page_locked/wait_on_page_writeback. | 158 | * This is exported only for wait_on_page_locked/wait_on_page_writeback. |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 8565b81d7f..4431ce4e1e 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
| @@ -49,6 +49,7 @@ | |||
| 49 | #include <linux/types.h> | 49 | #include <linux/types.h> |
| 50 | #include <linux/ioport.h> | 50 | #include <linux/ioport.h> |
| 51 | #include <linux/list.h> | 51 | #include <linux/list.h> |
| 52 | #include <linux/compiler.h> | ||
| 52 | #include <linux/errno.h> | 53 | #include <linux/errno.h> |
| 53 | #include <linux/device.h> | 54 | #include <linux/device.h> |
| 54 | 55 | ||
| @@ -346,6 +347,8 @@ struct pci_driver { | |||
| 346 | int (*probe) (struct pci_dev *dev, const struct pci_device_id *id); /* New device inserted */ | 347 | int (*probe) (struct pci_dev *dev, const struct pci_device_id *id); /* New device inserted */ |
| 347 | void (*remove) (struct pci_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */ | 348 | void (*remove) (struct pci_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */ |
| 348 | int (*suspend) (struct pci_dev *dev, pm_message_t state); /* Device suspended */ | 349 | int (*suspend) (struct pci_dev *dev, pm_message_t state); /* Device suspended */ |
| 350 | int (*suspend_late) (struct pci_dev *dev, pm_message_t state); | ||
| 351 | int (*resume_early) (struct pci_dev *dev); | ||
| 349 | int (*resume) (struct pci_dev *dev); /* Device woken up */ | 352 | int (*resume) (struct pci_dev *dev); /* Device woken up */ |
| 350 | int (*enable_wake) (struct pci_dev *dev, pci_power_t state, int enable); /* Enable wake event */ | 353 | int (*enable_wake) (struct pci_dev *dev, pci_power_t state, int enable); /* Enable wake event */ |
| 351 | void (*shutdown) (struct pci_dev *dev); | 354 | void (*shutdown) (struct pci_dev *dev); |
| @@ -353,6 +356,8 @@ struct pci_driver { | |||
| 353 | struct pci_error_handlers *err_handler; | 356 | struct pci_error_handlers *err_handler; |
| 354 | struct device_driver driver; | 357 | struct device_driver driver; |
| 355 | struct pci_dynids dynids; | 358 | struct pci_dynids dynids; |
| 359 | |||
| 360 | int multithread_probe; | ||
| 356 | }; | 361 | }; |
| 357 | 362 | ||
| 358 | #define to_pci_driver(drv) container_of(drv,struct pci_driver, driver) | 363 | #define to_pci_driver(drv) container_of(drv,struct pci_driver, driver) |
| @@ -401,7 +406,7 @@ extern struct list_head pci_root_buses; /* list of all known PCI buses */ | |||
| 401 | extern struct list_head pci_devices; /* list of all devices */ | 406 | extern struct list_head pci_devices; /* list of all devices */ |
| 402 | 407 | ||
| 403 | void pcibios_fixup_bus(struct pci_bus *); | 408 | void pcibios_fixup_bus(struct pci_bus *); |
| 404 | int pcibios_enable_device(struct pci_dev *, int mask); | 409 | int __must_check pcibios_enable_device(struct pci_dev *, int mask); |
| 405 | char *pcibios_setup (char *str); | 410 | char *pcibios_setup (char *str); |
| 406 | 411 | ||
| 407 | /* Used only when drivers/pci/setup.c is used */ | 412 | /* Used only when drivers/pci/setup.c is used */ |
| @@ -428,7 +433,7 @@ int pci_scan_slot(struct pci_bus *bus, int devfn); | |||
| 428 | struct pci_dev * pci_scan_single_device(struct pci_bus *bus, int devfn); | 433 | struct pci_dev * pci_scan_single_device(struct pci_bus *bus, int devfn); |
| 429 | void pci_device_add(struct pci_dev *dev, struct pci_bus *bus); | 434 | void pci_device_add(struct pci_dev *dev, struct pci_bus *bus); |
| 430 | unsigned int pci_scan_child_bus(struct pci_bus *bus); | 435 | unsigned int pci_scan_child_bus(struct pci_bus *bus); |
| 431 | void pci_bus_add_device(struct pci_dev *dev); | 436 | int __must_check pci_bus_add_device(struct pci_dev *dev); |
| 432 | void pci_read_bridge_bases(struct pci_bus *child); | 437 | void pci_read_bridge_bases(struct pci_bus *child); |
| 433 | struct resource *pci_find_parent_resource(const struct pci_dev *dev, struct resource *res); | 438 | struct resource *pci_find_parent_resource(const struct pci_dev *dev, struct resource *res); |
| 434 | int pci_get_interrupt_pin(struct pci_dev *dev, struct pci_dev **bridge); | 439 | int pci_get_interrupt_pin(struct pci_dev *dev, struct pci_dev **bridge); |
| @@ -436,6 +441,7 @@ extern struct pci_dev *pci_dev_get(struct pci_dev *dev); | |||
| 436 | extern void pci_dev_put(struct pci_dev *dev); | 441 | extern void pci_dev_put(struct pci_dev *dev); |
| 437 | extern void pci_remove_bus(struct pci_bus *b); | 442 | extern void pci_remove_bus(struct pci_bus *b); |
| 438 | extern void pci_remove_bus_device(struct pci_dev *dev); | 443 | extern void pci_remove_bus_device(struct pci_dev *dev); |
| 444 | extern void pci_stop_bus_device(struct pci_dev *dev); | ||
| 439 | void pci_setup_cardbus(struct pci_bus *bus); | 445 | void pci_setup_cardbus(struct pci_bus *bus); |
| 440 | 446 | ||
| 441 | /* Generic PCI functions exported to card drivers */ | 447 | /* Generic PCI functions exported to card drivers */ |
| @@ -488,19 +494,19 @@ static inline int pci_write_config_dword(struct pci_dev *dev, int where, u32 val | |||
| 488 | return pci_bus_write_config_dword (dev->bus, dev->devfn, where, val); | 494 | return pci_bus_write_config_dword (dev->bus, dev->devfn, where, val); |
| 489 | } | 495 | } |
| 490 | 496 | ||
| 491 | int pci_enable_device(struct pci_dev *dev); | 497 | int __must_check pci_enable_device(struct pci_dev *dev); |
| 492 | int pci_enable_device_bars(struct pci_dev *dev, int mask); | 498 | int __must_check pci_enable_device_bars(struct pci_dev *dev, int mask); |
| 493 | void pci_disable_device(struct pci_dev *dev); | 499 | void pci_disable_device(struct pci_dev *dev); |
| 494 | void pci_set_master(struct pci_dev *dev); | 500 | void pci_set_master(struct pci_dev *dev); |
| 495 | #define HAVE_PCI_SET_MWI | 501 | #define HAVE_PCI_SET_MWI |
| 496 | int pci_set_mwi(struct pci_dev *dev); | 502 | int __must_check pci_set_mwi(struct pci_dev *dev); |
| 497 | void pci_clear_mwi(struct pci_dev *dev); | 503 | void pci_clear_mwi(struct pci_dev *dev); |
| 498 | void pci_intx(struct pci_dev *dev, int enable); | 504 | void pci_intx(struct pci_dev *dev, int enable); |
| 499 | int pci_set_dma_mask(struct pci_dev *dev, u64 mask); | 505 | int pci_set_dma_mask(struct pci_dev *dev, u64 mask); |
| 500 | int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask); | 506 | int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask); |
| 501 | void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno); | 507 | void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno); |
| 502 | int pci_assign_resource(struct pci_dev *dev, int i); | 508 | int __must_check pci_assign_resource(struct pci_dev *dev, int i); |
| 503 | int pci_assign_resource_fixed(struct pci_dev *dev, int i); | 509 | int __must_check pci_assign_resource_fixed(struct pci_dev *dev, int i); |
| 504 | void pci_restore_bars(struct pci_dev *dev); | 510 | void pci_restore_bars(struct pci_dev *dev); |
| 505 | 511 | ||
| 506 | /* ROM control related routines */ | 512 | /* ROM control related routines */ |
| @@ -526,23 +532,24 @@ void pdev_sort_resources(struct pci_dev *, struct resource_list *); | |||
| 526 | void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *), | 532 | void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *), |
| 527 | int (*)(struct pci_dev *, u8, u8)); | 533 | int (*)(struct pci_dev *, u8, u8)); |
| 528 | #define HAVE_PCI_REQ_REGIONS 2 | 534 | #define HAVE_PCI_REQ_REGIONS 2 |
| 529 | int pci_request_regions(struct pci_dev *, const char *); | 535 | int __must_check pci_request_regions(struct pci_dev *, const char *); |
| 530 | void pci_release_regions(struct pci_dev *); | 536 | void pci_release_regions(struct pci_dev *); |
| 531 | int pci_request_region(struct pci_dev *, int, const char *); | 537 | int __must_check pci_request_region(struct pci_dev *, int, const char *); |
| 532 | void pci_release_region(struct pci_dev *, int); | 538 | void pci_release_region(struct pci_dev *, int); |
| 533 | 539 | ||
| 534 | /* drivers/pci/bus.c */ | 540 | /* drivers/pci/bus.c */ |
| 535 | int pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res, | 541 | int __must_check pci_bus_alloc_resource(struct pci_bus *bus, |
| 536 | resource_size_t size, resource_size_t align, | 542 | struct resource *res, resource_size_t size, |
| 537 | resource_size_t min, unsigned int type_mask, | 543 | resource_size_t align, resource_size_t min, |
| 538 | void (*alignf)(void *, struct resource *, | 544 | unsigned int type_mask, |
| 539 | resource_size_t, resource_size_t), | 545 | void (*alignf)(void *, struct resource *, |
| 540 | void *alignf_data); | 546 | resource_size_t, resource_size_t), |
| 547 | void *alignf_data); | ||
| 541 | void pci_enable_bridges(struct pci_bus *bus); | 548 | void pci_enable_bridges(struct pci_bus *bus); |
| 542 | 549 | ||
| 543 | /* Proper probing supporting hot-pluggable devices */ | 550 | /* Proper probing supporting hot-pluggable devices */ |
| 544 | int __pci_register_driver(struct pci_driver *, struct module *); | 551 | int __must_check __pci_register_driver(struct pci_driver *, struct module *); |
| 545 | static inline int pci_register_driver(struct pci_driver *driver) | 552 | static inline int __must_check pci_register_driver(struct pci_driver *driver) |
| 546 | { | 553 | { |
| 547 | return __pci_register_driver(driver, THIS_MODULE); | 554 | return __pci_register_driver(driver, THIS_MODULE); |
| 548 | } | 555 | } |
| @@ -780,12 +787,13 @@ enum pci_fixup_pass { | |||
| 780 | void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev); | 787 | void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev); |
| 781 | 788 | ||
| 782 | extern int pci_pci_problems; | 789 | extern int pci_pci_problems; |
| 783 | #define PCIPCI_FAIL 1 | 790 | #define PCIPCI_FAIL 1 /* No PCI PCI DMA */ |
| 784 | #define PCIPCI_TRITON 2 | 791 | #define PCIPCI_TRITON 2 |
| 785 | #define PCIPCI_NATOMA 4 | 792 | #define PCIPCI_NATOMA 4 |
| 786 | #define PCIPCI_VIAETBF 8 | 793 | #define PCIPCI_VIAETBF 8 |
| 787 | #define PCIPCI_VSFX 16 | 794 | #define PCIPCI_VSFX 16 |
| 788 | #define PCIPCI_ALIMAGIK 32 | 795 | #define PCIPCI_ALIMAGIK 32 /* Need low latency setting */ |
| 796 | #define PCIAGP_FAIL 64 /* No PCI to AGP DMA */ | ||
| 789 | 797 | ||
| 790 | #endif /* __KERNEL__ */ | 798 | #endif /* __KERNEL__ */ |
| 791 | #endif /* LINUX_PCI_H */ | 799 | #endif /* LINUX_PCI_H */ |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 7a249155ee..c9ffbc3843 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
| @@ -479,6 +479,7 @@ | |||
| 479 | 479 | ||
| 480 | #define PCI_VENDOR_ID_AMD 0x1022 | 480 | #define PCI_VENDOR_ID_AMD 0x1022 |
| 481 | #define PCI_DEVICE_ID_AMD_K8_NB 0x1100 | 481 | #define PCI_DEVICE_ID_AMD_K8_NB 0x1100 |
| 482 | #define PCI_DEVICE_ID_AMD_K8_NB_MISC 0x1103 | ||
| 482 | #define PCI_DEVICE_ID_AMD_LANCE 0x2000 | 483 | #define PCI_DEVICE_ID_AMD_LANCE 0x2000 |
| 483 | #define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001 | 484 | #define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001 |
| 484 | #define PCI_DEVICE_ID_AMD_SCSI 0x2020 | 485 | #define PCI_DEVICE_ID_AMD_SCSI 0x2020 |
| @@ -506,6 +507,7 @@ | |||
| 506 | #define PCI_DEVICE_ID_AMD_8151_0 0x7454 | 507 | #define PCI_DEVICE_ID_AMD_8151_0 0x7454 |
| 507 | #define PCI_DEVICE_ID_AMD_8131_BRIDGE 0x7450 | 508 | #define PCI_DEVICE_ID_AMD_8131_BRIDGE 0x7450 |
| 508 | #define PCI_DEVICE_ID_AMD_8131_APIC 0x7451 | 509 | #define PCI_DEVICE_ID_AMD_8131_APIC 0x7451 |
| 510 | #define PCI_DEVICE_ID_AMD_8132_BRIDGE 0x7458 | ||
| 509 | #define PCI_DEVICE_ID_AMD_CS5536_ISA 0x2090 | 511 | #define PCI_DEVICE_ID_AMD_CS5536_ISA 0x2090 |
| 510 | #define PCI_DEVICE_ID_AMD_CS5536_FLASH 0x2091 | 512 | #define PCI_DEVICE_ID_AMD_CS5536_FLASH 0x2091 |
| 511 | #define PCI_DEVICE_ID_AMD_CS5536_AUDIO 0x2093 | 513 | #define PCI_DEVICE_ID_AMD_CS5536_AUDIO 0x2093 |
| @@ -1411,6 +1413,7 @@ | |||
| 1411 | #define PCI_DEVICE_ID_SERVERWORKS_LE 0x0009 | 1413 | #define PCI_DEVICE_ID_SERVERWORKS_LE 0x0009 |
| 1412 | #define PCI_DEVICE_ID_SERVERWORKS_GCNB_LE 0x0017 | 1414 | #define PCI_DEVICE_ID_SERVERWORKS_GCNB_LE 0x0017 |
| 1413 | #define PCI_DEVICE_ID_SERVERWORKS_EPB 0x0103 | 1415 | #define PCI_DEVICE_ID_SERVERWORKS_EPB 0x0103 |
| 1416 | #define PCI_DEVICE_ID_SERVERWORKS_HT2000_PCIE 0x0132 | ||
| 1414 | #define PCI_DEVICE_ID_SERVERWORKS_OSB4 0x0200 | 1417 | #define PCI_DEVICE_ID_SERVERWORKS_OSB4 0x0200 |
| 1415 | #define PCI_DEVICE_ID_SERVERWORKS_CSB5 0x0201 | 1418 | #define PCI_DEVICE_ID_SERVERWORKS_CSB5 0x0201 |
| 1416 | #define PCI_DEVICE_ID_SERVERWORKS_CSB6 0x0203 | 1419 | #define PCI_DEVICE_ID_SERVERWORKS_CSB6 0x0203 |
| @@ -1482,9 +1485,6 @@ | |||
| 1482 | #define PCI_DEVICE_ID_MARVELL_GT64260 0x6430 | 1485 | #define PCI_DEVICE_ID_MARVELL_GT64260 0x6430 |
| 1483 | #define PCI_DEVICE_ID_MARVELL_MV64360 0x6460 | 1486 | #define PCI_DEVICE_ID_MARVELL_MV64360 0x6460 |
| 1484 | #define PCI_DEVICE_ID_MARVELL_MV64460 0x6480 | 1487 | #define PCI_DEVICE_ID_MARVELL_MV64460 0x6480 |
| 1485 | #define PCI_DEVICE_ID_MARVELL_GT96100 0x9652 | ||
| 1486 | #define PCI_DEVICE_ID_MARVELL_GT96100A 0x9653 | ||
| 1487 | |||
| 1488 | 1488 | ||
| 1489 | #define PCI_VENDOR_ID_V3 0x11b0 | 1489 | #define PCI_VENDOR_ID_V3 0x11b0 |
| 1490 | #define PCI_DEVICE_ID_V3_V960 0x0001 | 1490 | #define PCI_DEVICE_ID_V3_V960 0x0001 |
| @@ -1905,6 +1905,7 @@ | |||
| 1905 | #define PCI_DEVICE_ID_TIGON3_5705_2 0x1654 | 1905 | #define PCI_DEVICE_ID_TIGON3_5705_2 0x1654 |
| 1906 | #define PCI_DEVICE_ID_TIGON3_5720 0x1658 | 1906 | #define PCI_DEVICE_ID_TIGON3_5720 0x1658 |
| 1907 | #define PCI_DEVICE_ID_TIGON3_5721 0x1659 | 1907 | #define PCI_DEVICE_ID_TIGON3_5721 0x1659 |
| 1908 | #define PCI_DEVICE_ID_TIGON3_5722 0x165a | ||
| 1908 | #define PCI_DEVICE_ID_TIGON3_5705M 0x165d | 1909 | #define PCI_DEVICE_ID_TIGON3_5705M 0x165d |
| 1909 | #define PCI_DEVICE_ID_TIGON3_5705M_2 0x165e | 1910 | #define PCI_DEVICE_ID_TIGON3_5705M_2 0x165e |
| 1910 | #define PCI_DEVICE_ID_TIGON3_5714 0x1668 | 1911 | #define PCI_DEVICE_ID_TIGON3_5714 0x1668 |
| @@ -1914,6 +1915,7 @@ | |||
| 1914 | #define PCI_DEVICE_ID_TIGON3_5705F 0x166e | 1915 | #define PCI_DEVICE_ID_TIGON3_5705F 0x166e |
| 1915 | #define PCI_DEVICE_ID_TIGON3_5754M 0x1672 | 1916 | #define PCI_DEVICE_ID_TIGON3_5754M 0x1672 |
| 1916 | #define PCI_DEVICE_ID_TIGON3_5755M 0x1673 | 1917 | #define PCI_DEVICE_ID_TIGON3_5755M 0x1673 |
| 1918 | #define PCI_DEVICE_ID_TIGON3_5756 0x1674 | ||
| 1917 | #define PCI_DEVICE_ID_TIGON3_5750 0x1676 | 1919 | #define PCI_DEVICE_ID_TIGON3_5750 0x1676 |
| 1918 | #define PCI_DEVICE_ID_TIGON3_5751 0x1677 | 1920 | #define PCI_DEVICE_ID_TIGON3_5751 0x1677 |
| 1919 | #define PCI_DEVICE_ID_TIGON3_5715 0x1678 | 1921 | #define PCI_DEVICE_ID_TIGON3_5715 0x1678 |
| @@ -1943,6 +1945,8 @@ | |||
| 1943 | #define PCI_DEVICE_ID_TIGON3_5901 0x170d | 1945 | #define PCI_DEVICE_ID_TIGON3_5901 0x170d |
| 1944 | #define PCI_DEVICE_ID_BCM4401B1 0x170c | 1946 | #define PCI_DEVICE_ID_BCM4401B1 0x170c |
| 1945 | #define PCI_DEVICE_ID_TIGON3_5901_2 0x170e | 1947 | #define PCI_DEVICE_ID_TIGON3_5901_2 0x170e |
| 1948 | #define PCI_DEVICE_ID_TIGON3_5906 0x1712 | ||
| 1949 | #define PCI_DEVICE_ID_TIGON3_5906M 0x1713 | ||
| 1946 | #define PCI_DEVICE_ID_BCM4401 0x4401 | 1950 | #define PCI_DEVICE_ID_BCM4401 0x4401 |
| 1947 | #define PCI_DEVICE_ID_BCM4401B0 0x4402 | 1951 | #define PCI_DEVICE_ID_BCM4401B0 0x4402 |
| 1948 | 1952 | ||
| @@ -2010,6 +2014,23 @@ | |||
| 2010 | #define PCI_DEVICE_ID_ALTIMA_AC9100 0x03ea | 2014 | #define PCI_DEVICE_ID_ALTIMA_AC9100 0x03ea |
| 2011 | #define PCI_DEVICE_ID_ALTIMA_AC1003 0x03eb | 2015 | #define PCI_DEVICE_ID_ALTIMA_AC1003 0x03eb |
| 2012 | 2016 | ||
| 2017 | #define PCI_VENDOR_ID_ARECA 0x17d3 | ||
| 2018 | #define PCI_DEVICE_ID_ARECA_1110 0x1110 | ||
| 2019 | #define PCI_DEVICE_ID_ARECA_1120 0x1120 | ||
| 2020 | #define PCI_DEVICE_ID_ARECA_1130 0x1130 | ||
| 2021 | #define PCI_DEVICE_ID_ARECA_1160 0x1160 | ||
| 2022 | #define PCI_DEVICE_ID_ARECA_1170 0x1170 | ||
| 2023 | #define PCI_DEVICE_ID_ARECA_1210 0x1210 | ||
| 2024 | #define PCI_DEVICE_ID_ARECA_1220 0x1220 | ||
| 2025 | #define PCI_DEVICE_ID_ARECA_1230 0x1230 | ||
| 2026 | #define PCI_DEVICE_ID_ARECA_1260 0x1260 | ||
| 2027 | #define PCI_DEVICE_ID_ARECA_1270 0x1270 | ||
| 2028 | #define PCI_DEVICE_ID_ARECA_1280 0x1280 | ||
| 2029 | #define PCI_DEVICE_ID_ARECA_1380 0x1380 | ||
| 2030 | #define PCI_DEVICE_ID_ARECA_1381 0x1381 | ||
| 2031 | #define PCI_DEVICE_ID_ARECA_1680 0x1680 | ||
| 2032 | #define PCI_DEVICE_ID_ARECA_1681 0x1681 | ||
| 2033 | |||
| 2013 | #define PCI_VENDOR_ID_S2IO 0x17d5 | 2034 | #define PCI_VENDOR_ID_S2IO 0x17d5 |
| 2014 | #define PCI_DEVICE_ID_S2IO_WIN 0x5731 | 2035 | #define PCI_DEVICE_ID_S2IO_WIN 0x5731 |
| 2015 | #define PCI_DEVICE_ID_S2IO_UNI 0x5831 | 2036 | #define PCI_DEVICE_ID_S2IO_UNI 0x5831 |
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h index 96930cb592..7d0e26cba4 100644 --- a/include/linux/pci_regs.h +++ b/include/linux/pci_regs.h | |||
| @@ -196,7 +196,7 @@ | |||
| 196 | #define PCI_CAP_ID_MSI 0x05 /* Message Signalled Interrupts */ | 196 | #define PCI_CAP_ID_MSI 0x05 /* Message Signalled Interrupts */ |
| 197 | #define PCI_CAP_ID_CHSWP 0x06 /* CompactPCI HotSwap */ | 197 | #define PCI_CAP_ID_CHSWP 0x06 /* CompactPCI HotSwap */ |
| 198 | #define PCI_CAP_ID_PCIX 0x07 /* PCI-X */ | 198 | #define PCI_CAP_ID_PCIX 0x07 /* PCI-X */ |
| 199 | #define PCI_CAP_ID_HT_IRQCONF 0x08 /* HyperTransport IRQ Configuration */ | 199 | #define PCI_CAP_ID_HT 0x08 /* HyperTransport */ |
| 200 | #define PCI_CAP_ID_VNDR 0x09 /* Vendor specific capability */ | 200 | #define PCI_CAP_ID_VNDR 0x09 /* Vendor specific capability */ |
| 201 | #define PCI_CAP_ID_SHPC 0x0C /* PCI Standard Hot-Plug Controller */ | 201 | #define PCI_CAP_ID_SHPC 0x0C /* PCI Standard Hot-Plug Controller */ |
| 202 | #define PCI_CAP_ID_EXP 0x10 /* PCI Express */ | 202 | #define PCI_CAP_ID_EXP 0x10 /* PCI Express */ |
diff --git a/include/linux/pcieport_if.h b/include/linux/pcieport_if.h index b44e01a709..6cd91e3f98 100644 --- a/include/linux/pcieport_if.h +++ b/include/linux/pcieport_if.h | |||
| @@ -62,6 +62,12 @@ struct pcie_port_service_driver { | |||
| 62 | int (*suspend) (struct pcie_device *dev, pm_message_t state); | 62 | int (*suspend) (struct pcie_device *dev, pm_message_t state); |
| 63 | int (*resume) (struct pcie_device *dev); | 63 | int (*resume) (struct pcie_device *dev); |
| 64 | 64 | ||
| 65 | /* Service Error Recovery Handler */ | ||
| 66 | struct pci_error_handlers *err_handler; | ||
| 67 | |||
| 68 | /* Link Reset Capability - AER service driver specific */ | ||
| 69 | pci_ers_result_t (*reset_link) (struct pci_dev *dev); | ||
| 70 | |||
| 65 | const struct pcie_port_service_id *id_table; | 71 | const struct pcie_port_service_id *id_table; |
| 66 | struct device_driver driver; | 72 | struct device_driver driver; |
| 67 | }; | 73 | }; |
diff --git a/include/linux/percpu.h b/include/linux/percpu.h index cb9039a21f..46ec72fa2c 100644 --- a/include/linux/percpu.h +++ b/include/linux/percpu.h | |||
| @@ -1,9 +1,12 @@ | |||
| 1 | #ifndef __LINUX_PERCPU_H | 1 | #ifndef __LINUX_PERCPU_H |
| 2 | #define __LINUX_PERCPU_H | 2 | #define __LINUX_PERCPU_H |
| 3 | |||
| 3 | #include <linux/spinlock.h> /* For preempt_disable() */ | 4 | #include <linux/spinlock.h> /* For preempt_disable() */ |
| 4 | #include <linux/slab.h> /* For kmalloc() */ | 5 | #include <linux/slab.h> /* For kmalloc() */ |
| 5 | #include <linux/smp.h> | 6 | #include <linux/smp.h> |
| 6 | #include <linux/string.h> /* For memset() */ | 7 | #include <linux/string.h> /* For memset() */ |
| 8 | #include <linux/cpumask.h> | ||
| 9 | |||
| 7 | #include <asm/percpu.h> | 10 | #include <asm/percpu.h> |
| 8 | 11 | ||
| 9 | /* Enough to cover all DEFINE_PER_CPUs in kernel, including modules. */ | 12 | /* Enough to cover all DEFINE_PER_CPUs in kernel, including modules. */ |
| @@ -11,8 +14,14 @@ | |||
| 11 | #define PERCPU_ENOUGH_ROOM 32768 | 14 | #define PERCPU_ENOUGH_ROOM 32768 |
| 12 | #endif | 15 | #endif |
| 13 | 16 | ||
| 14 | /* Must be an lvalue. */ | 17 | /* |
| 15 | #define get_cpu_var(var) (*({ preempt_disable(); &__get_cpu_var(var); })) | 18 | * Must be an lvalue. Since @var must be a simple identifier, |
| 19 | * we force a syntax error here if it isn't. | ||
| 20 | */ | ||
| 21 | #define get_cpu_var(var) (*({ \ | ||
| 22 | extern int simple_indentifier_##var(void); \ | ||
| 23 | preempt_disable(); \ | ||
| 24 | &__get_cpu_var(var); })) | ||
| 16 | #define put_cpu_var(var) preempt_enable() | 25 | #define put_cpu_var(var) preempt_enable() |
| 17 | 26 | ||
| 18 | #ifdef CONFIG_SMP | 27 | #ifdef CONFIG_SMP |
| @@ -21,39 +30,77 @@ struct percpu_data { | |||
| 21 | void *ptrs[NR_CPUS]; | 30 | void *ptrs[NR_CPUS]; |
| 22 | }; | 31 | }; |
| 23 | 32 | ||
| 33 | #define __percpu_disguise(pdata) (struct percpu_data *)~(unsigned long)(pdata) | ||
| 24 | /* | 34 | /* |
| 25 | * Use this to get to a cpu's version of the per-cpu object allocated using | 35 | * Use this to get to a cpu's version of the per-cpu object dynamically |
| 26 | * alloc_percpu. Non-atomic access to the current CPU's version should | 36 | * allocated. Non-atomic access to the current CPU's version should |
| 27 | * probably be combined with get_cpu()/put_cpu(). | 37 | * probably be combined with get_cpu()/put_cpu(). |
| 28 | */ | 38 | */ |
| 29 | #define per_cpu_ptr(ptr, cpu) \ | 39 | #define percpu_ptr(ptr, cpu) \ |
| 30 | ({ \ | 40 | ({ \ |
| 31 | struct percpu_data *__p = (struct percpu_data *)~(unsigned long)(ptr); \ | 41 | struct percpu_data *__p = __percpu_disguise(ptr); \ |
| 32 | (__typeof__(ptr))__p->ptrs[(cpu)]; \ | 42 | (__typeof__(ptr))__p->ptrs[(cpu)]; \ |
| 33 | }) | 43 | }) |
| 34 | 44 | ||
| 35 | extern void *__alloc_percpu(size_t size); | 45 | extern void *percpu_populate(void *__pdata, size_t size, gfp_t gfp, int cpu); |
| 36 | extern void free_percpu(const void *); | 46 | extern void percpu_depopulate(void *__pdata, int cpu); |
| 47 | extern int __percpu_populate_mask(void *__pdata, size_t size, gfp_t gfp, | ||
| 48 | cpumask_t *mask); | ||
| 49 | extern void __percpu_depopulate_mask(void *__pdata, cpumask_t *mask); | ||
| 50 | extern void *__percpu_alloc_mask(size_t size, gfp_t gfp, cpumask_t *mask); | ||
| 51 | extern void percpu_free(void *__pdata); | ||
| 37 | 52 | ||
| 38 | #else /* CONFIG_SMP */ | 53 | #else /* CONFIG_SMP */ |
| 39 | 54 | ||
| 40 | #define per_cpu_ptr(ptr, cpu) ({ (void)(cpu); (ptr); }) | 55 | #define percpu_ptr(ptr, cpu) ({ (void)(cpu); (ptr); }) |
| 56 | |||
| 57 | static inline void percpu_depopulate(void *__pdata, int cpu) | ||
| 58 | { | ||
| 59 | } | ||
| 60 | |||
| 61 | static inline void __percpu_depopulate_mask(void *__pdata, cpumask_t *mask) | ||
| 62 | { | ||
| 63 | } | ||
| 41 | 64 | ||
| 42 | static inline void *__alloc_percpu(size_t size) | 65 | static inline void *percpu_populate(void *__pdata, size_t size, gfp_t gfp, |
| 66 | int cpu) | ||
| 43 | { | 67 | { |
| 44 | void *ret = kmalloc(size, GFP_KERNEL); | 68 | return percpu_ptr(__pdata, cpu); |
| 45 | if (ret) | ||
| 46 | memset(ret, 0, size); | ||
| 47 | return ret; | ||
| 48 | } | 69 | } |
| 49 | static inline void free_percpu(const void *ptr) | 70 | |
| 50 | { | 71 | static inline int __percpu_populate_mask(void *__pdata, size_t size, gfp_t gfp, |
| 51 | kfree(ptr); | 72 | cpumask_t *mask) |
| 73 | { | ||
| 74 | return 0; | ||
| 75 | } | ||
| 76 | |||
| 77 | static __always_inline void *__percpu_alloc_mask(size_t size, gfp_t gfp, cpumask_t *mask) | ||
| 78 | { | ||
| 79 | return kzalloc(size, gfp); | ||
| 80 | } | ||
| 81 | |||
| 82 | static inline void percpu_free(void *__pdata) | ||
| 83 | { | ||
| 84 | kfree(__pdata); | ||
| 52 | } | 85 | } |
| 53 | 86 | ||
| 54 | #endif /* CONFIG_SMP */ | 87 | #endif /* CONFIG_SMP */ |
| 55 | 88 | ||
| 56 | /* Simple wrapper for the common case: zeros memory. */ | 89 | #define percpu_populate_mask(__pdata, size, gfp, mask) \ |
| 57 | #define alloc_percpu(type) ((type *)(__alloc_percpu(sizeof(type)))) | 90 | __percpu_populate_mask((__pdata), (size), (gfp), &(mask)) |
| 91 | #define percpu_depopulate_mask(__pdata, mask) \ | ||
| 92 | __percpu_depopulate_mask((__pdata), &(mask)) | ||
| 93 | #define percpu_alloc_mask(size, gfp, mask) \ | ||
| 94 | __percpu_alloc_mask((size), (gfp), &(mask)) | ||
| 95 | |||
| 96 | #define percpu_alloc(size, gfp) percpu_alloc_mask((size), (gfp), cpu_online_map) | ||
| 97 | |||
| 98 | /* (legacy) interface for use without CPU hotplug handling */ | ||
| 99 | |||
| 100 | #define __alloc_percpu(size) percpu_alloc_mask((size), GFP_KERNEL, \ | ||
| 101 | cpu_possible_map) | ||
| 102 | #define alloc_percpu(type) (type *)__alloc_percpu(sizeof(type)) | ||
| 103 | #define free_percpu(ptr) percpu_free((ptr)) | ||
| 104 | #define per_cpu_ptr(ptr, cpu) percpu_ptr((ptr), (cpu)) | ||
| 58 | 105 | ||
| 59 | #endif /* __LINUX_PERCPU_H */ | 106 | #endif /* __LINUX_PERCPU_H */ |
diff --git a/include/linux/pid.h b/include/linux/pid.h index 29960b03be..93da7e2d9f 100644 --- a/include/linux/pid.h +++ b/include/linux/pid.h | |||
| @@ -76,6 +76,8 @@ extern int FASTCALL(attach_pid(struct task_struct *task, | |||
| 76 | enum pid_type type, int nr)); | 76 | enum pid_type type, int nr)); |
| 77 | 77 | ||
| 78 | extern void FASTCALL(detach_pid(struct task_struct *task, enum pid_type)); | 78 | extern void FASTCALL(detach_pid(struct task_struct *task, enum pid_type)); |
| 79 | extern void FASTCALL(transfer_pid(struct task_struct *old, | ||
| 80 | struct task_struct *new, enum pid_type)); | ||
| 79 | 81 | ||
| 80 | /* | 82 | /* |
| 81 | * look up a PID in the hash table. Must be called with the tasklist_lock | 83 | * look up a PID in the hash table. Must be called with the tasklist_lock |
diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h index bd2c5a2bbb..c3f01b3085 100644 --- a/include/linux/pkt_cls.h +++ b/include/linux/pkt_cls.h | |||
| @@ -305,6 +305,7 @@ enum | |||
| 305 | TCA_FW_POLICE, | 305 | TCA_FW_POLICE, |
| 306 | TCA_FW_INDEV, /* used by CONFIG_NET_CLS_IND */ | 306 | TCA_FW_INDEV, /* used by CONFIG_NET_CLS_IND */ |
| 307 | TCA_FW_ACT, /* used by CONFIG_NET_CLS_ACT */ | 307 | TCA_FW_ACT, /* used by CONFIG_NET_CLS_ACT */ |
| 308 | TCA_FW_MASK, | ||
| 308 | __TCA_FW_MAX | 309 | __TCA_FW_MAX |
| 309 | }; | 310 | }; |
| 310 | 311 | ||
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index 782090c689..29cd6dee13 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h | |||
| @@ -49,6 +49,8 @@ struct platform_driver { | |||
| 49 | int (*remove)(struct platform_device *); | 49 | int (*remove)(struct platform_device *); |
| 50 | void (*shutdown)(struct platform_device *); | 50 | void (*shutdown)(struct platform_device *); |
| 51 | int (*suspend)(struct platform_device *, pm_message_t state); | 51 | int (*suspend)(struct platform_device *, pm_message_t state); |
| 52 | int (*suspend_late)(struct platform_device *, pm_message_t state); | ||
| 53 | int (*resume_early)(struct platform_device *); | ||
| 52 | int (*resume)(struct platform_device *); | 54 | int (*resume)(struct platform_device *); |
| 53 | struct device_driver driver; | 55 | struct device_driver driver; |
| 54 | }; | 56 | }; |
diff --git a/include/linux/pm.h b/include/linux/pm.h index 658c1b93d5..6b27e07aef 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
| @@ -142,29 +142,61 @@ typedef struct pm_message { | |||
| 142 | } pm_message_t; | 142 | } pm_message_t; |
| 143 | 143 | ||
| 144 | /* | 144 | /* |
| 145 | * There are 4 important states driver can be in: | 145 | * Several driver power state transitions are externally visible, affecting |
| 146 | * ON -- driver is working | 146 | * the state of pending I/O queues and (for drivers that touch hardware) |
| 147 | * FREEZE -- stop operations and apply whatever policy is applicable to a | 147 | * interrupts, wakeups, DMA, and other hardware state. There may also be |
| 148 | * suspended driver of that class, freeze queues for block like IDE | 148 | * internal transitions to various low power modes, which are transparent |
| 149 | * does, drop packets for ethernet, etc... stop DMA engine too etc... | 149 | * to the rest of the driver stack (such as a driver that's ON gating off |
| 150 | * so a consistent image can be saved; but do not power any hardware | 150 | * clocks which are not in active use). |
| 151 | * down. | ||
| 152 | * SUSPEND - like FREEZE, but hardware is doing as much powersaving as | ||
| 153 | * possible. Roughly pci D3. | ||
| 154 | * | 151 | * |
| 155 | * Unfortunately, current drivers only recognize numeric values 0 (ON) and 3 | 152 | * One transition is triggered by resume(), after a suspend() call; the |
| 156 | * (SUSPEND). We'll need to fix the drivers. So yes, putting 3 to all different | 153 | * message is implicit: |
| 157 | * defines is intentional, and will go away as soon as drivers are fixed. Also | 154 | * |
| 158 | * note that typedef is neccessary, we'll probably want to switch to | 155 | * ON Driver starts working again, responding to hardware events |
| 159 | * typedef struct pm_message_t { int event; int flags; } pm_message_t | 156 | * and software requests. The hardware may have gone through |
| 160 | * or something similar soon. | 157 | * a power-off reset, or it may have maintained state from the |
| 158 | * previous suspend() which the driver will rely on while | ||
| 159 | * resuming. On most platforms, there are no restrictions on | ||
| 160 | * availability of resources like clocks during resume(). | ||
| 161 | * | ||
| 162 | * Other transitions are triggered by messages sent using suspend(). All | ||
| 163 | * these transitions quiesce the driver, so that I/O queues are inactive. | ||
| 164 | * That commonly entails turning off IRQs and DMA; there may be rules | ||
| 165 | * about how to quiesce that are specific to the bus or the device's type. | ||
| 166 | * (For example, network drivers mark the link state.) Other details may | ||
| 167 | * differ according to the message: | ||
| 168 | * | ||
| 169 | * SUSPEND Quiesce, enter a low power device state appropriate for | ||
| 170 | * the upcoming system state (such as PCI_D3hot), and enable | ||
| 171 | * wakeup events as appropriate. | ||
| 172 | * | ||
| 173 | * FREEZE Quiesce operations so that a consistent image can be saved; | ||
| 174 | * but do NOT otherwise enter a low power device state, and do | ||
| 175 | * NOT emit system wakeup events. | ||
| 176 | * | ||
| 177 | * PRETHAW Quiesce as if for FREEZE; additionally, prepare for restoring | ||
| 178 | * the system from a snapshot taken after an earlier FREEZE. | ||
| 179 | * Some drivers will need to reset their hardware state instead | ||
| 180 | * of preserving it, to ensure that it's never mistaken for the | ||
| 181 | * state which that earlier snapshot had set up. | ||
| 182 | * | ||
| 183 | * A minimally power-aware driver treats all messages as SUSPEND, fully | ||
| 184 | * reinitializes its device during resume() -- whether or not it was reset | ||
| 185 | * during the suspend/resume cycle -- and can't issue wakeup events. | ||
| 186 | * | ||
| 187 | * More power-aware drivers may also use low power states at runtime as | ||
| 188 | * well as during system sleep states like PM_SUSPEND_STANDBY. They may | ||
| 189 | * be able to use wakeup events to exit from runtime low-power states, | ||
| 190 | * or from system low-power states such as standby or suspend-to-RAM. | ||
| 161 | */ | 191 | */ |
| 162 | 192 | ||
| 163 | #define PM_EVENT_ON 0 | 193 | #define PM_EVENT_ON 0 |
| 164 | #define PM_EVENT_FREEZE 1 | 194 | #define PM_EVENT_FREEZE 1 |
| 165 | #define PM_EVENT_SUSPEND 2 | 195 | #define PM_EVENT_SUSPEND 2 |
| 196 | #define PM_EVENT_PRETHAW 3 | ||
| 166 | 197 | ||
| 167 | #define PMSG_FREEZE ((struct pm_message){ .event = PM_EVENT_FREEZE, }) | 198 | #define PMSG_FREEZE ((struct pm_message){ .event = PM_EVENT_FREEZE, }) |
| 199 | #define PMSG_PRETHAW ((struct pm_message){ .event = PM_EVENT_PRETHAW, }) | ||
| 168 | #define PMSG_SUSPEND ((struct pm_message){ .event = PM_EVENT_SUSPEND, }) | 200 | #define PMSG_SUSPEND ((struct pm_message){ .event = PM_EVENT_SUSPEND, }) |
| 169 | #define PMSG_ON ((struct pm_message){ .event = PM_EVENT_ON, }) | 201 | #define PMSG_ON ((struct pm_message){ .event = PM_EVENT_ON, }) |
| 170 | 202 | ||
| @@ -190,6 +222,7 @@ extern void device_resume(void); | |||
| 190 | extern suspend_disk_method_t pm_disk_mode; | 222 | extern suspend_disk_method_t pm_disk_mode; |
| 191 | 223 | ||
| 192 | extern int device_suspend(pm_message_t state); | 224 | extern int device_suspend(pm_message_t state); |
| 225 | extern int device_prepare_suspend(pm_message_t state); | ||
| 193 | 226 | ||
| 194 | #define device_set_wakeup_enable(dev,val) \ | 227 | #define device_set_wakeup_enable(dev,val) \ |
| 195 | ((dev)->power.should_wakeup = !!(val)) | 228 | ((dev)->power.should_wakeup = !!(val)) |
diff --git a/include/linux/posix-timers.h b/include/linux/posix-timers.h index 95572c434b..a7dd38f30a 100644 --- a/include/linux/posix-timers.h +++ b/include/linux/posix-timers.h | |||
| @@ -72,6 +72,7 @@ struct k_clock { | |||
| 72 | int (*timer_create) (struct k_itimer *timer); | 72 | int (*timer_create) (struct k_itimer *timer); |
| 73 | int (*nsleep) (const clockid_t which_clock, int flags, | 73 | int (*nsleep) (const clockid_t which_clock, int flags, |
| 74 | struct timespec *, struct timespec __user *); | 74 | struct timespec *, struct timespec __user *); |
| 75 | long (*nsleep_restart) (struct restart_block *restart_block); | ||
| 75 | int (*timer_set) (struct k_itimer * timr, int flags, | 76 | int (*timer_set) (struct k_itimer * timr, int flags, |
| 76 | struct itimerspec * new_setting, | 77 | struct itimerspec * new_setting, |
| 77 | struct itimerspec * old_setting); | 78 | struct itimerspec * old_setting); |
| @@ -97,6 +98,7 @@ int posix_cpu_clock_set(const clockid_t which_clock, const struct timespec *ts); | |||
| 97 | int posix_cpu_timer_create(struct k_itimer *timer); | 98 | int posix_cpu_timer_create(struct k_itimer *timer); |
| 98 | int posix_cpu_nsleep(const clockid_t which_clock, int flags, | 99 | int posix_cpu_nsleep(const clockid_t which_clock, int flags, |
| 99 | struct timespec *rqtp, struct timespec __user *rmtp); | 100 | struct timespec *rqtp, struct timespec __user *rmtp); |
| 101 | long posix_cpu_nsleep_restart(struct restart_block *restart_block); | ||
| 100 | int posix_cpu_timer_set(struct k_itimer *timer, int flags, | 102 | int posix_cpu_timer_set(struct k_itimer *timer, int flags, |
| 101 | struct itimerspec *new, struct itimerspec *old); | 103 | struct itimerspec *new, struct itimerspec *old); |
| 102 | int posix_cpu_timer_del(struct k_itimer *timer); | 104 | int posix_cpu_timer_del(struct k_itimer *timer); |
| @@ -111,4 +113,6 @@ void posix_cpu_timers_exit_group(struct task_struct *task); | |||
| 111 | void set_process_cpu_timer(struct task_struct *task, unsigned int clock_idx, | 113 | void set_process_cpu_timer(struct task_struct *task, unsigned int clock_idx, |
| 112 | cputime_t *newval, cputime_t *oldval); | 114 | cputime_t *newval, cputime_t *oldval); |
| 113 | 115 | ||
| 116 | long clock_nanosleep_restart(struct restart_block *restart_block); | ||
| 117 | |||
| 114 | #endif | 118 | #endif |
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index 17e75783e3..57f70bc8b2 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | #include <linux/slab.h> | 4 | #include <linux/slab.h> |
| 5 | #include <linux/fs.h> | 5 | #include <linux/fs.h> |
| 6 | #include <linux/spinlock.h> | 6 | #include <linux/spinlock.h> |
| 7 | #include <linux/magic.h> | ||
| 7 | #include <asm/atomic.h> | 8 | #include <asm/atomic.h> |
| 8 | 9 | ||
| 9 | /* | 10 | /* |
| @@ -24,8 +25,6 @@ enum { | |||
| 24 | PROC_ROOT_INO = 1, | 25 | PROC_ROOT_INO = 1, |
| 25 | }; | 26 | }; |
| 26 | 27 | ||
| 27 | #define PROC_SUPER_MAGIC 0x9fa0 | ||
| 28 | |||
| 29 | /* | 28 | /* |
| 30 | * This is not completely implemented yet. The idea is to | 29 | * This is not completely implemented yet. The idea is to |
| 31 | * create an in-memory tree (like the actual /proc filesystem | 30 | * create an in-memory tree (like the actual /proc filesystem |
| @@ -269,7 +268,9 @@ static inline struct proc_dir_entry *PDE(const struct inode *inode) | |||
| 269 | struct proc_maps_private { | 268 | struct proc_maps_private { |
| 270 | struct pid *pid; | 269 | struct pid *pid; |
| 271 | struct task_struct *task; | 270 | struct task_struct *task; |
| 271 | #ifdef CONFIG_MMU | ||
| 272 | struct vm_area_struct *tail_vma; | 272 | struct vm_area_struct *tail_vma; |
| 273 | #endif | ||
| 273 | }; | 274 | }; |
| 274 | 275 | ||
| 275 | #endif /* _LINUX_PROC_FS_H */ | 276 | #endif /* _LINUX_PROC_FS_H */ |
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index 8b2749a259..eeb1976ef7 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h | |||
| @@ -16,8 +16,8 @@ | |||
| 16 | #define PTRACE_KILL 8 | 16 | #define PTRACE_KILL 8 |
| 17 | #define PTRACE_SINGLESTEP 9 | 17 | #define PTRACE_SINGLESTEP 9 |
| 18 | 18 | ||
| 19 | #define PTRACE_ATTACH 0x10 | 19 | #define PTRACE_ATTACH 16 |
| 20 | #define PTRACE_DETACH 0x11 | 20 | #define PTRACE_DETACH 17 |
| 21 | 21 | ||
| 22 | #define PTRACE_SYSCALL 24 | 22 | #define PTRACE_SYSCALL 24 |
| 23 | 23 | ||
diff --git a/include/linux/qnx4_fs.h b/include/linux/qnx4_fs.h index 27f49c85d5..0c7ac444fd 100644 --- a/include/linux/qnx4_fs.h +++ b/include/linux/qnx4_fs.h | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #define _LINUX_QNX4_FS_H | 11 | #define _LINUX_QNX4_FS_H |
| 12 | 12 | ||
| 13 | #include <linux/qnxtypes.h> | 13 | #include <linux/qnxtypes.h> |
| 14 | #include <linux/magic.h> | ||
| 14 | 15 | ||
| 15 | #define QNX4_ROOT_INO 1 | 16 | #define QNX4_ROOT_INO 1 |
| 16 | 17 | ||
| @@ -25,7 +26,6 @@ | |||
| 25 | 26 | ||
| 26 | #define QNX4_I_MAP_SLOTS 8 | 27 | #define QNX4_I_MAP_SLOTS 8 |
| 27 | #define QNX4_Z_MAP_SLOTS 64 | 28 | #define QNX4_Z_MAP_SLOTS 64 |
| 28 | #define QNX4_SUPER_MAGIC 0x002f /* qnx4 fs detection */ | ||
| 29 | #define QNX4_VALID_FS 0x0001 /* Clean fs. */ | 29 | #define QNX4_VALID_FS 0x0001 /* Clean fs. */ |
| 30 | #define QNX4_ERROR_FS 0x0002 /* fs has errors. */ | 30 | #define QNX4_ERROR_FS 0x0002 /* fs has errors. */ |
| 31 | #define QNX4_BLOCK_SIZE 0x200 /* blocksize of 512 bytes */ | 31 | #define QNX4_BLOCK_SIZE 0x200 /* blocksize of 512 bytes */ |
diff --git a/include/linux/raid/Kbuild b/include/linux/raid/Kbuild index 73fa27a8d5..2415a64c5e 100644 --- a/include/linux/raid/Kbuild +++ b/include/linux/raid/Kbuild | |||
| @@ -1 +1,2 @@ | |||
| 1 | header-y += md_p.h md_u.h | 1 | header-y += md_p.h |
| 2 | header-y += md_u.h | ||
diff --git a/include/linux/raid/md.h b/include/linux/raid/md.h index eb3e547c8f..c588709acb 100644 --- a/include/linux/raid/md.h +++ b/include/linux/raid/md.h | |||
| @@ -53,6 +53,8 @@ | |||
| 53 | #include <linux/raid/md_u.h> | 53 | #include <linux/raid/md_u.h> |
| 54 | #include <linux/raid/md_k.h> | 54 | #include <linux/raid/md_k.h> |
| 55 | 55 | ||
| 56 | #ifdef CONFIG_MD | ||
| 57 | |||
| 56 | /* | 58 | /* |
| 57 | * Different major versions are not compatible. | 59 | * Different major versions are not compatible. |
| 58 | * Different minor versions are only downward compatible. | 60 | * Different minor versions are only downward compatible. |
| @@ -95,5 +97,6 @@ extern void md_new_event(mddev_t *mddev); | |||
| 95 | 97 | ||
| 96 | extern void md_update_sb(mddev_t * mddev); | 98 | extern void md_update_sb(mddev_t * mddev); |
| 97 | 99 | ||
| 100 | #endif /* CONFIG_MD */ | ||
| 98 | #endif | 101 | #endif |
| 99 | 102 | ||
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index d288902958..920b94fe31 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h | |||
| @@ -18,6 +18,8 @@ | |||
| 18 | /* and dm-bio-list.h is not under include/linux because.... ??? */ | 18 | /* and dm-bio-list.h is not under include/linux because.... ??? */ |
| 19 | #include "../../../drivers/md/dm-bio-list.h" | 19 | #include "../../../drivers/md/dm-bio-list.h" |
| 20 | 20 | ||
| 21 | #ifdef CONFIG_BLOCK | ||
| 22 | |||
| 21 | #define LEVEL_MULTIPATH (-4) | 23 | #define LEVEL_MULTIPATH (-4) |
| 22 | #define LEVEL_LINEAR (-1) | 24 | #define LEVEL_LINEAR (-1) |
| 23 | #define LEVEL_FAULTY (-5) | 25 | #define LEVEL_FAULTY (-5) |
| @@ -362,5 +364,6 @@ static inline void safe_put_page(struct page *p) | |||
| 362 | if (p) put_page(p); | 364 | if (p) put_page(p); |
| 363 | } | 365 | } |
| 364 | 366 | ||
| 367 | #endif /* CONFIG_BLOCK */ | ||
| 365 | #endif | 368 | #endif |
| 366 | 369 | ||
diff --git a/include/linux/ramfs.h b/include/linux/ramfs.h index 00b340ba66..b160fb18e8 100644 --- a/include/linux/ramfs.h +++ b/include/linux/ramfs.h | |||
| @@ -17,5 +17,6 @@ extern int ramfs_nommu_mmap(struct file *file, struct vm_area_struct *vma); | |||
| 17 | 17 | ||
| 18 | extern const struct file_operations ramfs_file_operations; | 18 | extern const struct file_operations ramfs_file_operations; |
| 19 | extern struct vm_operations_struct generic_file_vm_ops; | 19 | extern struct vm_operations_struct generic_file_vm_ops; |
| 20 | extern int __init init_rootfs(void); | ||
| 20 | 21 | ||
| 21 | #endif | 22 | #endif |
diff --git a/include/linux/rbtree.h b/include/linux/rbtree.h index 8d5382e62c..344bc3495d 100644 --- a/include/linux/rbtree.h +++ b/include/linux/rbtree.h | |||
| @@ -133,7 +133,7 @@ static inline void rb_set_color(struct rb_node *rb, int color) | |||
| 133 | #define rb_entry(ptr, type, member) container_of(ptr, type, member) | 133 | #define rb_entry(ptr, type, member) container_of(ptr, type, member) |
| 134 | 134 | ||
| 135 | #define RB_EMPTY_ROOT(root) ((root)->rb_node == NULL) | 135 | #define RB_EMPTY_ROOT(root) ((root)->rb_node == NULL) |
| 136 | #define RB_EMPTY_NODE(node) (rb_parent(node) != node) | 136 | #define RB_EMPTY_NODE(node) (rb_parent(node) == node) |
| 137 | #define RB_CLEAR_NODE(node) (rb_set_parent(node, node)) | 137 | #define RB_CLEAR_NODE(node) (rb_set_parent(node, node)) |
| 138 | 138 | ||
| 139 | extern void rb_insert_color(struct rb_node *, struct rb_root *); | 139 | extern void rb_insert_color(struct rb_node *, struct rb_root *); |
diff --git a/include/linux/reiserfs_acl.h b/include/linux/reiserfs_acl.h index 806ec5b067..fe00f781a6 100644 --- a/include/linux/reiserfs_acl.h +++ b/include/linux/reiserfs_acl.h | |||
| @@ -56,6 +56,16 @@ extern int reiserfs_xattr_posix_acl_init(void) __init; | |||
| 56 | extern int reiserfs_xattr_posix_acl_exit(void); | 56 | extern int reiserfs_xattr_posix_acl_exit(void); |
| 57 | extern struct reiserfs_xattr_handler posix_acl_default_handler; | 57 | extern struct reiserfs_xattr_handler posix_acl_default_handler; |
| 58 | extern struct reiserfs_xattr_handler posix_acl_access_handler; | 58 | extern struct reiserfs_xattr_handler posix_acl_access_handler; |
| 59 | |||
| 60 | static inline void reiserfs_init_acl_access(struct inode *inode) | ||
| 61 | { | ||
| 62 | REISERFS_I(inode)->i_acl_access = NULL; | ||
| 63 | } | ||
| 64 | |||
| 65 | static inline void reiserfs_init_acl_default(struct inode *inode) | ||
| 66 | { | ||
| 67 | REISERFS_I(inode)->i_acl_default = NULL; | ||
| 68 | } | ||
| 59 | #else | 69 | #else |
| 60 | 70 | ||
| 61 | #define reiserfs_cache_default_acl(inode) 0 | 71 | #define reiserfs_cache_default_acl(inode) 0 |
| @@ -87,4 +97,11 @@ reiserfs_inherit_default_acl(const struct inode *dir, struct dentry *dentry, | |||
| 87 | return 0; | 97 | return 0; |
| 88 | } | 98 | } |
| 89 | 99 | ||
| 100 | static inline void reiserfs_init_acl_access(struct inode *inode) | ||
| 101 | { | ||
| 102 | } | ||
| 103 | |||
| 104 | static inline void reiserfs_init_acl_default(struct inode *inode) | ||
| 105 | { | ||
| 106 | } | ||
| 90 | #endif | 107 | #endif |
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index daa2d83cef..7bc6bfb862 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h | |||
| @@ -12,6 +12,8 @@ | |||
| 12 | #define _LINUX_REISER_FS_H | 12 | #define _LINUX_REISER_FS_H |
| 13 | 13 | ||
| 14 | #include <linux/types.h> | 14 | #include <linux/types.h> |
| 15 | #include <linux/magic.h> | ||
| 16 | |||
| 15 | #ifdef __KERNEL__ | 17 | #ifdef __KERNEL__ |
| 16 | #include <linux/slab.h> | 18 | #include <linux/slab.h> |
| 17 | #include <linux/interrupt.h> | 19 | #include <linux/interrupt.h> |
| @@ -227,14 +229,6 @@ struct reiserfs_super_block { | |||
| 227 | ((!is_reiserfs_jr(SB_DISK_SUPER_BLOCK(s)) ? \ | 229 | ((!is_reiserfs_jr(SB_DISK_SUPER_BLOCK(s)) ? \ |
| 228 | SB_ONDISK_JOURNAL_SIZE(s) + 1 : SB_ONDISK_RESERVED_FOR_JOURNAL(s))) | 230 | SB_ONDISK_JOURNAL_SIZE(s) + 1 : SB_ONDISK_RESERVED_FOR_JOURNAL(s))) |
| 229 | 231 | ||
| 230 | /* used by gcc */ | ||
| 231 | #define REISERFS_SUPER_MAGIC 0x52654973 | ||
| 232 | /* used by file system utilities that | ||
| 233 | look at the superblock, etc. */ | ||
| 234 | #define REISERFS_SUPER_MAGIC_STRING "ReIsErFs" | ||
| 235 | #define REISER2FS_SUPER_MAGIC_STRING "ReIsEr2Fs" | ||
| 236 | #define REISER2FS_JR_SUPER_MAGIC_STRING "ReIsEr3Fs" | ||
| 237 | |||
| 238 | int is_reiserfs_3_5(struct reiserfs_super_block *rs); | 232 | int is_reiserfs_3_5(struct reiserfs_super_block *rs); |
| 239 | int is_reiserfs_3_6(struct reiserfs_super_block *rs); | 233 | int is_reiserfs_3_6(struct reiserfs_super_block *rs); |
| 240 | int is_reiserfs_jr(struct reiserfs_super_block *rs); | 234 | int is_reiserfs_jr(struct reiserfs_super_block *rs); |
| @@ -813,21 +807,19 @@ struct stat_data_v1 { | |||
| 813 | #define set_sd_v1_first_direct_byte(sdp,v) \ | 807 | #define set_sd_v1_first_direct_byte(sdp,v) \ |
| 814 | ((sdp)->sd_first_direct_byte = cpu_to_le32(v)) | 808 | ((sdp)->sd_first_direct_byte = cpu_to_le32(v)) |
| 815 | 809 | ||
| 816 | #include <linux/ext2_fs.h> | ||
| 817 | |||
| 818 | /* inode flags stored in sd_attrs (nee sd_reserved) */ | 810 | /* inode flags stored in sd_attrs (nee sd_reserved) */ |
| 819 | 811 | ||
| 820 | /* we want common flags to have the same values as in ext2, | 812 | /* we want common flags to have the same values as in ext2, |
| 821 | so chattr(1) will work without problems */ | 813 | so chattr(1) will work without problems */ |
| 822 | #define REISERFS_IMMUTABLE_FL EXT2_IMMUTABLE_FL | 814 | #define REISERFS_IMMUTABLE_FL FS_IMMUTABLE_FL |
| 823 | #define REISERFS_APPEND_FL EXT2_APPEND_FL | 815 | #define REISERFS_APPEND_FL FS_APPEND_FL |
| 824 | #define REISERFS_SYNC_FL EXT2_SYNC_FL | 816 | #define REISERFS_SYNC_FL FS_SYNC_FL |
| 825 | #define REISERFS_NOATIME_FL EXT2_NOATIME_FL | 817 | #define REISERFS_NOATIME_FL FS_NOATIME_FL |
| 826 | #define REISERFS_NODUMP_FL EXT2_NODUMP_FL | 818 | #define REISERFS_NODUMP_FL FS_NODUMP_FL |
| 827 | #define REISERFS_SECRM_FL EXT2_SECRM_FL | 819 | #define REISERFS_SECRM_FL FS_SECRM_FL |
| 828 | #define REISERFS_UNRM_FL EXT2_UNRM_FL | 820 | #define REISERFS_UNRM_FL FS_UNRM_FL |
| 829 | #define REISERFS_COMPR_FL EXT2_COMPR_FL | 821 | #define REISERFS_COMPR_FL FS_COMPR_FL |
| 830 | #define REISERFS_NOTAIL_FL EXT2_NOTAIL_FL | 822 | #define REISERFS_NOTAIL_FL FS_NOTAIL_FL |
| 831 | 823 | ||
| 832 | /* persistent flags that file inherits from the parent directory */ | 824 | /* persistent flags that file inherits from the parent directory */ |
| 833 | #define REISERFS_INHERIT_MASK ( REISERFS_IMMUTABLE_FL | \ | 825 | #define REISERFS_INHERIT_MASK ( REISERFS_IMMUTABLE_FL | \ |
| @@ -2081,6 +2073,10 @@ void reiserfs_init_alloc_options(struct super_block *s); | |||
| 2081 | */ | 2073 | */ |
| 2082 | __le32 reiserfs_choose_packing(struct inode *dir); | 2074 | __le32 reiserfs_choose_packing(struct inode *dir); |
| 2083 | 2075 | ||
| 2076 | int reiserfs_init_bitmap_cache(struct super_block *sb); | ||
| 2077 | void reiserfs_free_bitmap_cache(struct super_block *sb); | ||
| 2078 | void reiserfs_cache_bitmap_metadata(struct super_block *sb, struct buffer_head *bh, struct reiserfs_bitmap_info *info); | ||
| 2079 | struct buffer_head *reiserfs_read_bitmap_block(struct super_block *sb, unsigned int bitmap); | ||
| 2084 | int is_reusable(struct super_block *s, b_blocknr_t block, int bit_value); | 2080 | int is_reusable(struct super_block *s, b_blocknr_t block, int bit_value); |
| 2085 | void reiserfs_free_block(struct reiserfs_transaction_handle *th, struct inode *, | 2081 | void reiserfs_free_block(struct reiserfs_transaction_handle *th, struct inode *, |
| 2086 | b_blocknr_t, int for_unformatted); | 2082 | b_blocknr_t, int for_unformatted); |
| @@ -2169,15 +2165,24 @@ __u32 r5_hash(const signed char *msg, int len); | |||
| 2169 | /* prototypes from ioctl.c */ | 2165 | /* prototypes from ioctl.c */ |
| 2170 | int reiserfs_ioctl(struct inode *inode, struct file *filp, | 2166 | int reiserfs_ioctl(struct inode *inode, struct file *filp, |
| 2171 | unsigned int cmd, unsigned long arg); | 2167 | unsigned int cmd, unsigned long arg); |
| 2168 | long reiserfs_compat_ioctl(struct file *filp, | ||
| 2169 | unsigned int cmd, unsigned long arg); | ||
| 2172 | 2170 | ||
| 2173 | /* ioctl's command */ | 2171 | /* ioctl's command */ |
| 2174 | #define REISERFS_IOC_UNPACK _IOW(0xCD,1,long) | 2172 | #define REISERFS_IOC_UNPACK _IOW(0xCD,1,long) |
| 2175 | /* define following flags to be the same as in ext2, so that chattr(1), | 2173 | /* define following flags to be the same as in ext2, so that chattr(1), |
| 2176 | lsattr(1) will work with us. */ | 2174 | lsattr(1) will work with us. */ |
| 2177 | #define REISERFS_IOC_GETFLAGS EXT2_IOC_GETFLAGS | 2175 | #define REISERFS_IOC_GETFLAGS FS_IOC_GETFLAGS |
| 2178 | #define REISERFS_IOC_SETFLAGS EXT2_IOC_SETFLAGS | 2176 | #define REISERFS_IOC_SETFLAGS FS_IOC_SETFLAGS |
| 2179 | #define REISERFS_IOC_GETVERSION EXT2_IOC_GETVERSION | 2177 | #define REISERFS_IOC_GETVERSION FS_IOC_GETVERSION |
| 2180 | #define REISERFS_IOC_SETVERSION EXT2_IOC_SETVERSION | 2178 | #define REISERFS_IOC_SETVERSION FS_IOC_SETVERSION |
| 2179 | |||
| 2180 | /* the 32 bit compat definitions with int argument */ | ||
| 2181 | #define REISERFS_IOC32_UNPACK _IOW(0xCD, 1, int) | ||
| 2182 | #define REISERFS_IOC32_GETFLAGS FS_IOC32_GETFLAGS | ||
| 2183 | #define REISERFS_IOC32_SETFLAGS FS_IOC32_SETFLAGS | ||
| 2184 | #define REISERFS_IOC32_GETVERSION FS_IOC32_GETVERSION | ||
| 2185 | #define REISERFS_IOC32_SETVERSION FS_IOC32_SETVERSION | ||
| 2181 | 2186 | ||
| 2182 | /* Locking primitives */ | 2187 | /* Locking primitives */ |
| 2183 | /* Right now we are still falling back to (un)lock_kernel, but eventually that | 2188 | /* Right now we are still falling back to (un)lock_kernel, but eventually that |
diff --git a/include/linux/reiserfs_fs_i.h b/include/linux/reiserfs_fs_i.h index 149be8d9a0..5b3b297aa2 100644 --- a/include/linux/reiserfs_fs_i.h +++ b/include/linux/reiserfs_fs_i.h | |||
| @@ -52,10 +52,13 @@ struct reiserfs_inode_info { | |||
| 52 | ** flushed */ | 52 | ** flushed */ |
| 53 | unsigned long i_trans_id; | 53 | unsigned long i_trans_id; |
| 54 | struct reiserfs_journal_list *i_jl; | 54 | struct reiserfs_journal_list *i_jl; |
| 55 | 55 | #ifdef CONFIG_REISERFS_FS_POSIX_ACL | |
| 56 | struct posix_acl *i_acl_access; | 56 | struct posix_acl *i_acl_access; |
| 57 | struct posix_acl *i_acl_default; | 57 | struct posix_acl *i_acl_default; |
| 58 | #endif | ||
| 59 | #ifdef CONFIG_REISERFS_FS_XATTR | ||
| 58 | struct rw_semaphore xattr_sem; | 60 | struct rw_semaphore xattr_sem; |
| 61 | #endif | ||
| 59 | struct inode vfs_inode; | 62 | struct inode vfs_inode; |
| 60 | }; | 63 | }; |
| 61 | 64 | ||
diff --git a/include/linux/reiserfs_fs_sb.h b/include/linux/reiserfs_fs_sb.h index 31b4c0bd4f..73e0becec0 100644 --- a/include/linux/reiserfs_fs_sb.h +++ b/include/linux/reiserfs_fs_sb.h | |||
| @@ -267,7 +267,6 @@ struct reiserfs_bitmap_info { | |||
| 267 | // FIXME: Won't work with block sizes > 8K | 267 | // FIXME: Won't work with block sizes > 8K |
| 268 | __u16 first_zero_hint; | 268 | __u16 first_zero_hint; |
| 269 | __u16 free_count; | 269 | __u16 free_count; |
| 270 | struct buffer_head *bh; /* the actual bitmap */ | ||
| 271 | }; | 270 | }; |
| 272 | 271 | ||
| 273 | struct proc_dir_entry; | 272 | struct proc_dir_entry; |
| @@ -414,6 +413,7 @@ struct reiserfs_sb_info { | |||
| 414 | /* Definitions of reiserfs on-disk properties: */ | 413 | /* Definitions of reiserfs on-disk properties: */ |
| 415 | #define REISERFS_3_5 0 | 414 | #define REISERFS_3_5 0 |
| 416 | #define REISERFS_3_6 1 | 415 | #define REISERFS_3_6 1 |
| 416 | #define REISERFS_OLD_FORMAT 2 | ||
| 417 | 417 | ||
| 418 | enum reiserfs_mount_options { | 418 | enum reiserfs_mount_options { |
| 419 | /* Mount options */ | 419 | /* Mount options */ |
diff --git a/include/linux/reiserfs_xattr.h b/include/linux/reiserfs_xattr.h index 5e961035c7..966c35851b 100644 --- a/include/linux/reiserfs_xattr.h +++ b/include/linux/reiserfs_xattr.h | |||
| @@ -97,6 +97,11 @@ static inline void reiserfs_mark_inode_private(struct inode *inode) | |||
| 97 | inode->i_flags |= S_PRIVATE; | 97 | inode->i_flags |= S_PRIVATE; |
| 98 | } | 98 | } |
| 99 | 99 | ||
| 100 | static inline void reiserfs_init_xattr_rwsem(struct inode *inode) | ||
| 101 | { | ||
| 102 | init_rwsem(&REISERFS_I(inode)->xattr_sem); | ||
| 103 | } | ||
| 104 | |||
| 100 | #else | 105 | #else |
| 101 | 106 | ||
| 102 | #define is_reiserfs_priv_object(inode) 0 | 107 | #define is_reiserfs_priv_object(inode) 0 |
| @@ -129,6 +134,9 @@ static inline int reiserfs_xattr_init(struct super_block *sb, int mount_flags) | |||
| 129 | sb->s_flags = (sb->s_flags & ~MS_POSIXACL); /* to be sure */ | 134 | sb->s_flags = (sb->s_flags & ~MS_POSIXACL); /* to be sure */ |
| 130 | return 0; | 135 | return 0; |
| 131 | }; | 136 | }; |
| 137 | static inline void reiserfs_init_xattr_rwsem(struct inode *inode) | ||
| 138 | { | ||
| 139 | } | ||
| 132 | #endif | 140 | #endif |
| 133 | 141 | ||
| 134 | #endif /* __KERNEL__ */ | 142 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/resume-trace.h b/include/linux/resume-trace.h index a376bd4ade..81e9299ca1 100644 --- a/include/linux/resume-trace.h +++ b/include/linux/resume-trace.h | |||
| @@ -3,21 +3,25 @@ | |||
| 3 | 3 | ||
| 4 | #ifdef CONFIG_PM_TRACE | 4 | #ifdef CONFIG_PM_TRACE |
| 5 | 5 | ||
| 6 | extern int pm_trace_enabled; | ||
| 7 | |||
| 6 | struct device; | 8 | struct device; |
| 7 | extern void set_trace_device(struct device *); | 9 | extern void set_trace_device(struct device *); |
| 8 | extern void generate_resume_trace(void *tracedata, unsigned int user); | 10 | extern void generate_resume_trace(void *tracedata, unsigned int user); |
| 9 | 11 | ||
| 10 | #define TRACE_DEVICE(dev) set_trace_device(dev) | 12 | #define TRACE_DEVICE(dev) set_trace_device(dev) |
| 11 | #define TRACE_RESUME(user) do { \ | 13 | #define TRACE_RESUME(user) do { \ |
| 12 | void *tracedata; \ | 14 | if (pm_trace_enabled) { \ |
| 13 | asm volatile("movl $1f,%0\n" \ | 15 | void *tracedata; \ |
| 14 | ".section .tracedata,\"a\"\n" \ | 16 | asm volatile("movl $1f,%0\n" \ |
| 15 | "1:\t.word %c1\n" \ | 17 | ".section .tracedata,\"a\"\n" \ |
| 16 | "\t.long %c2\n" \ | 18 | "1:\t.word %c1\n" \ |
| 17 | ".previous" \ | 19 | "\t.long %c2\n" \ |
| 18 | :"=r" (tracedata) \ | 20 | ".previous" \ |
| 19 | : "i" (__LINE__), "i" (__FILE__)); \ | 21 | :"=r" (tracedata) \ |
| 20 | generate_resume_trace(tracedata, user); \ | 22 | : "i" (__LINE__), "i" (__FILE__)); \ |
| 23 | generate_resume_trace(tracedata, user); \ | ||
| 24 | } \ | ||
| 21 | } while (0) | 25 | } while (0) |
| 22 | 26 | ||
| 23 | #else | 27 | #else |
diff --git a/include/linux/rmap.h b/include/linux/rmap.h index bf97b09000..db2c1df4fe 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h | |||
| @@ -103,6 +103,14 @@ pte_t *page_check_address(struct page *, struct mm_struct *, | |||
| 103 | */ | 103 | */ |
| 104 | unsigned long page_address_in_vma(struct page *, struct vm_area_struct *); | 104 | unsigned long page_address_in_vma(struct page *, struct vm_area_struct *); |
| 105 | 105 | ||
| 106 | /* | ||
| 107 | * Cleans the PTEs of shared mappings. | ||
| 108 | * (and since clean PTEs should also be readonly, write protects them too) | ||
| 109 | * | ||
| 110 | * returns the number of cleaned PTEs. | ||
| 111 | */ | ||
| 112 | int page_mkclean(struct page *); | ||
| 113 | |||
| 106 | #else /* !CONFIG_MMU */ | 114 | #else /* !CONFIG_MMU */ |
| 107 | 115 | ||
| 108 | #define anon_vma_init() do {} while (0) | 116 | #define anon_vma_init() do {} while (0) |
| @@ -112,6 +120,12 @@ unsigned long page_address_in_vma(struct page *, struct vm_area_struct *); | |||
| 112 | #define page_referenced(page,l) TestClearPageReferenced(page) | 120 | #define page_referenced(page,l) TestClearPageReferenced(page) |
| 113 | #define try_to_unmap(page, refs) SWAP_FAIL | 121 | #define try_to_unmap(page, refs) SWAP_FAIL |
| 114 | 122 | ||
| 123 | static inline int page_mkclean(struct page *page) | ||
| 124 | { | ||
| 125 | return 0; | ||
| 126 | } | ||
| 127 | |||
| 128 | |||
| 115 | #endif /* CONFIG_MMU */ | 129 | #endif /* CONFIG_MMU */ |
| 116 | 130 | ||
| 117 | /* | 131 | /* |
diff --git a/include/linux/rtc.h b/include/linux/rtc.h index 5371e4e745..b89f093570 100644 --- a/include/linux/rtc.h +++ b/include/linux/rtc.h | |||
| @@ -141,7 +141,7 @@ struct rtc_device | |||
| 141 | int id; | 141 | int id; |
| 142 | char name[RTC_DEVICE_NAME_SIZE]; | 142 | char name[RTC_DEVICE_NAME_SIZE]; |
| 143 | 143 | ||
| 144 | struct rtc_class_ops *ops; | 144 | const struct rtc_class_ops *ops; |
| 145 | struct mutex ops_lock; | 145 | struct mutex ops_lock; |
| 146 | 146 | ||
| 147 | struct class_device *rtc_dev; | 147 | struct class_device *rtc_dev; |
| @@ -172,7 +172,7 @@ struct rtc_device | |||
| 172 | 172 | ||
| 173 | extern struct rtc_device *rtc_device_register(const char *name, | 173 | extern struct rtc_device *rtc_device_register(const char *name, |
| 174 | struct device *dev, | 174 | struct device *dev, |
| 175 | struct rtc_class_ops *ops, | 175 | const struct rtc_class_ops *ops, |
| 176 | struct module *owner); | 176 | struct module *owner); |
| 177 | extern void rtc_device_unregister(struct rtc_device *rdev); | 177 | extern void rtc_device_unregister(struct rtc_device *rdev); |
| 178 | extern int rtc_interface_register(struct class_interface *intf); | 178 | extern int rtc_interface_register(struct class_interface *intf); |
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index facd9ee37b..3a18addaed 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | #define __LINUX_RTNETLINK_H | 2 | #define __LINUX_RTNETLINK_H |
| 3 | 3 | ||
| 4 | #include <linux/netlink.h> | 4 | #include <linux/netlink.h> |
| 5 | #include <linux/if_link.h> | ||
| 5 | 6 | ||
| 6 | /**** | 7 | /**** |
| 7 | * Routing/neighbour discovery messages. | 8 | * Routing/neighbour discovery messages. |
| @@ -238,10 +239,8 @@ enum rt_class_t | |||
| 238 | RT_TABLE_DEFAULT=253, | 239 | RT_TABLE_DEFAULT=253, |
| 239 | RT_TABLE_MAIN=254, | 240 | RT_TABLE_MAIN=254, |
| 240 | RT_TABLE_LOCAL=255, | 241 | RT_TABLE_LOCAL=255, |
| 241 | __RT_TABLE_MAX | 242 | RT_TABLE_MAX=0xFFFFFFFF |
| 242 | }; | 243 | }; |
| 243 | #define RT_TABLE_MAX (__RT_TABLE_MAX - 1) | ||
| 244 | |||
| 245 | 244 | ||
| 246 | 245 | ||
| 247 | /* Routing message attributes */ | 246 | /* Routing message attributes */ |
| @@ -263,6 +262,7 @@ enum rtattr_type_t | |||
| 263 | RTA_CACHEINFO, | 262 | RTA_CACHEINFO, |
| 264 | RTA_SESSION, | 263 | RTA_SESSION, |
| 265 | RTA_MP_ALGO, | 264 | RTA_MP_ALGO, |
| 265 | RTA_TABLE, | ||
| 266 | __RTA_MAX | 266 | __RTA_MAX |
| 267 | }; | 267 | }; |
| 268 | 268 | ||
| @@ -383,226 +383,6 @@ struct rta_session | |||
| 383 | } u; | 383 | } u; |
| 384 | }; | 384 | }; |
| 385 | 385 | ||
| 386 | |||
| 387 | /********************************************************* | ||
| 388 | * Interface address. | ||
| 389 | ****/ | ||
| 390 | |||
| 391 | struct ifaddrmsg | ||
| 392 | { | ||
| 393 | unsigned char ifa_family; | ||
| 394 | unsigned char ifa_prefixlen; /* The prefix length */ | ||
| 395 | unsigned char ifa_flags; /* Flags */ | ||
| 396 | unsigned char ifa_scope; /* See above */ | ||
| 397 | int ifa_index; /* Link index */ | ||
| 398 | }; | ||
| 399 | |||
| 400 | enum | ||
| 401 | { | ||
| 402 | IFA_UNSPEC, | ||
| 403 | IFA_ADDRESS, | ||
| 404 | IFA_LOCAL, | ||
| 405 | IFA_LABEL, | ||
| 406 | IFA_BROADCAST, | ||
| 407 | IFA_ANYCAST, | ||
| 408 | IFA_CACHEINFO, | ||
| 409 | IFA_MULTICAST, | ||
| 410 | __IFA_MAX | ||
| 411 | }; | ||
| 412 | |||
| 413 | #define IFA_MAX (__IFA_MAX - 1) | ||
| 414 | |||
| 415 | /* ifa_flags */ | ||
| 416 | |||
| 417 | #define IFA_F_SECONDARY 0x01 | ||
| 418 | #define IFA_F_TEMPORARY IFA_F_SECONDARY | ||
| 419 | |||
| 420 | #define IFA_F_DEPRECATED 0x20 | ||
| 421 | #define IFA_F_TENTATIVE 0x40 | ||
| 422 | #define IFA_F_PERMANENT 0x80 | ||
| 423 | |||
| 424 | struct ifa_cacheinfo | ||
| 425 | { | ||
| 426 | __u32 ifa_prefered; | ||
| 427 | __u32 ifa_valid; | ||
| 428 | __u32 cstamp; /* created timestamp, hundredths of seconds */ | ||
| 429 | __u32 tstamp; /* updated timestamp, hundredths of seconds */ | ||
| 430 | }; | ||
| 431 | |||
| 432 | |||
| 433 | #define IFA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifaddrmsg)))) | ||
| 434 | #define IFA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifaddrmsg)) | ||
| 435 | |||
| 436 | /* | ||
| 437 | Important comment: | ||
| 438 | IFA_ADDRESS is prefix address, rather than local interface address. | ||
| 439 | It makes no difference for normally configured broadcast interfaces, | ||
| 440 | but for point-to-point IFA_ADDRESS is DESTINATION address, | ||
| 441 | local address is supplied in IFA_LOCAL attribute. | ||
| 442 | */ | ||
| 443 | |||
| 444 | /************************************************************** | ||
| 445 | * Neighbour discovery. | ||
| 446 | ****/ | ||
| 447 | |||
| 448 | struct ndmsg | ||
| 449 | { | ||
| 450 | unsigned char ndm_family; | ||
| 451 | unsigned char ndm_pad1; | ||
| 452 | unsigned short ndm_pad2; | ||
| 453 | int ndm_ifindex; /* Link index */ | ||
| 454 | __u16 ndm_state; | ||
| 455 | __u8 ndm_flags; | ||
| 456 | __u8 ndm_type; | ||
| 457 | }; | ||
| 458 | |||
| 459 | enum | ||
| 460 | { | ||
| 461 | NDA_UNSPEC, | ||
| 462 | NDA_DST, | ||
| 463 | NDA_LLADDR, | ||
| 464 | NDA_CACHEINFO, | ||
| 465 | NDA_PROBES, | ||
| 466 | __NDA_MAX | ||
| 467 | }; | ||
| 468 | |||
| 469 | #define NDA_MAX (__NDA_MAX - 1) | ||
| 470 | |||
| 471 | #define NDA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ndmsg)))) | ||
| 472 | #define NDA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ndmsg)) | ||
| 473 | |||
| 474 | /* | ||
| 475 | * Neighbor Cache Entry Flags | ||
| 476 | */ | ||
| 477 | |||
| 478 | #define NTF_PROXY 0x08 /* == ATF_PUBL */ | ||
| 479 | #define NTF_ROUTER 0x80 | ||
| 480 | |||
| 481 | /* | ||
| 482 | * Neighbor Cache Entry States. | ||
| 483 | */ | ||
| 484 | |||
| 485 | #define NUD_INCOMPLETE 0x01 | ||
| 486 | #define NUD_REACHABLE 0x02 | ||
| 487 | #define NUD_STALE 0x04 | ||
| 488 | #define NUD_DELAY 0x08 | ||
| 489 | #define NUD_PROBE 0x10 | ||
| 490 | #define NUD_FAILED 0x20 | ||
| 491 | |||
| 492 | /* Dummy states */ | ||
| 493 | #define NUD_NOARP 0x40 | ||
| 494 | #define NUD_PERMANENT 0x80 | ||
| 495 | #define NUD_NONE 0x00 | ||
| 496 | |||
| 497 | |||
| 498 | struct nda_cacheinfo | ||
| 499 | { | ||
| 500 | __u32 ndm_confirmed; | ||
| 501 | __u32 ndm_used; | ||
| 502 | __u32 ndm_updated; | ||
| 503 | __u32 ndm_refcnt; | ||
| 504 | }; | ||
| 505 | |||
| 506 | |||
| 507 | /***************************************************************** | ||
| 508 | * Neighbour tables specific messages. | ||
| 509 | * | ||
| 510 | * To retrieve the neighbour tables send RTM_GETNEIGHTBL with the | ||
| 511 | * NLM_F_DUMP flag set. Every neighbour table configuration is | ||
| 512 | * spread over multiple messages to avoid running into message | ||
| 513 | * size limits on systems with many interfaces. The first message | ||
| 514 | * in the sequence transports all not device specific data such as | ||
| 515 | * statistics, configuration, and the default parameter set. | ||
| 516 | * This message is followed by 0..n messages carrying device | ||
| 517 | * specific parameter sets. | ||
| 518 | * Although the ordering should be sufficient, NDTA_NAME can be | ||
| 519 | * used to identify sequences. The initial message can be identified | ||
| 520 | * by checking for NDTA_CONFIG. The device specific messages do | ||
| 521 | * not contain this TLV but have NDTPA_IFINDEX set to the | ||
| 522 | * corresponding interface index. | ||
| 523 | * | ||
| 524 | * To change neighbour table attributes, send RTM_SETNEIGHTBL | ||
| 525 | * with NDTA_NAME set. Changeable attribute include NDTA_THRESH[1-3], | ||
| 526 | * NDTA_GC_INTERVAL, and all TLVs in NDTA_PARMS unless marked | ||
| 527 | * otherwise. Device specific parameter sets can be changed by | ||
| 528 | * setting NDTPA_IFINDEX to the interface index of the corresponding | ||
| 529 | * device. | ||
| 530 | ****/ | ||
| 531 | |||
| 532 | struct ndt_stats | ||
| 533 | { | ||
| 534 | __u64 ndts_allocs; | ||
| 535 | __u64 ndts_destroys; | ||
| 536 | __u64 ndts_hash_grows; | ||
| 537 | __u64 ndts_res_failed; | ||
| 538 | __u64 ndts_lookups; | ||
| 539 | __u64 ndts_hits; | ||
| 540 | __u64 ndts_rcv_probes_mcast; | ||
| 541 | __u64 ndts_rcv_probes_ucast; | ||
| 542 | __u64 ndts_periodic_gc_runs; | ||
| 543 | __u64 ndts_forced_gc_runs; | ||
| 544 | }; | ||
| 545 | |||
| 546 | enum { | ||
| 547 | NDTPA_UNSPEC, | ||
| 548 | NDTPA_IFINDEX, /* u32, unchangeable */ | ||
| 549 | NDTPA_REFCNT, /* u32, read-only */ | ||
| 550 | NDTPA_REACHABLE_TIME, /* u64, read-only, msecs */ | ||
| 551 | NDTPA_BASE_REACHABLE_TIME, /* u64, msecs */ | ||
| 552 | NDTPA_RETRANS_TIME, /* u64, msecs */ | ||
| 553 | NDTPA_GC_STALETIME, /* u64, msecs */ | ||
| 554 | NDTPA_DELAY_PROBE_TIME, /* u64, msecs */ | ||
| 555 | NDTPA_QUEUE_LEN, /* u32 */ | ||
| 556 | NDTPA_APP_PROBES, /* u32 */ | ||
| 557 | NDTPA_UCAST_PROBES, /* u32 */ | ||
| 558 | NDTPA_MCAST_PROBES, /* u32 */ | ||
| 559 | NDTPA_ANYCAST_DELAY, /* u64, msecs */ | ||
| 560 | NDTPA_PROXY_DELAY, /* u64, msecs */ | ||
| 561 | NDTPA_PROXY_QLEN, /* u32 */ | ||
| 562 | NDTPA_LOCKTIME, /* u64, msecs */ | ||
| 563 | __NDTPA_MAX | ||
| 564 | }; | ||
| 565 | #define NDTPA_MAX (__NDTPA_MAX - 1) | ||
| 566 | |||
| 567 | struct ndtmsg | ||
| 568 | { | ||
| 569 | __u8 ndtm_family; | ||
| 570 | __u8 ndtm_pad1; | ||
| 571 | __u16 ndtm_pad2; | ||
| 572 | }; | ||
| 573 | |||
| 574 | struct ndt_config | ||
| 575 | { | ||
| 576 | __u16 ndtc_key_len; | ||
| 577 | __u16 ndtc_entry_size; | ||
| 578 | __u32 ndtc_entries; | ||
| 579 | __u32 ndtc_last_flush; /* delta to now in msecs */ | ||
| 580 | __u32 ndtc_last_rand; /* delta to now in msecs */ | ||
| 581 | __u32 ndtc_hash_rnd; | ||
| 582 | __u32 ndtc_hash_mask; | ||
| 583 | __u32 ndtc_hash_chain_gc; | ||
| 584 | __u32 ndtc_proxy_qlen; | ||
| 585 | }; | ||
| 586 | |||
| 587 | enum { | ||
| 588 | NDTA_UNSPEC, | ||
| 589 | NDTA_NAME, /* char *, unchangeable */ | ||
| 590 | NDTA_THRESH1, /* u32 */ | ||
| 591 | NDTA_THRESH2, /* u32 */ | ||
| 592 | NDTA_THRESH3, /* u32 */ | ||
| 593 | NDTA_CONFIG, /* struct ndt_config, read-only */ | ||
| 594 | NDTA_PARMS, /* nested TLV NDTPA_* */ | ||
| 595 | NDTA_STATS, /* struct ndt_stats, read-only */ | ||
| 596 | NDTA_GC_INTERVAL, /* u64, msecs */ | ||
| 597 | __NDTA_MAX | ||
| 598 | }; | ||
| 599 | #define NDTA_MAX (__NDTA_MAX - 1) | ||
| 600 | |||
| 601 | #define NDTA_RTA(r) ((struct rtattr*)(((char*)(r)) + \ | ||
| 602 | NLMSG_ALIGN(sizeof(struct ndtmsg)))) | ||
| 603 | #define NDTA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ndtmsg)) | ||
| 604 | |||
| 605 | |||
| 606 | /**** | 386 | /**** |
| 607 | * General form of address family dependent message. | 387 | * General form of address family dependent message. |
| 608 | ****/ | 388 | ****/ |
| @@ -663,138 +443,6 @@ struct prefix_cacheinfo | |||
| 663 | __u32 valid_time; | 443 | __u32 valid_time; |
| 664 | }; | 444 | }; |
| 665 | 445 | ||
| 666 | /* The struct should be in sync with struct net_device_stats */ | ||
| 667 | struct rtnl_link_stats | ||
| 668 | { | ||
| 669 | __u32 rx_packets; /* total packets received */ | ||
| 670 | __u32 tx_packets; /* total packets transmitted */ | ||
| 671 | __u32 rx_bytes; /* total bytes received */ | ||
| 672 | __u32 tx_bytes; /* total bytes transmitted */ | ||
| 673 | __u32 rx_errors; /* bad packets received */ | ||
| 674 | __u32 tx_errors; /* packet transmit problems */ | ||
| 675 | __u32 rx_dropped; /* no space in linux buffers */ | ||
| 676 | __u32 tx_dropped; /* no space available in linux */ | ||
| 677 | __u32 multicast; /* multicast packets received */ | ||
| 678 | __u32 collisions; | ||
| 679 | |||
| 680 | /* detailed rx_errors: */ | ||
| 681 | __u32 rx_length_errors; | ||
| 682 | __u32 rx_over_errors; /* receiver ring buff overflow */ | ||
| 683 | __u32 rx_crc_errors; /* recved pkt with crc error */ | ||
| 684 | __u32 rx_frame_errors; /* recv'd frame alignment error */ | ||
| 685 | __u32 rx_fifo_errors; /* recv'r fifo overrun */ | ||
| 686 | __u32 rx_missed_errors; /* receiver missed packet */ | ||
| 687 | |||
| 688 | /* detailed tx_errors */ | ||
| 689 | __u32 tx_aborted_errors; | ||
| 690 | __u32 tx_carrier_errors; | ||
| 691 | __u32 tx_fifo_errors; | ||
| 692 | __u32 tx_heartbeat_errors; | ||
| 693 | __u32 tx_window_errors; | ||
| 694 | |||
| 695 | /* for cslip etc */ | ||
| 696 | __u32 rx_compressed; | ||
| 697 | __u32 tx_compressed; | ||
| 698 | }; | ||
| 699 | |||
| 700 | /* The struct should be in sync with struct ifmap */ | ||
| 701 | struct rtnl_link_ifmap | ||
| 702 | { | ||
| 703 | __u64 mem_start; | ||
| 704 | __u64 mem_end; | ||
| 705 | __u64 base_addr; | ||
| 706 | __u16 irq; | ||
| 707 | __u8 dma; | ||
| 708 | __u8 port; | ||
| 709 | }; | ||
| 710 | |||
| 711 | enum | ||
| 712 | { | ||
| 713 | IFLA_UNSPEC, | ||
| 714 | IFLA_ADDRESS, | ||
| 715 | IFLA_BROADCAST, | ||
| 716 | IFLA_IFNAME, | ||
| 717 | IFLA_MTU, | ||
| 718 | IFLA_LINK, | ||
| 719 | IFLA_QDISC, | ||
| 720 | IFLA_STATS, | ||
| 721 | IFLA_COST, | ||
| 722 | #define IFLA_COST IFLA_COST | ||
| 723 | IFLA_PRIORITY, | ||
| 724 | #define IFLA_PRIORITY IFLA_PRIORITY | ||
| 725 | IFLA_MASTER, | ||
| 726 | #define IFLA_MASTER IFLA_MASTER | ||
| 727 | IFLA_WIRELESS, /* Wireless Extension event - see wireless.h */ | ||
| 728 | #define IFLA_WIRELESS IFLA_WIRELESS | ||
| 729 | IFLA_PROTINFO, /* Protocol specific information for a link */ | ||
| 730 | #define IFLA_PROTINFO IFLA_PROTINFO | ||
| 731 | IFLA_TXQLEN, | ||
| 732 | #define IFLA_TXQLEN IFLA_TXQLEN | ||
| 733 | IFLA_MAP, | ||
| 734 | #define IFLA_MAP IFLA_MAP | ||
| 735 | IFLA_WEIGHT, | ||
| 736 | #define IFLA_WEIGHT IFLA_WEIGHT | ||
| 737 | IFLA_OPERSTATE, | ||
| 738 | IFLA_LINKMODE, | ||
| 739 | __IFLA_MAX | ||
| 740 | }; | ||
| 741 | |||
| 742 | |||
| 743 | #define IFLA_MAX (__IFLA_MAX - 1) | ||
| 744 | |||
| 745 | #define IFLA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg)))) | ||
| 746 | #define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg)) | ||
| 747 | |||
| 748 | /* ifi_flags. | ||
| 749 | |||
| 750 | IFF_* flags. | ||
| 751 | |||
| 752 | The only change is: | ||
| 753 | IFF_LOOPBACK, IFF_BROADCAST and IFF_POINTOPOINT are | ||
| 754 | more not changeable by user. They describe link media | ||
| 755 | characteristics and set by device driver. | ||
| 756 | |||
| 757 | Comments: | ||
| 758 | - Combination IFF_BROADCAST|IFF_POINTOPOINT is invalid | ||
| 759 | - If neither of these three flags are set; | ||
| 760 | the interface is NBMA. | ||
| 761 | |||
| 762 | - IFF_MULTICAST does not mean anything special: | ||
| 763 | multicasts can be used on all not-NBMA links. | ||
| 764 | IFF_MULTICAST means that this media uses special encapsulation | ||
| 765 | for multicast frames. Apparently, all IFF_POINTOPOINT and | ||
| 766 | IFF_BROADCAST devices are able to use multicasts too. | ||
| 767 | */ | ||
| 768 | |||
| 769 | /* IFLA_LINK. | ||
| 770 | For usual devices it is equal ifi_index. | ||
| 771 | If it is a "virtual interface" (f.e. tunnel), ifi_link | ||
| 772 | can point to real physical interface (f.e. for bandwidth calculations), | ||
| 773 | or maybe 0, what means, that real media is unknown (usual | ||
| 774 | for IPIP tunnels, when route to endpoint is allowed to change) | ||
| 775 | */ | ||
| 776 | |||
| 777 | /* Subtype attributes for IFLA_PROTINFO */ | ||
| 778 | enum | ||
| 779 | { | ||
| 780 | IFLA_INET6_UNSPEC, | ||
| 781 | IFLA_INET6_FLAGS, /* link flags */ | ||
| 782 | IFLA_INET6_CONF, /* sysctl parameters */ | ||
| 783 | IFLA_INET6_STATS, /* statistics */ | ||
| 784 | IFLA_INET6_MCAST, /* MC things. What of them? */ | ||
| 785 | IFLA_INET6_CACHEINFO, /* time values and max reasm size */ | ||
| 786 | __IFLA_INET6_MAX | ||
| 787 | }; | ||
| 788 | |||
| 789 | #define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1) | ||
| 790 | |||
| 791 | struct ifla_cacheinfo | ||
| 792 | { | ||
| 793 | __u32 max_reasm_len; | ||
| 794 | __u32 tstamp; /* ipv6InterfaceTable updated timestamp */ | ||
| 795 | __u32 reachable_time; | ||
| 796 | __u32 retrans_time; | ||
| 797 | }; | ||
| 798 | 446 | ||
| 799 | /***************************************************************** | 447 | /***************************************************************** |
| 800 | * Traffic control messages. | 448 | * Traffic control messages. |
| @@ -885,10 +533,13 @@ enum rtnetlink_groups { | |||
| 885 | RTNLGRP_NOP2, | 533 | RTNLGRP_NOP2, |
| 886 | RTNLGRP_DECnet_ROUTE, | 534 | RTNLGRP_DECnet_ROUTE, |
| 887 | #define RTNLGRP_DECnet_ROUTE RTNLGRP_DECnet_ROUTE | 535 | #define RTNLGRP_DECnet_ROUTE RTNLGRP_DECnet_ROUTE |
| 888 | RTNLGRP_NOP3, | 536 | RTNLGRP_DECnet_RULE, |
| 537 | #define RTNLGRP_DECnet_RULE RTNLGRP_DECnet_RULE | ||
| 889 | RTNLGRP_NOP4, | 538 | RTNLGRP_NOP4, |
| 890 | RTNLGRP_IPV6_PREFIX, | 539 | RTNLGRP_IPV6_PREFIX, |
| 891 | #define RTNLGRP_IPV6_PREFIX RTNLGRP_IPV6_PREFIX | 540 | #define RTNLGRP_IPV6_PREFIX RTNLGRP_IPV6_PREFIX |
| 541 | RTNLGRP_IPV6_RULE, | ||
| 542 | #define RTNLGRP_IPV6_RULE RTNLGRP_IPV6_RULE | ||
| 892 | __RTNLGRP_MAX | 543 | __RTNLGRP_MAX |
| 893 | }; | 544 | }; |
| 894 | #define RTNLGRP_MAX (__RTNLGRP_MAX - 1) | 545 | #define RTNLGRP_MAX (__RTNLGRP_MAX - 1) |
| @@ -923,8 +574,6 @@ extern int rtattr_parse(struct rtattr *tb[], int maxattr, struct rtattr *rta, in | |||
| 923 | #define rtattr_parse_nested(tb, max, rta) \ | 574 | #define rtattr_parse_nested(tb, max, rta) \ |
| 924 | rtattr_parse((tb), (max), RTA_DATA((rta)), RTA_PAYLOAD((rta))) | 575 | rtattr_parse((tb), (max), RTA_DATA((rta)), RTA_PAYLOAD((rta))) |
| 925 | 576 | ||
| 926 | extern struct sock *rtnl; | ||
| 927 | |||
| 928 | struct rtnetlink_link | 577 | struct rtnetlink_link |
| 929 | { | 578 | { |
| 930 | int (*doit)(struct sk_buff *, struct nlmsghdr*, void *attr); | 579 | int (*doit)(struct sk_buff *, struct nlmsghdr*, void *attr); |
| @@ -933,6 +582,10 @@ struct rtnetlink_link | |||
| 933 | 582 | ||
| 934 | extern struct rtnetlink_link * rtnetlink_links[NPROTO]; | 583 | extern struct rtnetlink_link * rtnetlink_links[NPROTO]; |
| 935 | extern int rtnetlink_send(struct sk_buff *skb, u32 pid, u32 group, int echo); | 584 | extern int rtnetlink_send(struct sk_buff *skb, u32 pid, u32 group, int echo); |
| 585 | extern int rtnl_unicast(struct sk_buff *skb, u32 pid); | ||
| 586 | extern int rtnl_notify(struct sk_buff *skb, u32 pid, u32 group, | ||
| 587 | struct nlmsghdr *nlh, gfp_t flags); | ||
| 588 | extern void rtnl_set_sk_err(u32 group, int error); | ||
| 936 | extern int rtnetlink_put_metrics(struct sk_buff *skb, u32 *metrics); | 589 | extern int rtnetlink_put_metrics(struct sk_buff *skb, u32 *metrics); |
| 937 | 590 | ||
| 938 | extern void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const void *data); | 591 | extern void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const void *data); |
| @@ -1065,6 +718,13 @@ extern void __rtnl_unlock(void); | |||
| 1065 | } \ | 718 | } \ |
| 1066 | } while(0) | 719 | } while(0) |
| 1067 | 720 | ||
| 721 | static inline u32 rtm_get_table(struct rtattr **rta, u8 table) | ||
| 722 | { | ||
| 723 | return RTA_GET_U32(rta[RTA_TABLE-1]); | ||
| 724 | rtattr_failure: | ||
| 725 | return table; | ||
| 726 | } | ||
| 727 | |||
| 1068 | #endif /* __KERNEL__ */ | 728 | #endif /* __KERNEL__ */ |
| 1069 | 729 | ||
| 1070 | 730 | ||
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h index 66ff545552..4efbd9c445 100644 --- a/include/linux/scatterlist.h +++ b/include/linux/scatterlist.h | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | #include <linux/mm.h> | 5 | #include <linux/mm.h> |
| 6 | #include <linux/string.h> | 6 | #include <linux/string.h> |
| 7 | 7 | ||
| 8 | static inline void sg_set_buf(struct scatterlist *sg, void *buf, | 8 | static inline void sg_set_buf(struct scatterlist *sg, const void *buf, |
| 9 | unsigned int buflen) | 9 | unsigned int buflen) |
| 10 | { | 10 | { |
| 11 | sg->page = virt_to_page(buf); | 11 | sg->page = virt_to_page(buf); |
| @@ -13,7 +13,7 @@ static inline void sg_set_buf(struct scatterlist *sg, void *buf, | |||
| 13 | sg->length = buflen; | 13 | sg->length = buflen; |
| 14 | } | 14 | } |
| 15 | 15 | ||
| 16 | static inline void sg_init_one(struct scatterlist *sg, void *buf, | 16 | static inline void sg_init_one(struct scatterlist *sg, const void *buf, |
| 17 | unsigned int buflen) | 17 | unsigned int buflen) |
| 18 | { | 18 | { |
| 19 | memset(sg, 0, sizeof(*sg)); | 19 | memset(sg, 0, sizeof(*sg)); |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 34ed0d99b1..7ef899c47c 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -148,6 +148,7 @@ extern unsigned long weighted_cpuload(const int cpu); | |||
| 148 | #define EXIT_DEAD 32 | 148 | #define EXIT_DEAD 32 |
| 149 | /* in tsk->state again */ | 149 | /* in tsk->state again */ |
| 150 | #define TASK_NONINTERACTIVE 64 | 150 | #define TASK_NONINTERACTIVE 64 |
| 151 | #define TASK_DEAD 128 | ||
| 151 | 152 | ||
| 152 | #define __set_task_state(tsk, state_value) \ | 153 | #define __set_task_state(tsk, state_value) \ |
| 153 | do { (tsk)->state = (state_value); } while (0) | 154 | do { (tsk)->state = (state_value); } while (0) |
| @@ -504,8 +505,8 @@ struct signal_struct { | |||
| 504 | #define rt_prio(prio) unlikely((prio) < MAX_RT_PRIO) | 505 | #define rt_prio(prio) unlikely((prio) < MAX_RT_PRIO) |
| 505 | #define rt_task(p) rt_prio((p)->prio) | 506 | #define rt_task(p) rt_prio((p)->prio) |
| 506 | #define batch_task(p) (unlikely((p)->policy == SCHED_BATCH)) | 507 | #define batch_task(p) (unlikely((p)->policy == SCHED_BATCH)) |
| 507 | #define has_rt_policy(p) \ | 508 | #define is_rt_policy(p) ((p) != SCHED_NORMAL && (p) != SCHED_BATCH) |
| 508 | unlikely((p)->policy != SCHED_NORMAL && (p)->policy != SCHED_BATCH) | 509 | #define has_rt_policy(p) unlikely(is_rt_policy((p)->policy)) |
| 509 | 510 | ||
| 510 | /* | 511 | /* |
| 511 | * Some day this will be a full-fledged user tracking system.. | 512 | * Some day this will be a full-fledged user tracking system.. |
| @@ -709,7 +710,6 @@ extern unsigned int max_cache_size; | |||
| 709 | 710 | ||
| 710 | 711 | ||
| 711 | struct io_context; /* See blkdev.h */ | 712 | struct io_context; /* See blkdev.h */ |
| 712 | void exit_io_context(void); | ||
| 713 | struct cpuset; | 713 | struct cpuset; |
| 714 | 714 | ||
| 715 | #define NGROUPS_SMALL 32 | 715 | #define NGROUPS_SMALL 32 |
| @@ -784,8 +784,9 @@ struct task_struct { | |||
| 784 | struct prio_array *array; | 784 | struct prio_array *array; |
| 785 | 785 | ||
| 786 | unsigned short ioprio; | 786 | unsigned short ioprio; |
| 787 | #ifdef CONFIG_BLK_DEV_IO_TRACE | ||
| 787 | unsigned int btrace_seq; | 788 | unsigned int btrace_seq; |
| 788 | 789 | #endif | |
| 789 | unsigned long sleep_avg; | 790 | unsigned long sleep_avg; |
| 790 | unsigned long long timestamp, last_ran; | 791 | unsigned long long timestamp, last_ran; |
| 791 | unsigned long long sched_time; /* sched_clock time spent running */ | 792 | unsigned long long sched_time; /* sched_clock time spent running */ |
| @@ -819,6 +820,11 @@ struct task_struct { | |||
| 819 | unsigned did_exec:1; | 820 | unsigned did_exec:1; |
| 820 | pid_t pid; | 821 | pid_t pid; |
| 821 | pid_t tgid; | 822 | pid_t tgid; |
| 823 | |||
| 824 | #ifdef CONFIG_CC_STACKPROTECTOR | ||
| 825 | /* Canary value for the -fstack-protector gcc feature */ | ||
| 826 | unsigned long stack_canary; | ||
| 827 | #endif | ||
| 822 | /* | 828 | /* |
| 823 | * pointers to (original) parent process, youngest child, younger sibling, | 829 | * pointers to (original) parent process, youngest child, younger sibling, |
| 824 | * older sibling, respectively. (p->father can be replaced with | 830 | * older sibling, respectively. (p->father can be replaced with |
| @@ -865,6 +871,15 @@ struct task_struct { | |||
| 865 | struct key *thread_keyring; /* keyring private to this thread */ | 871 | struct key *thread_keyring; /* keyring private to this thread */ |
| 866 | unsigned char jit_keyring; /* default keyring to attach requested keys to */ | 872 | unsigned char jit_keyring; /* default keyring to attach requested keys to */ |
| 867 | #endif | 873 | #endif |
| 874 | /* | ||
| 875 | * fpu_counter contains the number of consecutive context switches | ||
| 876 | * that the FPU is used. If this is over a threshold, the lazy fpu | ||
| 877 | * saving becomes unlazy to save the trap. This is an unsigned char | ||
| 878 | * so that after 256 times the counter wraps and the behavior turns | ||
| 879 | * lazy again; this to deal with bursty apps that only use FPU for | ||
| 880 | * a short time | ||
| 881 | */ | ||
| 882 | unsigned char fpu_counter; | ||
| 868 | int oomkilladj; /* OOM kill score adjustment (bit shift). */ | 883 | int oomkilladj; /* OOM kill score adjustment (bit shift). */ |
| 869 | char comm[TASK_COMM_LEN]; /* executable name excluding path | 884 | char comm[TASK_COMM_LEN]; /* executable name excluding path |
| 870 | - access with [gs]et_task_comm (which lock | 885 | - access with [gs]et_task_comm (which lock |
| @@ -872,8 +887,10 @@ struct task_struct { | |||
| 872 | - initialized normally by flush_old_exec */ | 887 | - initialized normally by flush_old_exec */ |
| 873 | /* file system info */ | 888 | /* file system info */ |
| 874 | int link_count, total_link_count; | 889 | int link_count, total_link_count; |
| 890 | #ifdef CONFIG_SYSVIPC | ||
| 875 | /* ipc stuff */ | 891 | /* ipc stuff */ |
| 876 | struct sysv_sem sysvsem; | 892 | struct sysv_sem sysvsem; |
| 893 | #endif | ||
| 877 | /* CPU-specific state of this task */ | 894 | /* CPU-specific state of this task */ |
| 878 | struct thread_struct thread; | 895 | struct thread_struct thread; |
| 879 | /* filesystem information */ | 896 | /* filesystem information */ |
| @@ -964,10 +981,10 @@ struct task_struct { | |||
| 964 | wait_queue_t *io_wait; | 981 | wait_queue_t *io_wait; |
| 965 | /* i/o counters(bytes read/written, #syscalls */ | 982 | /* i/o counters(bytes read/written, #syscalls */ |
| 966 | u64 rchar, wchar, syscr, syscw; | 983 | u64 rchar, wchar, syscr, syscw; |
| 967 | #if defined(CONFIG_BSD_PROCESS_ACCT) | 984 | #if defined(CONFIG_TASK_XACCT) |
| 968 | u64 acct_rss_mem1; /* accumulated rss usage */ | 985 | u64 acct_rss_mem1; /* accumulated rss usage */ |
| 969 | u64 acct_vm_mem1; /* accumulated virtual memory usage */ | 986 | u64 acct_vm_mem1; /* accumulated virtual memory usage */ |
| 970 | clock_t acct_stimexpd; /* clock_t-converted stime since last update */ | 987 | cputime_t acct_stimexpd;/* stime since last update */ |
| 971 | #endif | 988 | #endif |
| 972 | #ifdef CONFIG_NUMA | 989 | #ifdef CONFIG_NUMA |
| 973 | struct mempolicy *mempolicy; | 990 | struct mempolicy *mempolicy; |
| @@ -1016,6 +1033,16 @@ static inline int pid_alive(struct task_struct *p) | |||
| 1016 | return p->pids[PIDTYPE_PID].pid != NULL; | 1033 | return p->pids[PIDTYPE_PID].pid != NULL; |
| 1017 | } | 1034 | } |
| 1018 | 1035 | ||
| 1036 | /** | ||
| 1037 | * is_init - check if a task structure is the first user space | ||
| 1038 | * task the kernel created. | ||
| 1039 | * @p: Task structure to be checked. | ||
| 1040 | */ | ||
| 1041 | static inline int is_init(struct task_struct *tsk) | ||
| 1042 | { | ||
| 1043 | return tsk->pid == 1; | ||
| 1044 | } | ||
| 1045 | |||
| 1019 | extern void free_task(struct task_struct *tsk); | 1046 | extern void free_task(struct task_struct *tsk); |
| 1020 | #define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0) | 1047 | #define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0) |
| 1021 | 1048 | ||
| @@ -1034,7 +1061,6 @@ static inline void put_task_struct(struct task_struct *t) | |||
| 1034 | /* Not implemented yet, only for 486*/ | 1061 | /* Not implemented yet, only for 486*/ |
| 1035 | #define PF_STARTING 0x00000002 /* being created */ | 1062 | #define PF_STARTING 0x00000002 /* being created */ |
| 1036 | #define PF_EXITING 0x00000004 /* getting shut down */ | 1063 | #define PF_EXITING 0x00000004 /* getting shut down */ |
| 1037 | #define PF_DEAD 0x00000008 /* Dead */ | ||
| 1038 | #define PF_FORKNOEXEC 0x00000040 /* forked but didn't exec */ | 1064 | #define PF_FORKNOEXEC 0x00000040 /* forked but didn't exec */ |
| 1039 | #define PF_SUPERPRIV 0x00000100 /* used super-user privileges */ | 1065 | #define PF_SUPERPRIV 0x00000100 /* used super-user privileges */ |
| 1040 | #define PF_DUMPCORE 0x00000200 /* dumped core */ | 1066 | #define PF_DUMPCORE 0x00000200 /* dumped core */ |
| @@ -1179,7 +1205,7 @@ extern void switch_uid(struct user_struct *); | |||
| 1179 | 1205 | ||
| 1180 | #include <asm/current.h> | 1206 | #include <asm/current.h> |
| 1181 | 1207 | ||
| 1182 | extern void do_timer(struct pt_regs *); | 1208 | extern void do_timer(unsigned long ticks); |
| 1183 | 1209 | ||
| 1184 | extern int FASTCALL(wake_up_state(struct task_struct * tsk, unsigned int state)); | 1210 | extern int FASTCALL(wake_up_state(struct task_struct * tsk, unsigned int state)); |
| 1185 | extern int FASTCALL(wake_up_process(struct task_struct * tsk)); | 1211 | extern int FASTCALL(wake_up_process(struct task_struct * tsk)); |
diff --git a/include/linux/scx200_gpio.h b/include/linux/scx200_gpio.h index 90dd069cc1..1a82d30c4b 100644 --- a/include/linux/scx200_gpio.h +++ b/include/linux/scx200_gpio.h | |||
| @@ -4,6 +4,7 @@ u32 scx200_gpio_configure(unsigned index, u32 set, u32 clear); | |||
| 4 | 4 | ||
| 5 | extern unsigned scx200_gpio_base; | 5 | extern unsigned scx200_gpio_base; |
| 6 | extern long scx200_gpio_shadow[2]; | 6 | extern long scx200_gpio_shadow[2]; |
| 7 | extern struct nsc_gpio_ops scx200_gpio_ops; | ||
| 7 | 8 | ||
| 8 | #define scx200_gpio_present() (scx200_gpio_base!=0) | 9 | #define scx200_gpio_present() (scx200_gpio_base!=0) |
| 9 | 10 | ||
diff --git a/include/linux/security.h b/include/linux/security.h index 6bc2aad494..9b5fea81f5 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
| @@ -31,6 +31,8 @@ | |||
| 31 | #include <linux/msg.h> | 31 | #include <linux/msg.h> |
| 32 | #include <linux/sched.h> | 32 | #include <linux/sched.h> |
| 33 | #include <linux/key.h> | 33 | #include <linux/key.h> |
| 34 | #include <linux/xfrm.h> | ||
| 35 | #include <net/flow.h> | ||
| 34 | 36 | ||
| 35 | struct ctl_table; | 37 | struct ctl_table; |
| 36 | 38 | ||
| @@ -88,6 +90,7 @@ extern int cap_netlink_recv(struct sk_buff *skb, int cap); | |||
| 88 | struct nfsctl_arg; | 90 | struct nfsctl_arg; |
| 89 | struct sched_param; | 91 | struct sched_param; |
| 90 | struct swap_info_struct; | 92 | struct swap_info_struct; |
| 93 | struct request_sock; | ||
| 91 | 94 | ||
| 92 | /* bprm_apply_creds unsafe reasons */ | 95 | /* bprm_apply_creds unsafe reasons */ |
| 93 | #define LSM_UNSAFE_SHARE 1 | 96 | #define LSM_UNSAFE_SHARE 1 |
| @@ -812,9 +815,19 @@ struct swap_info_struct; | |||
| 812 | * which is used to copy security attributes between local stream sockets. | 815 | * which is used to copy security attributes between local stream sockets. |
| 813 | * @sk_free_security: | 816 | * @sk_free_security: |
| 814 | * Deallocate security structure. | 817 | * Deallocate security structure. |
| 815 | * @sk_getsid: | 818 | * @sk_clone_security: |
| 816 | * Retrieve the LSM-specific sid for the sock to enable caching of network | 819 | * Clone/copy security structure. |
| 820 | * @sk_getsecid: | ||
| 821 | * Retrieve the LSM-specific secid for the sock to enable caching of network | ||
| 817 | * authorizations. | 822 | * authorizations. |
| 823 | * @sock_graft: | ||
| 824 | * Sets the socket's isec sid to the sock's sid. | ||
| 825 | * @inet_conn_request: | ||
| 826 | * Sets the openreq's sid to socket's sid with MLS portion taken from peer sid. | ||
| 827 | * @inet_csk_clone: | ||
| 828 | * Sets the new child socket's sid to the openreq sid. | ||
| 829 | * @req_classify_flow: | ||
| 830 | * Sets the flow's sid to the openreq sid. | ||
| 818 | * | 831 | * |
| 819 | * Security hooks for XFRM operations. | 832 | * Security hooks for XFRM operations. |
| 820 | * | 833 | * |
| @@ -823,9 +836,10 @@ struct swap_info_struct; | |||
| 823 | * used by the XFRM system. | 836 | * used by the XFRM system. |
| 824 | * @sec_ctx contains the security context information being provided by | 837 | * @sec_ctx contains the security context information being provided by |
| 825 | * the user-level policy update program (e.g., setkey). | 838 | * the user-level policy update program (e.g., setkey). |
| 826 | * Allocate a security structure to the xp->security field. | 839 | * @sk refers to the sock from which to derive the security context. |
| 827 | * The security field is initialized to NULL when the xfrm_policy is | 840 | * Allocate a security structure to the xp->security field; the security |
| 828 | * allocated. | 841 | * field is initialized to NULL when the xfrm_policy is allocated. Only |
| 842 | * one of sec_ctx or sock can be specified. | ||
| 829 | * Return 0 if operation was successful (memory to allocate, legal context) | 843 | * Return 0 if operation was successful (memory to allocate, legal context) |
| 830 | * @xfrm_policy_clone_security: | 844 | * @xfrm_policy_clone_security: |
| 831 | * @old contains an existing xfrm_policy in the SPD. | 845 | * @old contains an existing xfrm_policy in the SPD. |
| @@ -844,9 +858,14 @@ struct swap_info_struct; | |||
| 844 | * Database by the XFRM system. | 858 | * Database by the XFRM system. |
| 845 | * @sec_ctx contains the security context information being provided by | 859 | * @sec_ctx contains the security context information being provided by |
| 846 | * the user-level SA generation program (e.g., setkey or racoon). | 860 | * the user-level SA generation program (e.g., setkey or racoon). |
| 847 | * Allocate a security structure to the x->security field. The | 861 | * @polsec contains the security context information associated with a xfrm |
| 848 | * security field is initialized to NULL when the xfrm_state is | 862 | * policy rule from which to take the base context. polsec must be NULL |
| 849 | * allocated. | 863 | * when sec_ctx is specified. |
| 864 | * @secid contains the secid from which to take the mls portion of the context. | ||
| 865 | * Allocate a security structure to the x->security field; the security | ||
| 866 | * field is initialized to NULL when the xfrm_state is allocated. Set the | ||
| 867 | * context to correspond to either sec_ctx or polsec, with the mls portion | ||
| 868 | * taken from secid in the latter case. | ||
| 850 | * Return 0 if operation was successful (memory to allocate, legal context). | 869 | * Return 0 if operation was successful (memory to allocate, legal context). |
| 851 | * @xfrm_state_free_security: | 870 | * @xfrm_state_free_security: |
| 852 | * @x contains the xfrm_state. | 871 | * @x contains the xfrm_state. |
| @@ -857,13 +876,27 @@ struct swap_info_struct; | |||
| 857 | * @xfrm_policy_lookup: | 876 | * @xfrm_policy_lookup: |
| 858 | * @xp contains the xfrm_policy for which the access control is being | 877 | * @xp contains the xfrm_policy for which the access control is being |
| 859 | * checked. | 878 | * checked. |
| 860 | * @sk_sid contains the sock security label that is used to authorize | 879 | * @fl_secid contains the flow security label that is used to authorize |
| 861 | * access to the policy xp. | 880 | * access to the policy xp. |
| 862 | * @dir contains the direction of the flow (input or output). | 881 | * @dir contains the direction of the flow (input or output). |
| 863 | * Check permission when a sock selects a xfrm_policy for processing | 882 | * Check permission when a flow selects a xfrm_policy for processing |
| 864 | * XFRMs on a packet. The hook is called when selecting either a | 883 | * XFRMs on a packet. The hook is called when selecting either a |
| 865 | * per-socket policy or a generic xfrm policy. | 884 | * per-socket policy or a generic xfrm policy. |
| 866 | * Return 0 if permission is granted. | 885 | * Return 0 if permission is granted. |
| 886 | * @xfrm_state_pol_flow_match: | ||
| 887 | * @x contains the state to match. | ||
| 888 | * @xp contains the policy to check for a match. | ||
| 889 | * @fl contains the flow to check for a match. | ||
| 890 | * Return 1 if there is a match. | ||
| 891 | * @xfrm_flow_state_match: | ||
| 892 | * @fl contains the flow key to match. | ||
| 893 | * @xfrm points to the xfrm_state to match. | ||
| 894 | * Return 1 if there is a match. | ||
| 895 | * @xfrm_decode_session: | ||
| 896 | * @skb points to skb to decode. | ||
| 897 | * @secid points to the flow key secid to set. | ||
| 898 | * @ckall says if all xfrms used should be checked for same secid. | ||
| 899 | * Return 0 if ckall is zero or all xfrms used have the same secid. | ||
| 867 | * | 900 | * |
| 868 | * Security hooks affecting all Key Management operations | 901 | * Security hooks affecting all Key Management operations |
| 869 | * | 902 | * |
| @@ -1308,8 +1341,8 @@ struct security_operations { | |||
| 1308 | int (*unix_may_send) (struct socket * sock, struct socket * other); | 1341 | int (*unix_may_send) (struct socket * sock, struct socket * other); |
| 1309 | 1342 | ||
| 1310 | int (*socket_create) (int family, int type, int protocol, int kern); | 1343 | int (*socket_create) (int family, int type, int protocol, int kern); |
| 1311 | void (*socket_post_create) (struct socket * sock, int family, | 1344 | int (*socket_post_create) (struct socket * sock, int family, |
| 1312 | int type, int protocol, int kern); | 1345 | int type, int protocol, int kern); |
| 1313 | int (*socket_bind) (struct socket * sock, | 1346 | int (*socket_bind) (struct socket * sock, |
| 1314 | struct sockaddr * address, int addrlen); | 1347 | struct sockaddr * address, int addrlen); |
| 1315 | int (*socket_connect) (struct socket * sock, | 1348 | int (*socket_connect) (struct socket * sock, |
| @@ -1332,18 +1365,31 @@ struct security_operations { | |||
| 1332 | int (*socket_getpeersec_dgram) (struct socket *sock, struct sk_buff *skb, u32 *secid); | 1365 | int (*socket_getpeersec_dgram) (struct socket *sock, struct sk_buff *skb, u32 *secid); |
| 1333 | int (*sk_alloc_security) (struct sock *sk, int family, gfp_t priority); | 1366 | int (*sk_alloc_security) (struct sock *sk, int family, gfp_t priority); |
| 1334 | void (*sk_free_security) (struct sock *sk); | 1367 | void (*sk_free_security) (struct sock *sk); |
| 1335 | unsigned int (*sk_getsid) (struct sock *sk, struct flowi *fl, u8 dir); | 1368 | void (*sk_clone_security) (const struct sock *sk, struct sock *newsk); |
| 1369 | void (*sk_getsecid) (struct sock *sk, u32 *secid); | ||
| 1370 | void (*sock_graft)(struct sock* sk, struct socket *parent); | ||
| 1371 | int (*inet_conn_request)(struct sock *sk, struct sk_buff *skb, | ||
| 1372 | struct request_sock *req); | ||
| 1373 | void (*inet_csk_clone)(struct sock *newsk, const struct request_sock *req); | ||
| 1374 | void (*req_classify_flow)(const struct request_sock *req, struct flowi *fl); | ||
| 1336 | #endif /* CONFIG_SECURITY_NETWORK */ | 1375 | #endif /* CONFIG_SECURITY_NETWORK */ |
| 1337 | 1376 | ||
| 1338 | #ifdef CONFIG_SECURITY_NETWORK_XFRM | 1377 | #ifdef CONFIG_SECURITY_NETWORK_XFRM |
| 1339 | int (*xfrm_policy_alloc_security) (struct xfrm_policy *xp, struct xfrm_user_sec_ctx *sec_ctx); | 1378 | int (*xfrm_policy_alloc_security) (struct xfrm_policy *xp, |
| 1379 | struct xfrm_user_sec_ctx *sec_ctx, struct sock *sk); | ||
| 1340 | int (*xfrm_policy_clone_security) (struct xfrm_policy *old, struct xfrm_policy *new); | 1380 | int (*xfrm_policy_clone_security) (struct xfrm_policy *old, struct xfrm_policy *new); |
| 1341 | void (*xfrm_policy_free_security) (struct xfrm_policy *xp); | 1381 | void (*xfrm_policy_free_security) (struct xfrm_policy *xp); |
| 1342 | int (*xfrm_policy_delete_security) (struct xfrm_policy *xp); | 1382 | int (*xfrm_policy_delete_security) (struct xfrm_policy *xp); |
| 1343 | int (*xfrm_state_alloc_security) (struct xfrm_state *x, struct xfrm_user_sec_ctx *sec_ctx); | 1383 | int (*xfrm_state_alloc_security) (struct xfrm_state *x, |
| 1384 | struct xfrm_user_sec_ctx *sec_ctx, struct xfrm_sec_ctx *polsec, | ||
| 1385 | u32 secid); | ||
| 1344 | void (*xfrm_state_free_security) (struct xfrm_state *x); | 1386 | void (*xfrm_state_free_security) (struct xfrm_state *x); |
| 1345 | int (*xfrm_state_delete_security) (struct xfrm_state *x); | 1387 | int (*xfrm_state_delete_security) (struct xfrm_state *x); |
| 1346 | int (*xfrm_policy_lookup)(struct xfrm_policy *xp, u32 sk_sid, u8 dir); | 1388 | int (*xfrm_policy_lookup)(struct xfrm_policy *xp, u32 fl_secid, u8 dir); |
| 1389 | int (*xfrm_state_pol_flow_match)(struct xfrm_state *x, | ||
| 1390 | struct xfrm_policy *xp, struct flowi *fl); | ||
| 1391 | int (*xfrm_flow_state_match)(struct flowi *fl, struct xfrm_state *xfrm); | ||
| 1392 | int (*xfrm_decode_session)(struct sk_buff *skb, u32 *secid, int ckall); | ||
| 1347 | #endif /* CONFIG_SECURITY_NETWORK_XFRM */ | 1393 | #endif /* CONFIG_SECURITY_NETWORK_XFRM */ |
| 1348 | 1394 | ||
| 1349 | /* key management security hooks */ | 1395 | /* key management security hooks */ |
| @@ -1549,6 +1595,7 @@ static inline void security_sb_post_pivotroot (struct nameidata *old_nd, | |||
| 1549 | 1595 | ||
| 1550 | static inline int security_inode_alloc (struct inode *inode) | 1596 | static inline int security_inode_alloc (struct inode *inode) |
| 1551 | { | 1597 | { |
| 1598 | inode->i_security = NULL; | ||
| 1552 | return security_ops->inode_alloc_security (inode); | 1599 | return security_ops->inode_alloc_security (inode); |
| 1553 | } | 1600 | } |
| 1554 | 1601 | ||
| @@ -2778,13 +2825,13 @@ static inline int security_socket_create (int family, int type, | |||
| 2778 | return security_ops->socket_create(family, type, protocol, kern); | 2825 | return security_ops->socket_create(family, type, protocol, kern); |
| 2779 | } | 2826 | } |
| 2780 | 2827 | ||
| 2781 | static inline void security_socket_post_create(struct socket * sock, | 2828 | static inline int security_socket_post_create(struct socket * sock, |
| 2782 | int family, | 2829 | int family, |
| 2783 | int type, | 2830 | int type, |
| 2784 | int protocol, int kern) | 2831 | int protocol, int kern) |
| 2785 | { | 2832 | { |
| 2786 | security_ops->socket_post_create(sock, family, type, | 2833 | return security_ops->socket_post_create(sock, family, type, |
| 2787 | protocol, kern); | 2834 | protocol, kern); |
| 2788 | } | 2835 | } |
| 2789 | 2836 | ||
| 2790 | static inline int security_socket_bind(struct socket * sock, | 2837 | static inline int security_socket_bind(struct socket * sock, |
| @@ -2885,9 +2932,36 @@ static inline void security_sk_free(struct sock *sk) | |||
| 2885 | return security_ops->sk_free_security(sk); | 2932 | return security_ops->sk_free_security(sk); |
| 2886 | } | 2933 | } |
| 2887 | 2934 | ||
| 2888 | static inline unsigned int security_sk_sid(struct sock *sk, struct flowi *fl, u8 dir) | 2935 | static inline void security_sk_clone(const struct sock *sk, struct sock *newsk) |
| 2936 | { | ||
| 2937 | return security_ops->sk_clone_security(sk, newsk); | ||
| 2938 | } | ||
| 2939 | |||
| 2940 | static inline void security_sk_classify_flow(struct sock *sk, struct flowi *fl) | ||
| 2889 | { | 2941 | { |
| 2890 | return security_ops->sk_getsid(sk, fl, dir); | 2942 | security_ops->sk_getsecid(sk, &fl->secid); |
| 2943 | } | ||
| 2944 | |||
| 2945 | static inline void security_req_classify_flow(const struct request_sock *req, struct flowi *fl) | ||
| 2946 | { | ||
| 2947 | security_ops->req_classify_flow(req, fl); | ||
| 2948 | } | ||
| 2949 | |||
| 2950 | static inline void security_sock_graft(struct sock* sk, struct socket *parent) | ||
| 2951 | { | ||
| 2952 | security_ops->sock_graft(sk, parent); | ||
| 2953 | } | ||
| 2954 | |||
| 2955 | static inline int security_inet_conn_request(struct sock *sk, | ||
| 2956 | struct sk_buff *skb, struct request_sock *req) | ||
| 2957 | { | ||
| 2958 | return security_ops->inet_conn_request(sk, skb, req); | ||
| 2959 | } | ||
| 2960 | |||
| 2961 | static inline void security_inet_csk_clone(struct sock *newsk, | ||
| 2962 | const struct request_sock *req) | ||
| 2963 | { | ||
| 2964 | security_ops->inet_csk_clone(newsk, req); | ||
| 2891 | } | 2965 | } |
| 2892 | #else /* CONFIG_SECURITY_NETWORK */ | 2966 | #else /* CONFIG_SECURITY_NETWORK */ |
| 2893 | static inline int security_unix_stream_connect(struct socket * sock, | 2967 | static inline int security_unix_stream_connect(struct socket * sock, |
| @@ -2909,11 +2983,12 @@ static inline int security_socket_create (int family, int type, | |||
| 2909 | return 0; | 2983 | return 0; |
| 2910 | } | 2984 | } |
| 2911 | 2985 | ||
| 2912 | static inline void security_socket_post_create(struct socket * sock, | 2986 | static inline int security_socket_post_create(struct socket * sock, |
| 2913 | int family, | 2987 | int family, |
| 2914 | int type, | 2988 | int type, |
| 2915 | int protocol, int kern) | 2989 | int protocol, int kern) |
| 2916 | { | 2990 | { |
| 2991 | return 0; | ||
| 2917 | } | 2992 | } |
| 2918 | 2993 | ||
| 2919 | static inline int security_socket_bind(struct socket * sock, | 2994 | static inline int security_socket_bind(struct socket * sock, |
| @@ -3011,16 +3086,43 @@ static inline void security_sk_free(struct sock *sk) | |||
| 3011 | { | 3086 | { |
| 3012 | } | 3087 | } |
| 3013 | 3088 | ||
| 3014 | static inline unsigned int security_sk_sid(struct sock *sk, struct flowi *fl, u8 dir) | 3089 | static inline void security_sk_clone(const struct sock *sk, struct sock *newsk) |
| 3090 | { | ||
| 3091 | } | ||
| 3092 | |||
| 3093 | static inline void security_sk_classify_flow(struct sock *sk, struct flowi *fl) | ||
| 3094 | { | ||
| 3095 | } | ||
| 3096 | |||
| 3097 | static inline void security_req_classify_flow(const struct request_sock *req, struct flowi *fl) | ||
| 3098 | { | ||
| 3099 | } | ||
| 3100 | |||
| 3101 | static inline void security_sock_graft(struct sock* sk, struct socket *parent) | ||
| 3102 | { | ||
| 3103 | } | ||
| 3104 | |||
| 3105 | static inline int security_inet_conn_request(struct sock *sk, | ||
| 3106 | struct sk_buff *skb, struct request_sock *req) | ||
| 3015 | { | 3107 | { |
| 3016 | return 0; | 3108 | return 0; |
| 3017 | } | 3109 | } |
| 3110 | |||
| 3111 | static inline void security_inet_csk_clone(struct sock *newsk, | ||
| 3112 | const struct request_sock *req) | ||
| 3113 | { | ||
| 3114 | } | ||
| 3018 | #endif /* CONFIG_SECURITY_NETWORK */ | 3115 | #endif /* CONFIG_SECURITY_NETWORK */ |
| 3019 | 3116 | ||
| 3020 | #ifdef CONFIG_SECURITY_NETWORK_XFRM | 3117 | #ifdef CONFIG_SECURITY_NETWORK_XFRM |
| 3021 | static inline int security_xfrm_policy_alloc(struct xfrm_policy *xp, struct xfrm_user_sec_ctx *sec_ctx) | 3118 | static inline int security_xfrm_policy_alloc(struct xfrm_policy *xp, struct xfrm_user_sec_ctx *sec_ctx) |
| 3022 | { | 3119 | { |
| 3023 | return security_ops->xfrm_policy_alloc_security(xp, sec_ctx); | 3120 | return security_ops->xfrm_policy_alloc_security(xp, sec_ctx, NULL); |
| 3121 | } | ||
| 3122 | |||
| 3123 | static inline int security_xfrm_sock_policy_alloc(struct xfrm_policy *xp, struct sock *sk) | ||
| 3124 | { | ||
| 3125 | return security_ops->xfrm_policy_alloc_security(xp, NULL, sk); | ||
| 3024 | } | 3126 | } |
| 3025 | 3127 | ||
| 3026 | static inline int security_xfrm_policy_clone(struct xfrm_policy *old, struct xfrm_policy *new) | 3128 | static inline int security_xfrm_policy_clone(struct xfrm_policy *old, struct xfrm_policy *new) |
| @@ -3038,9 +3140,18 @@ static inline int security_xfrm_policy_delete(struct xfrm_policy *xp) | |||
| 3038 | return security_ops->xfrm_policy_delete_security(xp); | 3140 | return security_ops->xfrm_policy_delete_security(xp); |
| 3039 | } | 3141 | } |
| 3040 | 3142 | ||
| 3041 | static inline int security_xfrm_state_alloc(struct xfrm_state *x, struct xfrm_user_sec_ctx *sec_ctx) | 3143 | static inline int security_xfrm_state_alloc(struct xfrm_state *x, |
| 3144 | struct xfrm_user_sec_ctx *sec_ctx) | ||
| 3042 | { | 3145 | { |
| 3043 | return security_ops->xfrm_state_alloc_security(x, sec_ctx); | 3146 | return security_ops->xfrm_state_alloc_security(x, sec_ctx, NULL, 0); |
| 3147 | } | ||
| 3148 | |||
| 3149 | static inline int security_xfrm_state_alloc_acquire(struct xfrm_state *x, | ||
| 3150 | struct xfrm_sec_ctx *polsec, u32 secid) | ||
| 3151 | { | ||
| 3152 | if (!polsec) | ||
| 3153 | return 0; | ||
| 3154 | return security_ops->xfrm_state_alloc_security(x, NULL, polsec, secid); | ||
| 3044 | } | 3155 | } |
| 3045 | 3156 | ||
| 3046 | static inline int security_xfrm_state_delete(struct xfrm_state *x) | 3157 | static inline int security_xfrm_state_delete(struct xfrm_state *x) |
| @@ -3053,9 +3164,32 @@ static inline void security_xfrm_state_free(struct xfrm_state *x) | |||
| 3053 | security_ops->xfrm_state_free_security(x); | 3164 | security_ops->xfrm_state_free_security(x); |
| 3054 | } | 3165 | } |
| 3055 | 3166 | ||
| 3056 | static inline int security_xfrm_policy_lookup(struct xfrm_policy *xp, u32 sk_sid, u8 dir) | 3167 | static inline int security_xfrm_policy_lookup(struct xfrm_policy *xp, u32 fl_secid, u8 dir) |
| 3168 | { | ||
| 3169 | return security_ops->xfrm_policy_lookup(xp, fl_secid, dir); | ||
| 3170 | } | ||
| 3171 | |||
| 3172 | static inline int security_xfrm_state_pol_flow_match(struct xfrm_state *x, | ||
| 3173 | struct xfrm_policy *xp, struct flowi *fl) | ||
| 3057 | { | 3174 | { |
| 3058 | return security_ops->xfrm_policy_lookup(xp, sk_sid, dir); | 3175 | return security_ops->xfrm_state_pol_flow_match(x, xp, fl); |
| 3176 | } | ||
| 3177 | |||
| 3178 | static inline int security_xfrm_flow_state_match(struct flowi *fl, struct xfrm_state *xfrm) | ||
| 3179 | { | ||
| 3180 | return security_ops->xfrm_flow_state_match(fl, xfrm); | ||
| 3181 | } | ||
| 3182 | |||
| 3183 | static inline int security_xfrm_decode_session(struct sk_buff *skb, u32 *secid) | ||
| 3184 | { | ||
| 3185 | return security_ops->xfrm_decode_session(skb, secid, 1); | ||
| 3186 | } | ||
| 3187 | |||
| 3188 | static inline void security_skb_classify_flow(struct sk_buff *skb, struct flowi *fl) | ||
| 3189 | { | ||
| 3190 | int rc = security_ops->xfrm_decode_session(skb, &fl->secid, 0); | ||
| 3191 | |||
| 3192 | BUG_ON(rc); | ||
| 3059 | } | 3193 | } |
| 3060 | #else /* CONFIG_SECURITY_NETWORK_XFRM */ | 3194 | #else /* CONFIG_SECURITY_NETWORK_XFRM */ |
| 3061 | static inline int security_xfrm_policy_alloc(struct xfrm_policy *xp, struct xfrm_user_sec_ctx *sec_ctx) | 3195 | static inline int security_xfrm_policy_alloc(struct xfrm_policy *xp, struct xfrm_user_sec_ctx *sec_ctx) |
| @@ -3063,6 +3197,11 @@ static inline int security_xfrm_policy_alloc(struct xfrm_policy *xp, struct xfrm | |||
| 3063 | return 0; | 3197 | return 0; |
| 3064 | } | 3198 | } |
| 3065 | 3199 | ||
| 3200 | static inline int security_xfrm_sock_policy_alloc(struct xfrm_policy *xp, struct sock *sk) | ||
| 3201 | { | ||
| 3202 | return 0; | ||
| 3203 | } | ||
| 3204 | |||
| 3066 | static inline int security_xfrm_policy_clone(struct xfrm_policy *old, struct xfrm_policy *new) | 3205 | static inline int security_xfrm_policy_clone(struct xfrm_policy *old, struct xfrm_policy *new) |
| 3067 | { | 3206 | { |
| 3068 | return 0; | 3207 | return 0; |
| @@ -3077,7 +3216,14 @@ static inline int security_xfrm_policy_delete(struct xfrm_policy *xp) | |||
| 3077 | return 0; | 3216 | return 0; |
| 3078 | } | 3217 | } |
| 3079 | 3218 | ||
| 3080 | static inline int security_xfrm_state_alloc(struct xfrm_state *x, struct xfrm_user_sec_ctx *sec_ctx) | 3219 | static inline int security_xfrm_state_alloc(struct xfrm_state *x, |
| 3220 | struct xfrm_user_sec_ctx *sec_ctx) | ||
| 3221 | { | ||
| 3222 | return 0; | ||
| 3223 | } | ||
| 3224 | |||
| 3225 | static inline int security_xfrm_state_alloc_acquire(struct xfrm_state *x, | ||
| 3226 | struct xfrm_sec_ctx *polsec, u32 secid) | ||
| 3081 | { | 3227 | { |
| 3082 | return 0; | 3228 | return 0; |
| 3083 | } | 3229 | } |
| @@ -3091,10 +3237,32 @@ static inline int security_xfrm_state_delete(struct xfrm_state *x) | |||
| 3091 | return 0; | 3237 | return 0; |
| 3092 | } | 3238 | } |
| 3093 | 3239 | ||
| 3094 | static inline int security_xfrm_policy_lookup(struct xfrm_policy *xp, u32 sk_sid, u8 dir) | 3240 | static inline int security_xfrm_policy_lookup(struct xfrm_policy *xp, u32 fl_secid, u8 dir) |
| 3241 | { | ||
| 3242 | return 0; | ||
| 3243 | } | ||
| 3244 | |||
| 3245 | static inline int security_xfrm_state_pol_flow_match(struct xfrm_state *x, | ||
| 3246 | struct xfrm_policy *xp, struct flowi *fl) | ||
| 3247 | { | ||
| 3248 | return 1; | ||
| 3249 | } | ||
| 3250 | |||
| 3251 | static inline int security_xfrm_flow_state_match(struct flowi *fl, | ||
| 3252 | struct xfrm_state *xfrm) | ||
| 3253 | { | ||
| 3254 | return 1; | ||
| 3255 | } | ||
| 3256 | |||
| 3257 | static inline int security_xfrm_decode_session(struct sk_buff *skb, u32 *secid) | ||
| 3095 | { | 3258 | { |
| 3096 | return 0; | 3259 | return 0; |
| 3097 | } | 3260 | } |
| 3261 | |||
| 3262 | static inline void security_skb_classify_flow(struct sk_buff *skb, struct flowi *fl) | ||
| 3263 | { | ||
| 3264 | } | ||
| 3265 | |||
| 3098 | #endif /* CONFIG_SECURITY_NETWORK_XFRM */ | 3266 | #endif /* CONFIG_SECURITY_NETWORK_XFRM */ |
| 3099 | 3267 | ||
| 3100 | #ifdef CONFIG_KEYS | 3268 | #ifdef CONFIG_KEYS |
diff --git a/include/linux/selinux.h b/include/linux/selinux.h index aad4e390d6..d1b7ca6c1c 100644 --- a/include/linux/selinux.h +++ b/include/linux/selinux.h | |||
| @@ -46,7 +46,7 @@ void selinux_audit_rule_free(struct selinux_audit_rule *rule); | |||
| 46 | 46 | ||
| 47 | /** | 47 | /** |
| 48 | * selinux_audit_rule_match - determine if a context ID matches a rule. | 48 | * selinux_audit_rule_match - determine if a context ID matches a rule. |
| 49 | * @ctxid: the context ID to check | 49 | * @sid: the context ID to check |
| 50 | * @field: the field this rule refers to | 50 | * @field: the field this rule refers to |
| 51 | * @op: the operater the rule uses | 51 | * @op: the operater the rule uses |
| 52 | * @rule: pointer to the audit rule to check against | 52 | * @rule: pointer to the audit rule to check against |
| @@ -55,7 +55,7 @@ void selinux_audit_rule_free(struct selinux_audit_rule *rule); | |||
| 55 | * Returns 1 if the context id matches the rule, 0 if it does not, and | 55 | * Returns 1 if the context id matches the rule, 0 if it does not, and |
| 56 | * -errno on failure. | 56 | * -errno on failure. |
| 57 | */ | 57 | */ |
| 58 | int selinux_audit_rule_match(u32 ctxid, u32 field, u32 op, | 58 | int selinux_audit_rule_match(u32 sid, u32 field, u32 op, |
| 59 | struct selinux_audit_rule *rule, | 59 | struct selinux_audit_rule *rule, |
| 60 | struct audit_context *actx); | 60 | struct audit_context *actx); |
| 61 | 61 | ||
| @@ -70,18 +70,8 @@ int selinux_audit_rule_match(u32 ctxid, u32 field, u32 op, | |||
| 70 | void selinux_audit_set_callback(int (*callback)(void)); | 70 | void selinux_audit_set_callback(int (*callback)(void)); |
| 71 | 71 | ||
| 72 | /** | 72 | /** |
| 73 | * selinux_task_ctxid - determine a context ID for a process. | 73 | * selinux_sid_to_string - map a security context ID to a string |
| 74 | * @tsk: the task object | 74 | * @sid: security context ID to be converted. |
| 75 | * @ctxid: ID value returned via this | ||
| 76 | * | ||
| 77 | * On return, ctxid will contain an ID for the context. This value | ||
| 78 | * should only be used opaquely. | ||
| 79 | */ | ||
| 80 | void selinux_task_ctxid(struct task_struct *tsk, u32 *ctxid); | ||
| 81 | |||
| 82 | /** | ||
| 83 | * selinux_ctxid_to_string - map a security context ID to a string | ||
| 84 | * @ctxid: security context ID to be converted. | ||
| 85 | * @ctx: address of context string to be returned | 75 | * @ctx: address of context string to be returned |
| 86 | * @ctxlen: length of returned context string. | 76 | * @ctxlen: length of returned context string. |
| 87 | * | 77 | * |
| @@ -89,7 +79,7 @@ void selinux_task_ctxid(struct task_struct *tsk, u32 *ctxid); | |||
| 89 | * string will be allocated internally, and the caller must call | 79 | * string will be allocated internally, and the caller must call |
| 90 | * kfree() on it after use. | 80 | * kfree() on it after use. |
| 91 | */ | 81 | */ |
| 92 | int selinux_ctxid_to_string(u32 ctxid, char **ctx, u32 *ctxlen); | 82 | int selinux_sid_to_string(u32 sid, char **ctx, u32 *ctxlen); |
| 93 | 83 | ||
| 94 | /** | 84 | /** |
| 95 | * selinux_get_inode_sid - get the inode's security context ID | 85 | * selinux_get_inode_sid - get the inode's security context ID |
| @@ -154,7 +144,7 @@ static inline void selinux_audit_rule_free(struct selinux_audit_rule *rule) | |||
| 154 | return; | 144 | return; |
| 155 | } | 145 | } |
| 156 | 146 | ||
| 157 | static inline int selinux_audit_rule_match(u32 ctxid, u32 field, u32 op, | 147 | static inline int selinux_audit_rule_match(u32 sid, u32 field, u32 op, |
| 158 | struct selinux_audit_rule *rule, | 148 | struct selinux_audit_rule *rule, |
| 159 | struct audit_context *actx) | 149 | struct audit_context *actx) |
| 160 | { | 150 | { |
| @@ -166,12 +156,7 @@ static inline void selinux_audit_set_callback(int (*callback)(void)) | |||
| 166 | return; | 156 | return; |
| 167 | } | 157 | } |
| 168 | 158 | ||
| 169 | static inline void selinux_task_ctxid(struct task_struct *tsk, u32 *ctxid) | 159 | static inline int selinux_sid_to_string(u32 sid, char **ctx, u32 *ctxlen) |
| 170 | { | ||
| 171 | *ctxid = 0; | ||
| 172 | } | ||
| 173 | |||
| 174 | static inline int selinux_ctxid_to_string(u32 ctxid, char **ctx, u32 *ctxlen) | ||
| 175 | { | 160 | { |
| 176 | *ctx = NULL; | 161 | *ctx = NULL; |
| 177 | *ctxlen = 0; | 162 | *ctxlen = 0; |
diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h index c057f0b323..f3c5189911 100644 --- a/include/linux/shmem_fs.h +++ b/include/linux/shmem_fs.h | |||
| @@ -19,6 +19,10 @@ struct shmem_inode_info { | |||
| 19 | swp_entry_t i_direct[SHMEM_NR_DIRECT]; /* first blocks */ | 19 | swp_entry_t i_direct[SHMEM_NR_DIRECT]; /* first blocks */ |
| 20 | struct list_head swaplist; /* chain of maybes on swap */ | 20 | struct list_head swaplist; /* chain of maybes on swap */ |
| 21 | struct inode vfs_inode; | 21 | struct inode vfs_inode; |
| 22 | #ifdef CONFIG_TMPFS_POSIX_ACL | ||
| 23 | struct posix_acl *i_acl; | ||
| 24 | struct posix_acl *i_default_acl; | ||
| 25 | #endif | ||
| 22 | }; | 26 | }; |
| 23 | 27 | ||
| 24 | struct shmem_sb_info { | 28 | struct shmem_sb_info { |
| @@ -36,4 +40,24 @@ static inline struct shmem_inode_info *SHMEM_I(struct inode *inode) | |||
| 36 | return container_of(inode, struct shmem_inode_info, vfs_inode); | 40 | return container_of(inode, struct shmem_inode_info, vfs_inode); |
| 37 | } | 41 | } |
| 38 | 42 | ||
| 43 | #ifdef CONFIG_TMPFS_POSIX_ACL | ||
| 44 | int shmem_permission(struct inode *, int, struct nameidata *); | ||
| 45 | int shmem_acl_init(struct inode *, struct inode *); | ||
| 46 | void shmem_acl_destroy_inode(struct inode *); | ||
| 47 | |||
| 48 | extern struct xattr_handler shmem_xattr_acl_access_handler; | ||
| 49 | extern struct xattr_handler shmem_xattr_acl_default_handler; | ||
| 50 | |||
| 51 | extern struct generic_acl_operations shmem_acl_ops; | ||
| 52 | |||
| 53 | #else | ||
| 54 | static inline int shmem_acl_init(struct inode *inode, struct inode *dir) | ||
| 55 | { | ||
| 56 | return 0; | ||
| 57 | } | ||
| 58 | static inline void shmem_acl_destroy_inode(struct inode *inode) | ||
| 59 | { | ||
| 60 | } | ||
| 61 | #endif /* CONFIG_TMPFS_POSIX_ACL */ | ||
| 62 | |||
| 39 | #endif | 63 | #endif |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 755e9cddac..85577a4ffa 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
| @@ -34,8 +34,9 @@ | |||
| 34 | #define HAVE_ALIGNABLE_SKB /* Ditto 8) */ | 34 | #define HAVE_ALIGNABLE_SKB /* Ditto 8) */ |
| 35 | 35 | ||
| 36 | #define CHECKSUM_NONE 0 | 36 | #define CHECKSUM_NONE 0 |
| 37 | #define CHECKSUM_HW 1 | 37 | #define CHECKSUM_PARTIAL 1 |
| 38 | #define CHECKSUM_UNNECESSARY 2 | 38 | #define CHECKSUM_UNNECESSARY 2 |
| 39 | #define CHECKSUM_COMPLETE 3 | ||
| 39 | 40 | ||
| 40 | #define SKB_DATA_ALIGN(X) (((X) + (SMP_CACHE_BYTES - 1)) & \ | 41 | #define SKB_DATA_ALIGN(X) (((X) + (SMP_CACHE_BYTES - 1)) & \ |
| 41 | ~(SMP_CACHE_BYTES - 1)) | 42 | ~(SMP_CACHE_BYTES - 1)) |
| @@ -56,17 +57,17 @@ | |||
| 56 | * Apparently with secret goal to sell you new device, when you | 57 | * Apparently with secret goal to sell you new device, when you |
| 57 | * will add new protocol to your host. F.e. IPv6. 8) | 58 | * will add new protocol to your host. F.e. IPv6. 8) |
| 58 | * | 59 | * |
| 59 | * HW: the most generic way. Device supplied checksum of _all_ | 60 | * COMPLETE: the most generic way. Device supplied checksum of _all_ |
| 60 | * the packet as seen by netif_rx in skb->csum. | 61 | * the packet as seen by netif_rx in skb->csum. |
| 61 | * NOTE: Even if device supports only some protocols, but | 62 | * NOTE: Even if device supports only some protocols, but |
| 62 | * is able to produce some skb->csum, it MUST use HW, | 63 | * is able to produce some skb->csum, it MUST use COMPLETE, |
| 63 | * not UNNECESSARY. | 64 | * not UNNECESSARY. |
| 64 | * | 65 | * |
| 65 | * B. Checksumming on output. | 66 | * B. Checksumming on output. |
| 66 | * | 67 | * |
| 67 | * NONE: skb is checksummed by protocol or csum is not required. | 68 | * NONE: skb is checksummed by protocol or csum is not required. |
| 68 | * | 69 | * |
| 69 | * HW: device is required to csum packet as seen by hard_start_xmit | 70 | * PARTIAL: device is required to csum packet as seen by hard_start_xmit |
| 70 | * from skb->h.raw to the end and to record the checksum | 71 | * from skb->h.raw to the end and to record the checksum |
| 71 | * at skb->h.raw+skb->csum. | 72 | * at skb->h.raw+skb->csum. |
| 72 | * | 73 | * |
| @@ -1261,14 +1262,14 @@ static inline int skb_linearize_cow(struct sk_buff *skb) | |||
| 1261 | * @len: length of data pulled | 1262 | * @len: length of data pulled |
| 1262 | * | 1263 | * |
| 1263 | * After doing a pull on a received packet, you need to call this to | 1264 | * After doing a pull on a received packet, you need to call this to |
| 1264 | * update the CHECKSUM_HW checksum, or set ip_summed to CHECKSUM_NONE | 1265 | * update the CHECKSUM_COMPLETE checksum, or set ip_summed to |
| 1265 | * so that it can be recomputed from scratch. | 1266 | * CHECKSUM_NONE so that it can be recomputed from scratch. |
| 1266 | */ | 1267 | */ |
| 1267 | 1268 | ||
| 1268 | static inline void skb_postpull_rcsum(struct sk_buff *skb, | 1269 | static inline void skb_postpull_rcsum(struct sk_buff *skb, |
| 1269 | const void *start, unsigned int len) | 1270 | const void *start, unsigned int len) |
| 1270 | { | 1271 | { |
| 1271 | if (skb->ip_summed == CHECKSUM_HW) | 1272 | if (skb->ip_summed == CHECKSUM_COMPLETE) |
| 1272 | skb->csum = csum_sub(skb->csum, csum_partial(start, len, 0)); | 1273 | skb->csum = csum_sub(skb->csum, csum_partial(start, len, 0)); |
| 1273 | } | 1274 | } |
| 1274 | 1275 | ||
| @@ -1287,7 +1288,7 @@ static inline int pskb_trim_rcsum(struct sk_buff *skb, unsigned int len) | |||
| 1287 | { | 1288 | { |
| 1288 | if (likely(len >= skb->len)) | 1289 | if (likely(len >= skb->len)) |
| 1289 | return 0; | 1290 | return 0; |
| 1290 | if (skb->ip_summed == CHECKSUM_HW) | 1291 | if (skb->ip_summed == CHECKSUM_COMPLETE) |
| 1291 | skb->ip_summed = CHECKSUM_NONE; | 1292 | skb->ip_summed = CHECKSUM_NONE; |
| 1292 | return __pskb_trim(skb, len); | 1293 | return __pskb_trim(skb, len); |
| 1293 | } | 1294 | } |
diff --git a/include/linux/slab.h b/include/linux/slab.h index 45ad55b70d..a96fd9310d 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
| @@ -60,14 +60,13 @@ extern void __init kmem_cache_init(void); | |||
| 60 | extern kmem_cache_t *kmem_cache_create(const char *, size_t, size_t, unsigned long, | 60 | extern kmem_cache_t *kmem_cache_create(const char *, size_t, size_t, unsigned long, |
| 61 | void (*)(void *, kmem_cache_t *, unsigned long), | 61 | void (*)(void *, kmem_cache_t *, unsigned long), |
| 62 | void (*)(void *, kmem_cache_t *, unsigned long)); | 62 | void (*)(void *, kmem_cache_t *, unsigned long)); |
| 63 | extern int kmem_cache_destroy(kmem_cache_t *); | 63 | extern void kmem_cache_destroy(kmem_cache_t *); |
| 64 | extern int kmem_cache_shrink(kmem_cache_t *); | 64 | extern int kmem_cache_shrink(kmem_cache_t *); |
| 65 | extern void *kmem_cache_alloc(kmem_cache_t *, gfp_t); | 65 | extern void *kmem_cache_alloc(kmem_cache_t *, gfp_t); |
| 66 | extern void *kmem_cache_zalloc(struct kmem_cache *, gfp_t); | 66 | extern void *kmem_cache_zalloc(struct kmem_cache *, gfp_t); |
| 67 | extern void kmem_cache_free(kmem_cache_t *, void *); | 67 | extern void kmem_cache_free(kmem_cache_t *, void *); |
| 68 | extern unsigned int kmem_cache_size(kmem_cache_t *); | 68 | extern unsigned int kmem_cache_size(kmem_cache_t *); |
| 69 | extern const char *kmem_cache_name(kmem_cache_t *); | 69 | extern const char *kmem_cache_name(kmem_cache_t *); |
| 70 | extern kmem_cache_t *kmem_find_general_cachep(size_t size, gfp_t gfpflags); | ||
| 71 | 70 | ||
| 72 | /* Size description struct for general caches. */ | 71 | /* Size description struct for general caches. */ |
| 73 | struct cache_sizes { | 72 | struct cache_sizes { |
| @@ -203,7 +202,30 @@ extern int slab_is_available(void); | |||
| 203 | 202 | ||
| 204 | #ifdef CONFIG_NUMA | 203 | #ifdef CONFIG_NUMA |
| 205 | extern void *kmem_cache_alloc_node(kmem_cache_t *, gfp_t flags, int node); | 204 | extern void *kmem_cache_alloc_node(kmem_cache_t *, gfp_t flags, int node); |
| 206 | extern void *kmalloc_node(size_t size, gfp_t flags, int node); | 205 | extern void *__kmalloc_node(size_t size, gfp_t flags, int node); |
| 206 | |||
| 207 | static inline void *kmalloc_node(size_t size, gfp_t flags, int node) | ||
| 208 | { | ||
| 209 | if (__builtin_constant_p(size)) { | ||
| 210 | int i = 0; | ||
| 211 | #define CACHE(x) \ | ||
| 212 | if (size <= x) \ | ||
| 213 | goto found; \ | ||
| 214 | else \ | ||
| 215 | i++; | ||
| 216 | #include "kmalloc_sizes.h" | ||
| 217 | #undef CACHE | ||
| 218 | { | ||
| 219 | extern void __you_cannot_kmalloc_that_much(void); | ||
| 220 | __you_cannot_kmalloc_that_much(); | ||
| 221 | } | ||
| 222 | found: | ||
| 223 | return kmem_cache_alloc_node((flags & GFP_DMA) ? | ||
| 224 | malloc_sizes[i].cs_dmacachep : | ||
| 225 | malloc_sizes[i].cs_cachep, flags, node); | ||
| 226 | } | ||
| 227 | return __kmalloc_node(size, flags, node); | ||
| 228 | } | ||
| 207 | #else | 229 | #else |
| 208 | static inline void *kmem_cache_alloc_node(kmem_cache_t *cachep, gfp_t flags, int node) | 230 | static inline void *kmem_cache_alloc_node(kmem_cache_t *cachep, gfp_t flags, int node) |
| 209 | { | 231 | { |
| @@ -223,12 +245,11 @@ extern int FASTCALL(kmem_ptr_validate(kmem_cache_t *cachep, void *ptr)); | |||
| 223 | /* SLOB allocator routines */ | 245 | /* SLOB allocator routines */ |
| 224 | 246 | ||
| 225 | void kmem_cache_init(void); | 247 | void kmem_cache_init(void); |
| 226 | struct kmem_cache *kmem_find_general_cachep(size_t, gfp_t gfpflags); | ||
| 227 | struct kmem_cache *kmem_cache_create(const char *c, size_t, size_t, | 248 | struct kmem_cache *kmem_cache_create(const char *c, size_t, size_t, |
| 228 | unsigned long, | 249 | unsigned long, |
| 229 | void (*)(void *, struct kmem_cache *, unsigned long), | 250 | void (*)(void *, struct kmem_cache *, unsigned long), |
| 230 | void (*)(void *, struct kmem_cache *, unsigned long)); | 251 | void (*)(void *, struct kmem_cache *, unsigned long)); |
| 231 | int kmem_cache_destroy(struct kmem_cache *c); | 252 | void kmem_cache_destroy(struct kmem_cache *c); |
| 232 | void *kmem_cache_alloc(struct kmem_cache *c, gfp_t flags); | 253 | void *kmem_cache_alloc(struct kmem_cache *c, gfp_t flags); |
| 233 | void *kmem_cache_zalloc(struct kmem_cache *, gfp_t); | 254 | void *kmem_cache_zalloc(struct kmem_cache *, gfp_t); |
| 234 | void kmem_cache_free(struct kmem_cache *c, void *b); | 255 | void kmem_cache_free(struct kmem_cache *c, void *b); |
| @@ -263,8 +284,6 @@ extern kmem_cache_t *fs_cachep; | |||
| 263 | extern kmem_cache_t *sighand_cachep; | 284 | extern kmem_cache_t *sighand_cachep; |
| 264 | extern kmem_cache_t *bio_cachep; | 285 | extern kmem_cache_t *bio_cachep; |
| 265 | 286 | ||
| 266 | extern atomic_t slab_reclaim_pages; | ||
| 267 | |||
| 268 | #endif /* __KERNEL__ */ | 287 | #endif /* __KERNEL__ */ |
| 269 | 288 | ||
| 270 | #endif /* _LINUX_SLAB_H */ | 289 | #endif /* _LINUX_SLAB_H */ |
diff --git a/include/linux/smb.h b/include/linux/smb.h index b0162208c9..f098dff93f 100644 --- a/include/linux/smb.h +++ b/include/linux/smb.h | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | #define _LINUX_SMB_H | 10 | #define _LINUX_SMB_H |
| 11 | 11 | ||
| 12 | #include <linux/types.h> | 12 | #include <linux/types.h> |
| 13 | #include <linux/magic.h> | ||
| 13 | 14 | ||
| 14 | enum smb_protocol { | 15 | enum smb_protocol { |
| 15 | SMB_PROTOCOL_NONE, | 16 | SMB_PROTOCOL_NONE, |
| @@ -88,7 +89,6 @@ struct smb_fattr { | |||
| 88 | struct timespec f_atime; | 89 | struct timespec f_atime; |
| 89 | struct timespec f_mtime; | 90 | struct timespec f_mtime; |
| 90 | struct timespec f_ctime; | 91 | struct timespec f_ctime; |
| 91 | unsigned long f_blksize; | ||
| 92 | unsigned long f_blocks; | 92 | unsigned long f_blocks; |
| 93 | int f_unix; | 93 | int f_unix; |
| 94 | }; | 94 | }; |
| @@ -101,8 +101,6 @@ enum smb_conn_state { | |||
| 101 | CONN_RETRYING /* Currently trying to reconnect */ | 101 | CONN_RETRYING /* Currently trying to reconnect */ |
| 102 | }; | 102 | }; |
| 103 | 103 | ||
| 104 | #define SMB_SUPER_MAGIC 0x517B | ||
| 105 | |||
| 106 | #define SMB_HEADER_LEN 37 /* includes everything up to, but not | 104 | #define SMB_HEADER_LEN 37 /* includes everything up to, but not |
| 107 | * including smb_bcc */ | 105 | * including smb_bcc */ |
| 108 | 106 | ||
diff --git a/include/linux/smp.h b/include/linux/smp.h index 837e8bce13..51649987f6 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h | |||
| @@ -53,6 +53,9 @@ extern void smp_cpus_done(unsigned int max_cpus); | |||
| 53 | */ | 53 | */ |
| 54 | int smp_call_function(void(*func)(void *info), void *info, int retry, int wait); | 54 | int smp_call_function(void(*func)(void *info), void *info, int retry, int wait); |
| 55 | 55 | ||
| 56 | int smp_call_function_single(int cpuid, void (*func) (void *info), void *info, | ||
| 57 | int retry, int wait); | ||
| 58 | |||
| 56 | /* | 59 | /* |
| 57 | * Call a function on all processors | 60 | * Call a function on all processors |
| 58 | */ | 61 | */ |
diff --git a/include/linux/snmp.h b/include/linux/snmp.h index 4db25d5c7c..854aa6b543 100644 --- a/include/linux/snmp.h +++ b/include/linux/snmp.h | |||
| @@ -155,42 +155,11 @@ enum | |||
| 155 | UDP_MIB_NOPORTS, /* NoPorts */ | 155 | UDP_MIB_NOPORTS, /* NoPorts */ |
| 156 | UDP_MIB_INERRORS, /* InErrors */ | 156 | UDP_MIB_INERRORS, /* InErrors */ |
| 157 | UDP_MIB_OUTDATAGRAMS, /* OutDatagrams */ | 157 | UDP_MIB_OUTDATAGRAMS, /* OutDatagrams */ |
| 158 | UDP_MIB_RCVBUFERRORS, /* RcvbufErrors */ | ||
| 159 | UDP_MIB_SNDBUFERRORS, /* SndbufErrors */ | ||
| 158 | __UDP_MIB_MAX | 160 | __UDP_MIB_MAX |
| 159 | }; | 161 | }; |
| 160 | 162 | ||
| 161 | /* sctp mib definitions */ | ||
| 162 | /* | ||
| 163 | * draft-ietf-sigtran-sctp-mib-07.txt | ||
| 164 | */ | ||
| 165 | enum | ||
| 166 | { | ||
| 167 | SCTP_MIB_NUM = 0, | ||
| 168 | SCTP_MIB_CURRESTAB, /* CurrEstab */ | ||
| 169 | SCTP_MIB_ACTIVEESTABS, /* ActiveEstabs */ | ||
| 170 | SCTP_MIB_PASSIVEESTABS, /* PassiveEstabs */ | ||
| 171 | SCTP_MIB_ABORTEDS, /* Aborteds */ | ||
| 172 | SCTP_MIB_SHUTDOWNS, /* Shutdowns */ | ||
| 173 | SCTP_MIB_OUTOFBLUES, /* OutOfBlues */ | ||
| 174 | SCTP_MIB_CHECKSUMERRORS, /* ChecksumErrors */ | ||
| 175 | SCTP_MIB_OUTCTRLCHUNKS, /* OutCtrlChunks */ | ||
| 176 | SCTP_MIB_OUTORDERCHUNKS, /* OutOrderChunks */ | ||
| 177 | SCTP_MIB_OUTUNORDERCHUNKS, /* OutUnorderChunks */ | ||
| 178 | SCTP_MIB_INCTRLCHUNKS, /* InCtrlChunks */ | ||
| 179 | SCTP_MIB_INORDERCHUNKS, /* InOrderChunks */ | ||
| 180 | SCTP_MIB_INUNORDERCHUNKS, /* InUnorderChunks */ | ||
| 181 | SCTP_MIB_FRAGUSRMSGS, /* FragUsrMsgs */ | ||
| 182 | SCTP_MIB_REASMUSRMSGS, /* ReasmUsrMsgs */ | ||
| 183 | SCTP_MIB_OUTSCTPPACKS, /* OutSCTPPacks */ | ||
| 184 | SCTP_MIB_INSCTPPACKS, /* InSCTPPacks */ | ||
| 185 | SCTP_MIB_RTOALGORITHM, /* RtoAlgorithm */ | ||
| 186 | SCTP_MIB_RTOMIN, /* RtoMin */ | ||
| 187 | SCTP_MIB_RTOMAX, /* RtoMax */ | ||
| 188 | SCTP_MIB_RTOINITIAL, /* RtoInitial */ | ||
| 189 | SCTP_MIB_VALCOOKIELIFE, /* ValCookieLife */ | ||
| 190 | SCTP_MIB_MAXINITRETR, /* MaxInitRetr */ | ||
| 191 | __SCTP_MIB_MAX | ||
| 192 | }; | ||
| 193 | |||
| 194 | /* linux mib definitions */ | 163 | /* linux mib definitions */ |
| 195 | enum | 164 | enum |
| 196 | { | 165 | { |
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index 31473db92d..b800d2d68b 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h | |||
| @@ -167,9 +167,9 @@ do { \ | |||
| 167 | * regardless of whether CONFIG_SMP or CONFIG_PREEMPT are set. The various | 167 | * regardless of whether CONFIG_SMP or CONFIG_PREEMPT are set. The various |
| 168 | * methods are defined as nops in the case they are not required. | 168 | * methods are defined as nops in the case they are not required. |
| 169 | */ | 169 | */ |
| 170 | #define spin_trylock(lock) __cond_lock(_spin_trylock(lock)) | 170 | #define spin_trylock(lock) __cond_lock(lock, _spin_trylock(lock)) |
| 171 | #define read_trylock(lock) __cond_lock(_read_trylock(lock)) | 171 | #define read_trylock(lock) __cond_lock(lock, _read_trylock(lock)) |
| 172 | #define write_trylock(lock) __cond_lock(_write_trylock(lock)) | 172 | #define write_trylock(lock) __cond_lock(lock, _write_trylock(lock)) |
| 173 | 173 | ||
| 174 | #define spin_lock(lock) _spin_lock(lock) | 174 | #define spin_lock(lock) _spin_lock(lock) |
| 175 | 175 | ||
| @@ -236,19 +236,19 @@ do { \ | |||
| 236 | _write_unlock_irqrestore(lock, flags) | 236 | _write_unlock_irqrestore(lock, flags) |
| 237 | #define write_unlock_bh(lock) _write_unlock_bh(lock) | 237 | #define write_unlock_bh(lock) _write_unlock_bh(lock) |
| 238 | 238 | ||
| 239 | #define spin_trylock_bh(lock) __cond_lock(_spin_trylock_bh(lock)) | 239 | #define spin_trylock_bh(lock) __cond_lock(lock, _spin_trylock_bh(lock)) |
| 240 | 240 | ||
| 241 | #define spin_trylock_irq(lock) \ | 241 | #define spin_trylock_irq(lock) \ |
| 242 | ({ \ | 242 | ({ \ |
| 243 | local_irq_disable(); \ | 243 | local_irq_disable(); \ |
| 244 | _spin_trylock(lock) ? \ | 244 | spin_trylock(lock) ? \ |
| 245 | 1 : ({ local_irq_enable(); 0; }); \ | 245 | 1 : ({ local_irq_enable(); 0; }); \ |
| 246 | }) | 246 | }) |
| 247 | 247 | ||
| 248 | #define spin_trylock_irqsave(lock, flags) \ | 248 | #define spin_trylock_irqsave(lock, flags) \ |
| 249 | ({ \ | 249 | ({ \ |
| 250 | local_irq_save(flags); \ | 250 | local_irq_save(flags); \ |
| 251 | _spin_trylock(lock) ? \ | 251 | spin_trylock(lock) ? \ |
| 252 | 1 : ({ local_irq_restore(flags); 0; }); \ | 252 | 1 : ({ local_irq_restore(flags); 0; }); \ |
| 253 | }) | 253 | }) |
| 254 | 254 | ||
| @@ -264,7 +264,7 @@ do { \ | |||
| 264 | */ | 264 | */ |
| 265 | extern int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock); | 265 | extern int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock); |
| 266 | #define atomic_dec_and_lock(atomic, lock) \ | 266 | #define atomic_dec_and_lock(atomic, lock) \ |
| 267 | __cond_lock(_atomic_dec_and_lock(atomic, lock)) | 267 | __cond_lock(lock, _atomic_dec_and_lock(atomic, lock)) |
| 268 | 268 | ||
| 269 | /** | 269 | /** |
| 270 | * spin_can_lock - would spin_trylock() succeed? | 270 | * spin_can_lock - would spin_trylock() succeed? |
diff --git a/include/linux/spinlock_api_smp.h b/include/linux/spinlock_api_smp.h index b2c4f82994..8828b8155e 100644 --- a/include/linux/spinlock_api_smp.h +++ b/include/linux/spinlock_api_smp.h | |||
| @@ -19,41 +19,41 @@ int in_lock_functions(unsigned long addr); | |||
| 19 | 19 | ||
| 20 | #define assert_spin_locked(x) BUG_ON(!spin_is_locked(x)) | 20 | #define assert_spin_locked(x) BUG_ON(!spin_is_locked(x)) |
| 21 | 21 | ||
| 22 | void __lockfunc _spin_lock(spinlock_t *lock) __acquires(spinlock_t); | 22 | void __lockfunc _spin_lock(spinlock_t *lock) __acquires(lock); |
| 23 | void __lockfunc _spin_lock_nested(spinlock_t *lock, int subclass) | 23 | void __lockfunc _spin_lock_nested(spinlock_t *lock, int subclass) |
| 24 | __acquires(spinlock_t); | 24 | __acquires(lock); |
| 25 | void __lockfunc _read_lock(rwlock_t *lock) __acquires(rwlock_t); | 25 | void __lockfunc _read_lock(rwlock_t *lock) __acquires(lock); |
| 26 | void __lockfunc _write_lock(rwlock_t *lock) __acquires(rwlock_t); | 26 | void __lockfunc _write_lock(rwlock_t *lock) __acquires(lock); |
| 27 | void __lockfunc _spin_lock_bh(spinlock_t *lock) __acquires(spinlock_t); | 27 | void __lockfunc _spin_lock_bh(spinlock_t *lock) __acquires(lock); |
| 28 | void __lockfunc _read_lock_bh(rwlock_t *lock) __acquires(rwlock_t); | 28 | void __lockfunc _read_lock_bh(rwlock_t *lock) __acquires(lock); |
| 29 | void __lockfunc _write_lock_bh(rwlock_t *lock) __acquires(rwlock_t); | 29 | void __lockfunc _write_lock_bh(rwlock_t *lock) __acquires(lock); |
| 30 | void __lockfunc _spin_lock_irq(spinlock_t *lock) __acquires(spinlock_t); | 30 | void __lockfunc _spin_lock_irq(spinlock_t *lock) __acquires(lock); |
| 31 | void __lockfunc _read_lock_irq(rwlock_t *lock) __acquires(rwlock_t); | 31 | void __lockfunc _read_lock_irq(rwlock_t *lock) __acquires(lock); |
| 32 | void __lockfunc _write_lock_irq(rwlock_t *lock) __acquires(rwlock_t); | 32 | void __lockfunc _write_lock_irq(rwlock_t *lock) __acquires(lock); |
| 33 | unsigned long __lockfunc _spin_lock_irqsave(spinlock_t *lock) | 33 | unsigned long __lockfunc _spin_lock_irqsave(spinlock_t *lock) |
| 34 | __acquires(spinlock_t); | 34 | __acquires(lock); |
| 35 | unsigned long __lockfunc _read_lock_irqsave(rwlock_t *lock) | 35 | unsigned long __lockfunc _read_lock_irqsave(rwlock_t *lock) |
| 36 | __acquires(rwlock_t); | 36 | __acquires(lock); |
| 37 | unsigned long __lockfunc _write_lock_irqsave(rwlock_t *lock) | 37 | unsigned long __lockfunc _write_lock_irqsave(rwlock_t *lock) |
| 38 | __acquires(rwlock_t); | 38 | __acquires(lock); |
| 39 | int __lockfunc _spin_trylock(spinlock_t *lock); | 39 | int __lockfunc _spin_trylock(spinlock_t *lock); |
| 40 | int __lockfunc _read_trylock(rwlock_t *lock); | 40 | int __lockfunc _read_trylock(rwlock_t *lock); |
| 41 | int __lockfunc _write_trylock(rwlock_t *lock); | 41 | int __lockfunc _write_trylock(rwlock_t *lock); |
| 42 | int __lockfunc _spin_trylock_bh(spinlock_t *lock); | 42 | int __lockfunc _spin_trylock_bh(spinlock_t *lock); |
| 43 | void __lockfunc _spin_unlock(spinlock_t *lock) __releases(spinlock_t); | 43 | void __lockfunc _spin_unlock(spinlock_t *lock) __releases(lock); |
| 44 | void __lockfunc _read_unlock(rwlock_t *lock) __releases(rwlock_t); | 44 | void __lockfunc _read_unlock(rwlock_t *lock) __releases(lock); |
| 45 | void __lockfunc _write_unlock(rwlock_t *lock) __releases(rwlock_t); | 45 | void __lockfunc _write_unlock(rwlock_t *lock) __releases(lock); |
| 46 | void __lockfunc _spin_unlock_bh(spinlock_t *lock) __releases(spinlock_t); | 46 | void __lockfunc _spin_unlock_bh(spinlock_t *lock) __releases(lock); |
| 47 | void __lockfunc _read_unlock_bh(rwlock_t *lock) __releases(rwlock_t); | 47 | void __lockfunc _read_unlock_bh(rwlock_t *lock) __releases(lock); |
| 48 | void __lockfunc _write_unlock_bh(rwlock_t *lock) __releases(rwlock_t); | 48 | void __lockfunc _write_unlock_bh(rwlock_t *lock) __releases(lock); |
| 49 | void __lockfunc _spin_unlock_irq(spinlock_t *lock) __releases(spinlock_t); | 49 | void __lockfunc _spin_unlock_irq(spinlock_t *lock) __releases(lock); |
| 50 | void __lockfunc _read_unlock_irq(rwlock_t *lock) __releases(rwlock_t); | 50 | void __lockfunc _read_unlock_irq(rwlock_t *lock) __releases(lock); |
| 51 | void __lockfunc _write_unlock_irq(rwlock_t *lock) __releases(rwlock_t); | 51 | void __lockfunc _write_unlock_irq(rwlock_t *lock) __releases(lock); |
| 52 | void __lockfunc _spin_unlock_irqrestore(spinlock_t *lock, unsigned long flags) | 52 | void __lockfunc _spin_unlock_irqrestore(spinlock_t *lock, unsigned long flags) |
| 53 | __releases(spinlock_t); | 53 | __releases(lock); |
| 54 | void __lockfunc _read_unlock_irqrestore(rwlock_t *lock, unsigned long flags) | 54 | void __lockfunc _read_unlock_irqrestore(rwlock_t *lock, unsigned long flags) |
| 55 | __releases(rwlock_t); | 55 | __releases(lock); |
| 56 | void __lockfunc _write_unlock_irqrestore(rwlock_t *lock, unsigned long flags) | 56 | void __lockfunc _write_unlock_irqrestore(rwlock_t *lock, unsigned long flags) |
| 57 | __releases(rwlock_t); | 57 | __releases(lock); |
| 58 | 58 | ||
| 59 | #endif /* __LINUX_SPINLOCK_API_SMP_H */ | 59 | #endif /* __LINUX_SPINLOCK_API_SMP_H */ |
diff --git a/include/linux/stacktrace.h b/include/linux/stacktrace.h index 9cc81e5722..50e2b01e51 100644 --- a/include/linux/stacktrace.h +++ b/include/linux/stacktrace.h | |||
| @@ -5,15 +5,16 @@ | |||
| 5 | struct stack_trace { | 5 | struct stack_trace { |
| 6 | unsigned int nr_entries, max_entries; | 6 | unsigned int nr_entries, max_entries; |
| 7 | unsigned long *entries; | 7 | unsigned long *entries; |
| 8 | int skip; /* input argument: How many entries to skip */ | ||
| 9 | int all_contexts; /* input argument: if true do than one stack */ | ||
| 8 | }; | 10 | }; |
| 9 | 11 | ||
| 10 | extern void save_stack_trace(struct stack_trace *trace, | 12 | extern void save_stack_trace(struct stack_trace *trace, |
| 11 | struct task_struct *task, int all_contexts, | 13 | struct task_struct *task); |
| 12 | unsigned int skip); | ||
| 13 | 14 | ||
| 14 | extern void print_stack_trace(struct stack_trace *trace, int spaces); | 15 | extern void print_stack_trace(struct stack_trace *trace, int spaces); |
| 15 | #else | 16 | #else |
| 16 | # define save_stack_trace(trace, task, all, skip) do { } while (0) | 17 | # define save_stack_trace(trace, task) do { } while (0) |
| 17 | # define print_stack_trace(trace) do { } while (0) | 18 | # define print_stack_trace(trace) do { } while (0) |
| 18 | #endif | 19 | #endif |
| 19 | 20 | ||
diff --git a/include/linux/stddef.h b/include/linux/stddef.h index b3a2cadf90..6a40c76bdc 100644 --- a/include/linux/stddef.h +++ b/include/linux/stddef.h | |||
| @@ -10,11 +10,19 @@ | |||
| 10 | #define NULL ((void *)0) | 10 | #define NULL ((void *)0) |
| 11 | #endif | 11 | #endif |
| 12 | 12 | ||
| 13 | #ifdef __KERNEL__ | ||
| 14 | |||
| 15 | enum { | ||
| 16 | false = 0, | ||
| 17 | true = 1 | ||
| 18 | }; | ||
| 19 | |||
| 13 | #undef offsetof | 20 | #undef offsetof |
| 14 | #ifdef __compiler_offsetof | 21 | #ifdef __compiler_offsetof |
| 15 | #define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER) | 22 | #define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER) |
| 16 | #else | 23 | #else |
| 17 | #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) | 24 | #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) |
| 18 | #endif | 25 | #endif |
| 26 | #endif /* __KERNEL__ */ | ||
| 19 | 27 | ||
| 20 | #endif | 28 | #endif |
diff --git a/include/linux/string.h b/include/linux/string.h index e4c7558603..4f69ef9e6e 100644 --- a/include/linux/string.h +++ b/include/linux/string.h | |||
| @@ -99,6 +99,7 @@ extern void * memchr(const void *,int,__kernel_size_t); | |||
| 99 | #endif | 99 | #endif |
| 100 | 100 | ||
| 101 | extern char *kstrdup(const char *s, gfp_t gfp); | 101 | extern char *kstrdup(const char *s, gfp_t gfp); |
| 102 | extern void *kmemdup(const void *src, size_t len, gfp_t gfp); | ||
| 102 | 103 | ||
| 103 | #ifdef __cplusplus | 104 | #ifdef __cplusplus |
| 104 | } | 105 | } |
diff --git a/include/linux/sunrpc/Kbuild b/include/linux/sunrpc/Kbuild index 0d1d768a27..fb438f158e 100644 --- a/include/linux/sunrpc/Kbuild +++ b/include/linux/sunrpc/Kbuild | |||
| @@ -1 +1 @@ | |||
| unifdef-y := debug.h | unifdef-y += debug.h | ||
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h index a6de332e57..862c0d8c83 100644 --- a/include/linux/sunrpc/auth.h +++ b/include/linux/sunrpc/auth.h | |||
| @@ -109,13 +109,13 @@ struct rpc_credops { | |||
| 109 | void (*crdestroy)(struct rpc_cred *); | 109 | void (*crdestroy)(struct rpc_cred *); |
| 110 | 110 | ||
| 111 | int (*crmatch)(struct auth_cred *, struct rpc_cred *, int); | 111 | int (*crmatch)(struct auth_cred *, struct rpc_cred *, int); |
| 112 | u32 * (*crmarshal)(struct rpc_task *, u32 *); | 112 | __be32 * (*crmarshal)(struct rpc_task *, __be32 *); |
| 113 | int (*crrefresh)(struct rpc_task *); | 113 | int (*crrefresh)(struct rpc_task *); |
| 114 | u32 * (*crvalidate)(struct rpc_task *, u32 *); | 114 | __be32 * (*crvalidate)(struct rpc_task *, __be32 *); |
| 115 | int (*crwrap_req)(struct rpc_task *, kxdrproc_t, | 115 | int (*crwrap_req)(struct rpc_task *, kxdrproc_t, |
| 116 | void *, u32 *, void *); | 116 | void *, __be32 *, void *); |
| 117 | int (*crunwrap_resp)(struct rpc_task *, kxdrproc_t, | 117 | int (*crunwrap_resp)(struct rpc_task *, kxdrproc_t, |
| 118 | void *, u32 *, void *); | 118 | void *, __be32 *, void *); |
| 119 | }; | 119 | }; |
| 120 | 120 | ||
| 121 | extern struct rpc_authops authunix_ops; | 121 | extern struct rpc_authops authunix_ops; |
| @@ -134,10 +134,10 @@ struct rpc_cred * rpcauth_bindcred(struct rpc_task *); | |||
| 134 | void rpcauth_holdcred(struct rpc_task *); | 134 | void rpcauth_holdcred(struct rpc_task *); |
| 135 | void put_rpccred(struct rpc_cred *); | 135 | void put_rpccred(struct rpc_cred *); |
| 136 | void rpcauth_unbindcred(struct rpc_task *); | 136 | void rpcauth_unbindcred(struct rpc_task *); |
| 137 | u32 * rpcauth_marshcred(struct rpc_task *, u32 *); | 137 | __be32 * rpcauth_marshcred(struct rpc_task *, __be32 *); |
| 138 | u32 * rpcauth_checkverf(struct rpc_task *, u32 *); | 138 | __be32 * rpcauth_checkverf(struct rpc_task *, __be32 *); |
| 139 | int rpcauth_wrap_req(struct rpc_task *task, kxdrproc_t encode, void *rqstp, u32 *data, void *obj); | 139 | int rpcauth_wrap_req(struct rpc_task *task, kxdrproc_t encode, void *rqstp, __be32 *data, void *obj); |
| 140 | int rpcauth_unwrap_resp(struct rpc_task *task, kxdrproc_t decode, void *rqstp, u32 *data, void *obj); | 140 | int rpcauth_unwrap_resp(struct rpc_task *task, kxdrproc_t decode, void *rqstp, __be32 *data, void *obj); |
| 141 | int rpcauth_refreshcred(struct rpc_task *); | 141 | int rpcauth_refreshcred(struct rpc_task *); |
| 142 | void rpcauth_invalcred(struct rpc_task *); | 142 | void rpcauth_invalcred(struct rpc_task *); |
| 143 | int rpcauth_uptodatecred(struct rpc_task *); | 143 | int rpcauth_uptodatecred(struct rpc_task *); |
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index 8fe9f35eba..f6d1d646ce 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h | |||
| @@ -18,18 +18,6 @@ | |||
| 18 | #include <linux/sunrpc/timer.h> | 18 | #include <linux/sunrpc/timer.h> |
| 19 | #include <asm/signal.h> | 19 | #include <asm/signal.h> |
| 20 | 20 | ||
| 21 | /* | ||
| 22 | * This defines an RPC port mapping | ||
| 23 | */ | ||
| 24 | struct rpc_portmap { | ||
| 25 | __u32 pm_prog; | ||
| 26 | __u32 pm_vers; | ||
| 27 | __u32 pm_prot; | ||
| 28 | __u16 pm_port; | ||
| 29 | unsigned char pm_binding : 1; /* doing a getport() */ | ||
| 30 | struct rpc_wait_queue pm_bindwait; /* waiting on getport() */ | ||
| 31 | }; | ||
| 32 | |||
| 33 | struct rpc_inode; | 21 | struct rpc_inode; |
| 34 | 22 | ||
| 35 | /* | 23 | /* |
| @@ -40,7 +28,9 @@ struct rpc_clnt { | |||
| 40 | atomic_t cl_users; /* number of references */ | 28 | atomic_t cl_users; /* number of references */ |
| 41 | struct rpc_xprt * cl_xprt; /* transport */ | 29 | struct rpc_xprt * cl_xprt; /* transport */ |
| 42 | struct rpc_procinfo * cl_procinfo; /* procedure info */ | 30 | struct rpc_procinfo * cl_procinfo; /* procedure info */ |
| 43 | u32 cl_maxproc; /* max procedure number */ | 31 | u32 cl_prog, /* RPC program number */ |
| 32 | cl_vers, /* RPC version number */ | ||
| 33 | cl_maxproc; /* max procedure number */ | ||
| 44 | 34 | ||
| 45 | char * cl_server; /* server machine name */ | 35 | char * cl_server; /* server machine name */ |
| 46 | char * cl_protname; /* protocol name */ | 36 | char * cl_protname; /* protocol name */ |
| @@ -55,7 +45,6 @@ struct rpc_clnt { | |||
| 55 | cl_dead : 1;/* abandoned */ | 45 | cl_dead : 1;/* abandoned */ |
| 56 | 46 | ||
| 57 | struct rpc_rtt * cl_rtt; /* RTO estimator data */ | 47 | struct rpc_rtt * cl_rtt; /* RTO estimator data */ |
| 58 | struct rpc_portmap * cl_pmap; /* port mapping */ | ||
| 59 | 48 | ||
| 60 | int cl_nodelen; /* nodename length */ | 49 | int cl_nodelen; /* nodename length */ |
| 61 | char cl_nodename[UNX_MAXNODENAME]; | 50 | char cl_nodename[UNX_MAXNODENAME]; |
| @@ -64,14 +53,8 @@ struct rpc_clnt { | |||
| 64 | struct dentry * cl_dentry; /* inode */ | 53 | struct dentry * cl_dentry; /* inode */ |
| 65 | struct rpc_clnt * cl_parent; /* Points to parent of clones */ | 54 | struct rpc_clnt * cl_parent; /* Points to parent of clones */ |
| 66 | struct rpc_rtt cl_rtt_default; | 55 | struct rpc_rtt cl_rtt_default; |
| 67 | struct rpc_portmap cl_pmap_default; | ||
| 68 | char cl_inline_name[32]; | 56 | char cl_inline_name[32]; |
| 69 | }; | 57 | }; |
| 70 | #define cl_timeout cl_xprt->timeout | ||
| 71 | #define cl_prog cl_pmap->pm_prog | ||
| 72 | #define cl_vers cl_pmap->pm_vers | ||
| 73 | #define cl_port cl_pmap->pm_port | ||
| 74 | #define cl_prot cl_pmap->pm_prot | ||
| 75 | 58 | ||
| 76 | /* | 59 | /* |
| 77 | * General RPC program info | 60 | * General RPC program info |
| @@ -106,24 +89,36 @@ struct rpc_procinfo { | |||
| 106 | char * p_name; /* name of procedure */ | 89 | char * p_name; /* name of procedure */ |
| 107 | }; | 90 | }; |
| 108 | 91 | ||
| 109 | #define RPC_CONGESTED(clnt) (RPCXPRT_CONGESTED((clnt)->cl_xprt)) | ||
| 110 | #define RPC_PEERADDR(clnt) (&(clnt)->cl_xprt->addr) | ||
| 111 | |||
| 112 | #ifdef __KERNEL__ | 92 | #ifdef __KERNEL__ |
| 113 | 93 | ||
| 114 | struct rpc_clnt *rpc_create_client(struct rpc_xprt *xprt, char *servname, | 94 | struct rpc_create_args { |
| 115 | struct rpc_program *info, | 95 | int protocol; |
| 116 | u32 version, rpc_authflavor_t authflavor); | 96 | struct sockaddr *address; |
| 117 | struct rpc_clnt *rpc_new_client(struct rpc_xprt *xprt, char *servname, | 97 | size_t addrsize; |
| 118 | struct rpc_program *info, | 98 | struct rpc_timeout *timeout; |
| 119 | u32 version, rpc_authflavor_t authflavor); | 99 | char *servername; |
| 100 | struct rpc_program *program; | ||
| 101 | u32 version; | ||
| 102 | rpc_authflavor_t authflavor; | ||
| 103 | unsigned long flags; | ||
| 104 | }; | ||
| 105 | |||
| 106 | /* Values for "flags" field */ | ||
| 107 | #define RPC_CLNT_CREATE_HARDRTRY (1UL << 0) | ||
| 108 | #define RPC_CLNT_CREATE_INTR (1UL << 1) | ||
| 109 | #define RPC_CLNT_CREATE_AUTOBIND (1UL << 2) | ||
| 110 | #define RPC_CLNT_CREATE_ONESHOT (1UL << 3) | ||
| 111 | #define RPC_CLNT_CREATE_NONPRIVPORT (1UL << 4) | ||
| 112 | #define RPC_CLNT_CREATE_NOPING (1UL << 5) | ||
| 113 | |||
| 114 | struct rpc_clnt *rpc_create(struct rpc_create_args *args); | ||
| 120 | struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *, | 115 | struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *, |
| 121 | struct rpc_program *, int); | 116 | struct rpc_program *, int); |
| 122 | struct rpc_clnt *rpc_clone_client(struct rpc_clnt *); | 117 | struct rpc_clnt *rpc_clone_client(struct rpc_clnt *); |
| 123 | int rpc_shutdown_client(struct rpc_clnt *); | 118 | int rpc_shutdown_client(struct rpc_clnt *); |
| 124 | int rpc_destroy_client(struct rpc_clnt *); | 119 | int rpc_destroy_client(struct rpc_clnt *); |
| 125 | void rpc_release_client(struct rpc_clnt *); | 120 | void rpc_release_client(struct rpc_clnt *); |
| 126 | void rpc_getport(struct rpc_task *, struct rpc_clnt *); | 121 | void rpc_getport(struct rpc_task *); |
| 127 | int rpc_register(u32, u32, int, unsigned short, int *); | 122 | int rpc_register(u32, u32, int, unsigned short, int *); |
| 128 | 123 | ||
| 129 | void rpc_call_setup(struct rpc_task *, struct rpc_message *, int); | 124 | void rpc_call_setup(struct rpc_task *, struct rpc_message *, int); |
| @@ -140,6 +135,8 @@ void rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int); | |||
| 140 | size_t rpc_max_payload(struct rpc_clnt *); | 135 | size_t rpc_max_payload(struct rpc_clnt *); |
| 141 | void rpc_force_rebind(struct rpc_clnt *); | 136 | void rpc_force_rebind(struct rpc_clnt *); |
| 142 | int rpc_ping(struct rpc_clnt *clnt, int flags); | 137 | int rpc_ping(struct rpc_clnt *clnt, int flags); |
| 138 | size_t rpc_peeraddr(struct rpc_clnt *, struct sockaddr *, size_t); | ||
| 139 | char * rpc_peeraddr2str(struct rpc_clnt *, enum rpc_display_format_t); | ||
| 143 | 140 | ||
| 144 | /* | 141 | /* |
| 145 | * Helper function for NFSroot support | 142 | * Helper function for NFSroot support |
diff --git a/include/linux/sunrpc/gss_krb5.h b/include/linux/sunrpc/gss_krb5.h index 1279280d71..e30ba20191 100644 --- a/include/linux/sunrpc/gss_krb5.h +++ b/include/linux/sunrpc/gss_krb5.h | |||
| @@ -46,8 +46,8 @@ struct krb5_ctx { | |||
| 46 | unsigned char seed[16]; | 46 | unsigned char seed[16]; |
| 47 | int signalg; | 47 | int signalg; |
| 48 | int sealalg; | 48 | int sealalg; |
| 49 | struct crypto_tfm *enc; | 49 | struct crypto_blkcipher *enc; |
| 50 | struct crypto_tfm *seq; | 50 | struct crypto_blkcipher *seq; |
| 51 | s32 endtime; | 51 | s32 endtime; |
| 52 | u32 seq_send; | 52 | u32 seq_send; |
| 53 | struct xdr_netobj mech_used; | 53 | struct xdr_netobj mech_used; |
| @@ -136,26 +136,27 @@ gss_unwrap_kerberos(struct gss_ctx *ctx_id, int offset, | |||
| 136 | 136 | ||
| 137 | 137 | ||
| 138 | u32 | 138 | u32 |
| 139 | krb5_encrypt(struct crypto_tfm * key, | 139 | krb5_encrypt(struct crypto_blkcipher *key, |
| 140 | void *iv, void *in, void *out, int length); | 140 | void *iv, void *in, void *out, int length); |
| 141 | 141 | ||
| 142 | u32 | 142 | u32 |
| 143 | krb5_decrypt(struct crypto_tfm * key, | 143 | krb5_decrypt(struct crypto_blkcipher *key, |
| 144 | void *iv, void *in, void *out, int length); | 144 | void *iv, void *in, void *out, int length); |
| 145 | 145 | ||
| 146 | int | 146 | int |
| 147 | gss_encrypt_xdr_buf(struct crypto_tfm *tfm, struct xdr_buf *outbuf, int offset, | 147 | gss_encrypt_xdr_buf(struct crypto_blkcipher *tfm, struct xdr_buf *outbuf, |
| 148 | struct page **pages); | 148 | int offset, struct page **pages); |
| 149 | 149 | ||
| 150 | int | 150 | int |
| 151 | gss_decrypt_xdr_buf(struct crypto_tfm *tfm, struct xdr_buf *inbuf, int offset); | 151 | gss_decrypt_xdr_buf(struct crypto_blkcipher *tfm, struct xdr_buf *inbuf, |
| 152 | int offset); | ||
| 152 | 153 | ||
| 153 | s32 | 154 | s32 |
| 154 | krb5_make_seq_num(struct crypto_tfm * key, | 155 | krb5_make_seq_num(struct crypto_blkcipher *key, |
| 155 | int direction, | 156 | int direction, |
| 156 | s32 seqnum, unsigned char *cksum, unsigned char *buf); | 157 | s32 seqnum, unsigned char *cksum, unsigned char *buf); |
| 157 | 158 | ||
| 158 | s32 | 159 | s32 |
| 159 | krb5_get_seq_num(struct crypto_tfm * key, | 160 | krb5_get_seq_num(struct crypto_blkcipher *key, |
| 160 | unsigned char *cksum, | 161 | unsigned char *cksum, |
| 161 | unsigned char *buf, int *direction, s32 * seqnum); | 162 | unsigned char *buf, int *direction, s32 * seqnum); |
diff --git a/include/linux/sunrpc/gss_spkm3.h b/include/linux/sunrpc/gss_spkm3.h index 336e218c27..2cf3fbb40b 100644 --- a/include/linux/sunrpc/gss_spkm3.h +++ b/include/linux/sunrpc/gss_spkm3.h | |||
| @@ -19,9 +19,9 @@ struct spkm3_ctx { | |||
| 19 | unsigned int req_flags ; | 19 | unsigned int req_flags ; |
| 20 | struct xdr_netobj share_key; | 20 | struct xdr_netobj share_key; |
| 21 | int conf_alg; | 21 | int conf_alg; |
| 22 | struct crypto_tfm* derived_conf_key; | 22 | struct crypto_blkcipher *derived_conf_key; |
| 23 | int intg_alg; | 23 | int intg_alg; |
| 24 | struct crypto_tfm* derived_integ_key; | 24 | struct crypto_blkcipher *derived_integ_key; |
| 25 | int keyestb_alg; /* alg used to get share_key */ | 25 | int keyestb_alg; /* alg used to get share_key */ |
| 26 | int owf_alg; /* one way function */ | 26 | int owf_alg; /* one way function */ |
| 27 | }; | 27 | }; |
diff --git a/include/linux/sunrpc/msg_prot.h b/include/linux/sunrpc/msg_prot.h index f43f237360..d9f5934ac9 100644 --- a/include/linux/sunrpc/msg_prot.h +++ b/include/linux/sunrpc/msg_prot.h | |||
| @@ -95,7 +95,7 @@ enum rpc_auth_stat { | |||
| 95 | * 2GB. | 95 | * 2GB. |
| 96 | */ | 96 | */ |
| 97 | 97 | ||
| 98 | typedef u32 rpc_fraghdr; | 98 | typedef __be32 rpc_fraghdr; |
| 99 | 99 | ||
| 100 | #define RPC_LAST_STREAM_FRAGMENT (1U << 31) | 100 | #define RPC_LAST_STREAM_FRAGMENT (1U << 31) |
| 101 | #define RPC_FRAGMENT_SIZE_MASK (~RPC_LAST_STREAM_FRAGMENT) | 101 | #define RPC_FRAGMENT_SIZE_MASK (~RPC_LAST_STREAM_FRAGMENT) |
diff --git a/include/linux/sunrpc/rpc_pipe_fs.h b/include/linux/sunrpc/rpc_pipe_fs.h index a481472c94..a2eb9b4a9d 100644 --- a/include/linux/sunrpc/rpc_pipe_fs.h +++ b/include/linux/sunrpc/rpc_pipe_fs.h | |||
| @@ -43,7 +43,7 @@ extern int rpc_queue_upcall(struct inode *, struct rpc_pipe_msg *); | |||
| 43 | 43 | ||
| 44 | extern struct dentry *rpc_mkdir(char *, struct rpc_clnt *); | 44 | extern struct dentry *rpc_mkdir(char *, struct rpc_clnt *); |
| 45 | extern int rpc_rmdir(struct dentry *); | 45 | extern int rpc_rmdir(struct dentry *); |
| 46 | extern struct dentry *rpc_mkpipe(char *, void *, struct rpc_pipe_ops *, int flags); | 46 | extern struct dentry *rpc_mkpipe(struct dentry *, const char *, void *, struct rpc_pipe_ops *, int flags); |
| 47 | extern int rpc_unlink(struct dentry *); | 47 | extern int rpc_unlink(struct dentry *); |
| 48 | extern struct vfsmount *rpc_get_mount(void); | 48 | extern struct vfsmount *rpc_get_mount(void); |
| 49 | extern void rpc_put_mount(void); | 49 | extern void rpc_put_mount(void); |
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index 82a91bb223..f399c138f7 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h | |||
| @@ -127,7 +127,6 @@ struct rpc_call_ops { | |||
| 127 | */ | 127 | */ |
| 128 | #define RPC_TASK_ASYNC 0x0001 /* is an async task */ | 128 | #define RPC_TASK_ASYNC 0x0001 /* is an async task */ |
| 129 | #define RPC_TASK_SWAPPER 0x0002 /* is swapping in/out */ | 129 | #define RPC_TASK_SWAPPER 0x0002 /* is swapping in/out */ |
| 130 | #define RPC_TASK_CHILD 0x0008 /* is child of other task */ | ||
| 131 | #define RPC_CALL_MAJORSEEN 0x0020 /* major timeout seen */ | 130 | #define RPC_CALL_MAJORSEEN 0x0020 /* major timeout seen */ |
| 132 | #define RPC_TASK_ROOTCREDS 0x0040 /* force root creds */ | 131 | #define RPC_TASK_ROOTCREDS 0x0040 /* force root creds */ |
| 133 | #define RPC_TASK_DYNAMIC 0x0080 /* task was kmalloc'ed */ | 132 | #define RPC_TASK_DYNAMIC 0x0080 /* task was kmalloc'ed */ |
| @@ -136,7 +135,6 @@ struct rpc_call_ops { | |||
| 136 | #define RPC_TASK_NOINTR 0x0400 /* uninterruptible task */ | 135 | #define RPC_TASK_NOINTR 0x0400 /* uninterruptible task */ |
| 137 | 136 | ||
| 138 | #define RPC_IS_ASYNC(t) ((t)->tk_flags & RPC_TASK_ASYNC) | 137 | #define RPC_IS_ASYNC(t) ((t)->tk_flags & RPC_TASK_ASYNC) |
| 139 | #define RPC_IS_CHILD(t) ((t)->tk_flags & RPC_TASK_CHILD) | ||
| 140 | #define RPC_IS_SWAPPER(t) ((t)->tk_flags & RPC_TASK_SWAPPER) | 138 | #define RPC_IS_SWAPPER(t) ((t)->tk_flags & RPC_TASK_SWAPPER) |
| 141 | #define RPC_DO_ROOTOVERRIDE(t) ((t)->tk_flags & RPC_TASK_ROOTCREDS) | 139 | #define RPC_DO_ROOTOVERRIDE(t) ((t)->tk_flags & RPC_TASK_ROOTCREDS) |
| 142 | #define RPC_ASSASSINATED(t) ((t)->tk_flags & RPC_TASK_KILLED) | 140 | #define RPC_ASSASSINATED(t) ((t)->tk_flags & RPC_TASK_KILLED) |
| @@ -253,7 +251,6 @@ struct rpc_task *rpc_new_task(struct rpc_clnt *, int flags, | |||
| 253 | const struct rpc_call_ops *ops, void *data); | 251 | const struct rpc_call_ops *ops, void *data); |
| 254 | struct rpc_task *rpc_run_task(struct rpc_clnt *clnt, int flags, | 252 | struct rpc_task *rpc_run_task(struct rpc_clnt *clnt, int flags, |
| 255 | const struct rpc_call_ops *ops, void *data); | 253 | const struct rpc_call_ops *ops, void *data); |
| 256 | struct rpc_task *rpc_new_child(struct rpc_clnt *, struct rpc_task *parent); | ||
| 257 | void rpc_init_task(struct rpc_task *task, struct rpc_clnt *clnt, | 254 | void rpc_init_task(struct rpc_task *task, struct rpc_clnt *clnt, |
| 258 | int flags, const struct rpc_call_ops *ops, | 255 | int flags, const struct rpc_call_ops *ops, |
| 259 | void *data); | 256 | void *data); |
| @@ -261,8 +258,6 @@ void rpc_release_task(struct rpc_task *); | |||
| 261 | void rpc_exit_task(struct rpc_task *); | 258 | void rpc_exit_task(struct rpc_task *); |
| 262 | void rpc_killall_tasks(struct rpc_clnt *); | 259 | void rpc_killall_tasks(struct rpc_clnt *); |
| 263 | int rpc_execute(struct rpc_task *); | 260 | int rpc_execute(struct rpc_task *); |
| 264 | void rpc_run_child(struct rpc_task *parent, struct rpc_task *child, | ||
| 265 | rpc_action action); | ||
| 266 | void rpc_init_priority_wait_queue(struct rpc_wait_queue *, const char *); | 261 | void rpc_init_priority_wait_queue(struct rpc_wait_queue *, const char *); |
| 267 | void rpc_init_wait_queue(struct rpc_wait_queue *, const char *); | 262 | void rpc_init_wait_queue(struct rpc_wait_queue *, const char *); |
| 268 | void rpc_sleep_on(struct rpc_wait_queue *, struct rpc_task *, | 263 | void rpc_sleep_on(struct rpc_wait_queue *, struct rpc_task *, |
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 7b27c09b56..73140ee5c6 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
| @@ -78,28 +78,45 @@ struct svc_serv { | |||
| 78 | */ | 78 | */ |
| 79 | #define RPCSVC_MAXPAGES ((RPCSVC_MAXPAYLOAD+PAGE_SIZE-1)/PAGE_SIZE + 2) | 79 | #define RPCSVC_MAXPAGES ((RPCSVC_MAXPAYLOAD+PAGE_SIZE-1)/PAGE_SIZE + 2) |
| 80 | 80 | ||
| 81 | static inline u32 svc_getu32(struct kvec *iov) | 81 | static inline u32 svc_getnl(struct kvec *iov) |
| 82 | { | 82 | { |
| 83 | u32 val, *vp; | 83 | __be32 val, *vp; |
| 84 | vp = iov->iov_base; | 84 | vp = iov->iov_base; |
| 85 | val = *vp++; | 85 | val = *vp++; |
| 86 | iov->iov_base = (void*)vp; | 86 | iov->iov_base = (void*)vp; |
| 87 | iov->iov_len -= sizeof(u32); | 87 | iov->iov_len -= sizeof(__be32); |
| 88 | return ntohl(val); | ||
| 89 | } | ||
| 90 | |||
| 91 | static inline void svc_putnl(struct kvec *iov, u32 val) | ||
| 92 | { | ||
| 93 | __be32 *vp = iov->iov_base + iov->iov_len; | ||
| 94 | *vp = htonl(val); | ||
| 95 | iov->iov_len += sizeof(__be32); | ||
| 96 | } | ||
| 97 | |||
| 98 | static inline __be32 svc_getu32(struct kvec *iov) | ||
| 99 | { | ||
| 100 | __be32 val, *vp; | ||
| 101 | vp = iov->iov_base; | ||
| 102 | val = *vp++; | ||
| 103 | iov->iov_base = (void*)vp; | ||
| 104 | iov->iov_len -= sizeof(__be32); | ||
| 88 | return val; | 105 | return val; |
| 89 | } | 106 | } |
| 90 | 107 | ||
| 91 | static inline void svc_ungetu32(struct kvec *iov) | 108 | static inline void svc_ungetu32(struct kvec *iov) |
| 92 | { | 109 | { |
| 93 | u32 *vp = (u32 *)iov->iov_base; | 110 | __be32 *vp = (__be32 *)iov->iov_base; |
| 94 | iov->iov_base = (void *)(vp - 1); | 111 | iov->iov_base = (void *)(vp - 1); |
| 95 | iov->iov_len += sizeof(*vp); | 112 | iov->iov_len += sizeof(*vp); |
| 96 | } | 113 | } |
| 97 | 114 | ||
| 98 | static inline void svc_putu32(struct kvec *iov, u32 val) | 115 | static inline void svc_putu32(struct kvec *iov, __be32 val) |
| 99 | { | 116 | { |
| 100 | u32 *vp = iov->iov_base + iov->iov_len; | 117 | __be32 *vp = iov->iov_base + iov->iov_len; |
| 101 | *vp = val; | 118 | *vp = val; |
| 102 | iov->iov_len += sizeof(u32); | 119 | iov->iov_len += sizeof(__be32); |
| 103 | } | 120 | } |
| 104 | 121 | ||
| 105 | 122 | ||
| @@ -130,7 +147,7 @@ struct svc_rqst { | |||
| 130 | short rq_arghi; /* pages available in argument page list */ | 147 | short rq_arghi; /* pages available in argument page list */ |
| 131 | short rq_resused; /* pages used for result */ | 148 | short rq_resused; /* pages used for result */ |
| 132 | 149 | ||
| 133 | u32 rq_xid; /* transmission id */ | 150 | __be32 rq_xid; /* transmission id */ |
| 134 | u32 rq_prog; /* program number */ | 151 | u32 rq_prog; /* program number */ |
| 135 | u32 rq_vers; /* program version */ | 152 | u32 rq_vers; /* program version */ |
| 136 | u32 rq_proc; /* procedure number */ | 153 | u32 rq_proc; /* procedure number */ |
| @@ -139,7 +156,7 @@ struct svc_rqst { | |||
| 139 | rq_secure : 1; /* secure port */ | 156 | rq_secure : 1; /* secure port */ |
| 140 | 157 | ||
| 141 | 158 | ||
| 142 | __u32 rq_daddr; /* dest addr of request - reply from here */ | 159 | __be32 rq_daddr; /* dest addr of request - reply from here */ |
| 143 | 160 | ||
| 144 | void * rq_argp; /* decoded arguments */ | 161 | void * rq_argp; /* decoded arguments */ |
| 145 | void * rq_resp; /* xdr'd results */ | 162 | void * rq_resp; /* xdr'd results */ |
| @@ -169,7 +186,7 @@ struct svc_rqst { | |||
| 169 | * Check buffer bounds after decoding arguments | 186 | * Check buffer bounds after decoding arguments |
| 170 | */ | 187 | */ |
| 171 | static inline int | 188 | static inline int |
| 172 | xdr_argsize_check(struct svc_rqst *rqstp, u32 *p) | 189 | xdr_argsize_check(struct svc_rqst *rqstp, __be32 *p) |
| 173 | { | 190 | { |
| 174 | char *cp = (char *)p; | 191 | char *cp = (char *)p; |
| 175 | struct kvec *vec = &rqstp->rq_arg.head[0]; | 192 | struct kvec *vec = &rqstp->rq_arg.head[0]; |
| @@ -178,7 +195,7 @@ xdr_argsize_check(struct svc_rqst *rqstp, u32 *p) | |||
| 178 | } | 195 | } |
| 179 | 196 | ||
| 180 | static inline int | 197 | static inline int |
| 181 | xdr_ressize_check(struct svc_rqst *rqstp, u32 *p) | 198 | xdr_ressize_check(struct svc_rqst *rqstp, __be32 *p) |
| 182 | { | 199 | { |
| 183 | struct kvec *vec = &rqstp->rq_res.head[0]; | 200 | struct kvec *vec = &rqstp->rq_res.head[0]; |
| 184 | char *cp = (char*)p; | 201 | char *cp = (char*)p; |
| @@ -249,10 +266,10 @@ struct svc_deferred_req { | |||
| 249 | u32 prot; /* protocol (UDP or TCP) */ | 266 | u32 prot; /* protocol (UDP or TCP) */ |
| 250 | struct sockaddr_in addr; | 267 | struct sockaddr_in addr; |
| 251 | struct svc_sock *svsk; /* where reply must go */ | 268 | struct svc_sock *svsk; /* where reply must go */ |
| 252 | u32 daddr; /* where reply must come from */ | 269 | __be32 daddr; /* where reply must come from */ |
| 253 | struct cache_deferred_req handle; | 270 | struct cache_deferred_req handle; |
| 254 | int argslen; | 271 | int argslen; |
| 255 | u32 args[0]; | 272 | __be32 args[0]; |
| 256 | }; | 273 | }; |
| 257 | 274 | ||
| 258 | /* | 275 | /* |
| @@ -284,7 +301,7 @@ struct svc_version { | |||
| 284 | * A return value of 0 means drop the request. | 301 | * A return value of 0 means drop the request. |
| 285 | * vs_dispatch == NULL means use default dispatcher. | 302 | * vs_dispatch == NULL means use default dispatcher. |
| 286 | */ | 303 | */ |
| 287 | int (*vs_dispatch)(struct svc_rqst *, u32 *); | 304 | int (*vs_dispatch)(struct svc_rqst *, __be32 *); |
| 288 | }; | 305 | }; |
| 289 | 306 | ||
| 290 | /* | 307 | /* |
diff --git a/include/linux/sunrpc/svcauth.h b/include/linux/sunrpc/svcauth.h index 2fe2087edd..a6601650de 100644 --- a/include/linux/sunrpc/svcauth.h +++ b/include/linux/sunrpc/svcauth.h | |||
| @@ -95,7 +95,7 @@ struct auth_ops { | |||
| 95 | char * name; | 95 | char * name; |
| 96 | struct module *owner; | 96 | struct module *owner; |
| 97 | int flavour; | 97 | int flavour; |
| 98 | int (*accept)(struct svc_rqst *rq, u32 *authp); | 98 | int (*accept)(struct svc_rqst *rq, __be32 *authp); |
| 99 | int (*release)(struct svc_rqst *rq); | 99 | int (*release)(struct svc_rqst *rq); |
| 100 | void (*domain_release)(struct auth_domain *); | 100 | void (*domain_release)(struct auth_domain *); |
| 101 | int (*set_client)(struct svc_rqst *rq); | 101 | int (*set_client)(struct svc_rqst *rq); |
| @@ -112,7 +112,7 @@ struct auth_ops { | |||
| 112 | #define SVC_COMPLETE 9 | 112 | #define SVC_COMPLETE 9 |
| 113 | 113 | ||
| 114 | 114 | ||
| 115 | extern int svc_authenticate(struct svc_rqst *rqstp, u32 *authp); | 115 | extern int svc_authenticate(struct svc_rqst *rqstp, __be32 *authp); |
| 116 | extern int svc_authorise(struct svc_rqst *rqstp); | 116 | extern int svc_authorise(struct svc_rqst *rqstp); |
| 117 | extern int svc_set_client(struct svc_rqst *rqstp); | 117 | extern int svc_set_client(struct svc_rqst *rqstp); |
| 118 | extern int svc_auth_register(rpc_authflavor_t flavor, struct auth_ops *aops); | 118 | extern int svc_auth_register(rpc_authflavor_t flavor, struct auth_ops *aops); |
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h index e6d3d34950..953723b09b 100644 --- a/include/linux/sunrpc/xdr.h +++ b/include/linux/sunrpc/xdr.h | |||
| @@ -32,7 +32,7 @@ struct xdr_netobj { | |||
| 32 | * side) or svc_rqst pointer (server side). | 32 | * side) or svc_rqst pointer (server side). |
| 33 | * Encode functions always assume there's enough room in the buffer. | 33 | * Encode functions always assume there's enough room in the buffer. |
| 34 | */ | 34 | */ |
| 35 | typedef int (*kxdrproc_t)(void *rqstp, u32 *data, void *obj); | 35 | typedef int (*kxdrproc_t)(void *rqstp, __be32 *data, void *obj); |
| 36 | 36 | ||
| 37 | /* | 37 | /* |
| 38 | * Basic structure for transmission/reception of a client XDR message. | 38 | * Basic structure for transmission/reception of a client XDR message. |
| @@ -88,19 +88,19 @@ struct xdr_buf { | |||
| 88 | /* | 88 | /* |
| 89 | * Miscellaneous XDR helper functions | 89 | * Miscellaneous XDR helper functions |
| 90 | */ | 90 | */ |
| 91 | u32 * xdr_encode_opaque_fixed(u32 *p, const void *ptr, unsigned int len); | 91 | __be32 *xdr_encode_opaque_fixed(__be32 *p, const void *ptr, unsigned int len); |
| 92 | u32 * xdr_encode_opaque(u32 *p, const void *ptr, unsigned int len); | 92 | __be32 *xdr_encode_opaque(__be32 *p, const void *ptr, unsigned int len); |
| 93 | u32 * xdr_encode_string(u32 *p, const char *s); | 93 | __be32 *xdr_encode_string(__be32 *p, const char *s); |
| 94 | u32 * xdr_decode_string_inplace(u32 *p, char **sp, int *lenp, int maxlen); | 94 | __be32 *xdr_decode_string_inplace(__be32 *p, char **sp, int *lenp, int maxlen); |
| 95 | u32 * xdr_encode_netobj(u32 *p, const struct xdr_netobj *); | 95 | __be32 *xdr_encode_netobj(__be32 *p, const struct xdr_netobj *); |
| 96 | u32 * xdr_decode_netobj(u32 *p, struct xdr_netobj *); | 96 | __be32 *xdr_decode_netobj(__be32 *p, struct xdr_netobj *); |
| 97 | 97 | ||
| 98 | void xdr_encode_pages(struct xdr_buf *, struct page **, unsigned int, | 98 | void xdr_encode_pages(struct xdr_buf *, struct page **, unsigned int, |
| 99 | unsigned int); | 99 | unsigned int); |
| 100 | void xdr_inline_pages(struct xdr_buf *, unsigned int, | 100 | void xdr_inline_pages(struct xdr_buf *, unsigned int, |
| 101 | struct page **, unsigned int, unsigned int); | 101 | struct page **, unsigned int, unsigned int); |
| 102 | 102 | ||
| 103 | static inline u32 *xdr_encode_array(u32 *p, const void *s, unsigned int len) | 103 | static inline __be32 *xdr_encode_array(__be32 *p, const void *s, unsigned int len) |
| 104 | { | 104 | { |
| 105 | return xdr_encode_opaque(p, s, len); | 105 | return xdr_encode_opaque(p, s, len); |
| 106 | } | 106 | } |
| @@ -108,16 +108,16 @@ static inline u32 *xdr_encode_array(u32 *p, const void *s, unsigned int len) | |||
| 108 | /* | 108 | /* |
| 109 | * Decode 64bit quantities (NFSv3 support) | 109 | * Decode 64bit quantities (NFSv3 support) |
| 110 | */ | 110 | */ |
| 111 | static inline u32 * | 111 | static inline __be32 * |
| 112 | xdr_encode_hyper(u32 *p, __u64 val) | 112 | xdr_encode_hyper(__be32 *p, __u64 val) |
| 113 | { | 113 | { |
| 114 | *p++ = htonl(val >> 32); | 114 | *p++ = htonl(val >> 32); |
| 115 | *p++ = htonl(val & 0xFFFFFFFF); | 115 | *p++ = htonl(val & 0xFFFFFFFF); |
| 116 | return p; | 116 | return p; |
| 117 | } | 117 | } |
| 118 | 118 | ||
| 119 | static inline u32 * | 119 | static inline __be32 * |
| 120 | xdr_decode_hyper(u32 *p, __u64 *valp) | 120 | xdr_decode_hyper(__be32 *p, __u64 *valp) |
| 121 | { | 121 | { |
| 122 | *valp = ((__u64) ntohl(*p++)) << 32; | 122 | *valp = ((__u64) ntohl(*p++)) << 32; |
| 123 | *valp |= ntohl(*p++); | 123 | *valp |= ntohl(*p++); |
| @@ -128,7 +128,7 @@ xdr_decode_hyper(u32 *p, __u64 *valp) | |||
| 128 | * Adjust kvec to reflect end of xdr'ed data (RPC client XDR) | 128 | * Adjust kvec to reflect end of xdr'ed data (RPC client XDR) |
| 129 | */ | 129 | */ |
| 130 | static inline int | 130 | static inline int |
| 131 | xdr_adjust_iovec(struct kvec *iov, u32 *p) | 131 | xdr_adjust_iovec(struct kvec *iov, __be32 *p) |
| 132 | { | 132 | { |
| 133 | return iov->iov_len = ((u8 *) p - (u8 *) iov->iov_base); | 133 | return iov->iov_len = ((u8 *) p - (u8 *) iov->iov_base); |
| 134 | } | 134 | } |
| @@ -180,19 +180,19 @@ extern int xdr_encode_array2(struct xdr_buf *buf, unsigned int base, | |||
| 180 | * Provide some simple tools for XDR buffer overflow-checking etc. | 180 | * Provide some simple tools for XDR buffer overflow-checking etc. |
| 181 | */ | 181 | */ |
| 182 | struct xdr_stream { | 182 | struct xdr_stream { |
| 183 | uint32_t *p; /* start of available buffer */ | 183 | __be32 *p; /* start of available buffer */ |
| 184 | struct xdr_buf *buf; /* XDR buffer to read/write */ | 184 | struct xdr_buf *buf; /* XDR buffer to read/write */ |
| 185 | 185 | ||
| 186 | uint32_t *end; /* end of available buffer space */ | 186 | __be32 *end; /* end of available buffer space */ |
| 187 | struct kvec *iov; /* pointer to the current kvec */ | 187 | struct kvec *iov; /* pointer to the current kvec */ |
| 188 | }; | 188 | }; |
| 189 | 189 | ||
| 190 | extern void xdr_init_encode(struct xdr_stream *xdr, struct xdr_buf *buf, uint32_t *p); | 190 | extern void xdr_init_encode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32 *p); |
| 191 | extern uint32_t *xdr_reserve_space(struct xdr_stream *xdr, size_t nbytes); | 191 | extern __be32 *xdr_reserve_space(struct xdr_stream *xdr, size_t nbytes); |
| 192 | extern void xdr_write_pages(struct xdr_stream *xdr, struct page **pages, | 192 | extern void xdr_write_pages(struct xdr_stream *xdr, struct page **pages, |
| 193 | unsigned int base, unsigned int len); | 193 | unsigned int base, unsigned int len); |
| 194 | extern void xdr_init_decode(struct xdr_stream *xdr, struct xdr_buf *buf, uint32_t *p); | 194 | extern void xdr_init_decode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32 *p); |
| 195 | extern uint32_t *xdr_inline_decode(struct xdr_stream *xdr, size_t nbytes); | 195 | extern __be32 *xdr_inline_decode(struct xdr_stream *xdr, size_t nbytes); |
| 196 | extern void xdr_read_pages(struct xdr_stream *xdr, unsigned int len); | 196 | extern void xdr_read_pages(struct xdr_stream *xdr, unsigned int len); |
| 197 | extern void xdr_enter_page(struct xdr_stream *xdr, unsigned int len); | 197 | extern void xdr_enter_page(struct xdr_stream *xdr, unsigned int len); |
| 198 | 198 | ||
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index 3a0cca255b..6cf6265807 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #include <linux/uio.h> | 12 | #include <linux/uio.h> |
| 13 | #include <linux/socket.h> | 13 | #include <linux/socket.h> |
| 14 | #include <linux/in.h> | 14 | #include <linux/in.h> |
| 15 | #include <linux/kref.h> | ||
| 15 | #include <linux/sunrpc/sched.h> | 16 | #include <linux/sunrpc/sched.h> |
| 16 | #include <linux/sunrpc/xdr.h> | 17 | #include <linux/sunrpc/xdr.h> |
| 17 | 18 | ||
| @@ -51,6 +52,14 @@ struct rpc_timeout { | |||
| 51 | unsigned char to_exponential; | 52 | unsigned char to_exponential; |
| 52 | }; | 53 | }; |
| 53 | 54 | ||
| 55 | enum rpc_display_format_t { | ||
| 56 | RPC_DISPLAY_ADDR = 0, | ||
| 57 | RPC_DISPLAY_PORT, | ||
| 58 | RPC_DISPLAY_PROTO, | ||
| 59 | RPC_DISPLAY_ALL, | ||
| 60 | RPC_DISPLAY_MAX, | ||
| 61 | }; | ||
| 62 | |||
| 54 | struct rpc_task; | 63 | struct rpc_task; |
| 55 | struct rpc_xprt; | 64 | struct rpc_xprt; |
| 56 | struct seq_file; | 65 | struct seq_file; |
| @@ -70,7 +79,7 @@ struct rpc_rqst { | |||
| 70 | * This is the private part | 79 | * This is the private part |
| 71 | */ | 80 | */ |
| 72 | struct rpc_task * rq_task; /* RPC task data */ | 81 | struct rpc_task * rq_task; /* RPC task data */ |
| 73 | __u32 rq_xid; /* request XID */ | 82 | __be32 rq_xid; /* request XID */ |
| 74 | int rq_cong; /* has incremented xprt->cong */ | 83 | int rq_cong; /* has incremented xprt->cong */ |
| 75 | int rq_received; /* receive completed */ | 84 | int rq_received; /* receive completed */ |
| 76 | u32 rq_seqno; /* gss seq no. used on req. */ | 85 | u32 rq_seqno; /* gss seq no. used on req. */ |
| @@ -103,8 +112,10 @@ struct rpc_rqst { | |||
| 103 | 112 | ||
| 104 | struct rpc_xprt_ops { | 113 | struct rpc_xprt_ops { |
| 105 | void (*set_buffer_size)(struct rpc_xprt *xprt, size_t sndsize, size_t rcvsize); | 114 | void (*set_buffer_size)(struct rpc_xprt *xprt, size_t sndsize, size_t rcvsize); |
| 115 | char * (*print_addr)(struct rpc_xprt *xprt, enum rpc_display_format_t format); | ||
| 106 | int (*reserve_xprt)(struct rpc_task *task); | 116 | int (*reserve_xprt)(struct rpc_task *task); |
| 107 | void (*release_xprt)(struct rpc_xprt *xprt, struct rpc_task *task); | 117 | void (*release_xprt)(struct rpc_xprt *xprt, struct rpc_task *task); |
| 118 | void (*rpcbind)(struct rpc_task *task); | ||
| 108 | void (*set_port)(struct rpc_xprt *xprt, unsigned short port); | 119 | void (*set_port)(struct rpc_xprt *xprt, unsigned short port); |
| 109 | void (*connect)(struct rpc_task *task); | 120 | void (*connect)(struct rpc_task *task); |
| 110 | void * (*buf_alloc)(struct rpc_task *task, size_t size); | 121 | void * (*buf_alloc)(struct rpc_task *task, size_t size); |
| @@ -119,12 +130,14 @@ struct rpc_xprt_ops { | |||
| 119 | }; | 130 | }; |
| 120 | 131 | ||
| 121 | struct rpc_xprt { | 132 | struct rpc_xprt { |
| 133 | struct kref kref; /* Reference count */ | ||
| 122 | struct rpc_xprt_ops * ops; /* transport methods */ | 134 | struct rpc_xprt_ops * ops; /* transport methods */ |
| 123 | struct socket * sock; /* BSD socket layer */ | 135 | struct socket * sock; /* BSD socket layer */ |
| 124 | struct sock * inet; /* INET layer */ | 136 | struct sock * inet; /* INET layer */ |
| 125 | 137 | ||
| 126 | struct rpc_timeout timeout; /* timeout parms */ | 138 | struct rpc_timeout timeout; /* timeout parms */ |
| 127 | struct sockaddr_in addr; /* server address */ | 139 | struct sockaddr_storage addr; /* server address */ |
| 140 | size_t addrlen; /* size of server address */ | ||
| 128 | int prot; /* IP protocol */ | 141 | int prot; /* IP protocol */ |
| 129 | 142 | ||
| 130 | unsigned long cong; /* current congestion */ | 143 | unsigned long cong; /* current congestion */ |
| @@ -138,6 +151,7 @@ struct rpc_xprt { | |||
| 138 | unsigned int tsh_size; /* size of transport specific | 151 | unsigned int tsh_size; /* size of transport specific |
| 139 | header */ | 152 | header */ |
| 140 | 153 | ||
| 154 | struct rpc_wait_queue binding; /* requests waiting on rpcbind */ | ||
| 141 | struct rpc_wait_queue sending; /* requests waiting to send */ | 155 | struct rpc_wait_queue sending; /* requests waiting to send */ |
| 142 | struct rpc_wait_queue resend; /* requests waiting to resend */ | 156 | struct rpc_wait_queue resend; /* requests waiting to resend */ |
| 143 | struct rpc_wait_queue pending; /* requests in flight */ | 157 | struct rpc_wait_queue pending; /* requests in flight */ |
| @@ -157,9 +171,9 @@ struct rpc_xprt { | |||
| 157 | /* | 171 | /* |
| 158 | * State of TCP reply receive stuff | 172 | * State of TCP reply receive stuff |
| 159 | */ | 173 | */ |
| 160 | u32 tcp_recm, /* Fragment header */ | 174 | __be32 tcp_recm, /* Fragment header */ |
| 161 | tcp_xid, /* Current XID */ | 175 | tcp_xid; /* Current XID */ |
| 162 | tcp_reclen, /* fragment length */ | 176 | u32 tcp_reclen, /* fragment length */ |
| 163 | tcp_offset; /* fragment offset */ | 177 | tcp_offset; /* fragment offset */ |
| 164 | unsigned long tcp_copied, /* copied to request */ | 178 | unsigned long tcp_copied, /* copied to request */ |
| 165 | tcp_flags; | 179 | tcp_flags; |
| @@ -205,6 +219,8 @@ struct rpc_xprt { | |||
| 205 | void (*old_data_ready)(struct sock *, int); | 219 | void (*old_data_ready)(struct sock *, int); |
| 206 | void (*old_state_change)(struct sock *); | 220 | void (*old_state_change)(struct sock *); |
| 207 | void (*old_write_space)(struct sock *); | 221 | void (*old_write_space)(struct sock *); |
| 222 | |||
| 223 | char * address_strings[RPC_DISPLAY_MAX]; | ||
| 208 | }; | 224 | }; |
| 209 | 225 | ||
| 210 | #define XPRT_LAST_FRAG (1 << 0) | 226 | #define XPRT_LAST_FRAG (1 << 0) |
| @@ -217,12 +233,12 @@ struct rpc_xprt { | |||
| 217 | /* | 233 | /* |
| 218 | * Transport operations used by ULPs | 234 | * Transport operations used by ULPs |
| 219 | */ | 235 | */ |
| 220 | struct rpc_xprt * xprt_create_proto(int proto, struct sockaddr_in *addr, struct rpc_timeout *to); | ||
| 221 | void xprt_set_timeout(struct rpc_timeout *to, unsigned int retr, unsigned long incr); | 236 | void xprt_set_timeout(struct rpc_timeout *to, unsigned int retr, unsigned long incr); |
| 222 | 237 | ||
| 223 | /* | 238 | /* |
| 224 | * Generic internal transport functions | 239 | * Generic internal transport functions |
| 225 | */ | 240 | */ |
| 241 | struct rpc_xprt * xprt_create_transport(int proto, struct sockaddr *addr, size_t size, struct rpc_timeout *toparms); | ||
| 226 | void xprt_connect(struct rpc_task *task); | 242 | void xprt_connect(struct rpc_task *task); |
| 227 | void xprt_reserve(struct rpc_task *task); | 243 | void xprt_reserve(struct rpc_task *task); |
| 228 | int xprt_reserve_xprt(struct rpc_task *task); | 244 | int xprt_reserve_xprt(struct rpc_task *task); |
| @@ -234,9 +250,10 @@ int xprt_adjust_timeout(struct rpc_rqst *req); | |||
| 234 | void xprt_release_xprt(struct rpc_xprt *xprt, struct rpc_task *task); | 250 | void xprt_release_xprt(struct rpc_xprt *xprt, struct rpc_task *task); |
| 235 | void xprt_release_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task); | 251 | void xprt_release_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task); |
| 236 | void xprt_release(struct rpc_task *task); | 252 | void xprt_release(struct rpc_task *task); |
| 237 | int xprt_destroy(struct rpc_xprt *xprt); | 253 | struct rpc_xprt * xprt_get(struct rpc_xprt *xprt); |
| 254 | void xprt_put(struct rpc_xprt *xprt); | ||
| 238 | 255 | ||
| 239 | static inline u32 *xprt_skip_transport_header(struct rpc_xprt *xprt, u32 *p) | 256 | static inline __be32 *xprt_skip_transport_header(struct rpc_xprt *xprt, __be32 *p) |
| 240 | { | 257 | { |
| 241 | return p + xprt->tsh_size; | 258 | return p + xprt->tsh_size; |
| 242 | } | 259 | } |
| @@ -251,7 +268,7 @@ void xprt_wait_for_buffer_space(struct rpc_task *task); | |||
| 251 | void xprt_write_space(struct rpc_xprt *xprt); | 268 | void xprt_write_space(struct rpc_xprt *xprt); |
| 252 | void xprt_update_rtt(struct rpc_task *task); | 269 | void xprt_update_rtt(struct rpc_task *task); |
| 253 | void xprt_adjust_cwnd(struct rpc_task *task, int result); | 270 | void xprt_adjust_cwnd(struct rpc_task *task, int result); |
| 254 | struct rpc_rqst * xprt_lookup_rqst(struct rpc_xprt *xprt, u32 xid); | 271 | struct rpc_rqst * xprt_lookup_rqst(struct rpc_xprt *xprt, __be32 xid); |
| 255 | void xprt_complete_rqst(struct rpc_task *task, int copied); | 272 | void xprt_complete_rqst(struct rpc_task *task, int copied); |
| 256 | void xprt_release_rqst_cong(struct rpc_task *task); | 273 | void xprt_release_rqst_cong(struct rpc_task *task); |
| 257 | void xprt_disconnect(struct rpc_xprt *xprt); | 274 | void xprt_disconnect(struct rpc_xprt *xprt); |
| @@ -269,6 +286,8 @@ int xs_setup_tcp(struct rpc_xprt *xprt, struct rpc_timeout *to); | |||
| 269 | #define XPRT_CONNECTED (1) | 286 | #define XPRT_CONNECTED (1) |
| 270 | #define XPRT_CONNECTING (2) | 287 | #define XPRT_CONNECTING (2) |
| 271 | #define XPRT_CLOSE_WAIT (3) | 288 | #define XPRT_CLOSE_WAIT (3) |
| 289 | #define XPRT_BOUND (4) | ||
| 290 | #define XPRT_BINDING (5) | ||
| 272 | 291 | ||
| 273 | static inline void xprt_set_connected(struct rpc_xprt *xprt) | 292 | static inline void xprt_set_connected(struct rpc_xprt *xprt) |
| 274 | { | 293 | { |
| @@ -312,6 +331,33 @@ static inline int xprt_test_and_set_connecting(struct rpc_xprt *xprt) | |||
| 312 | return test_and_set_bit(XPRT_CONNECTING, &xprt->state); | 331 | return test_and_set_bit(XPRT_CONNECTING, &xprt->state); |
| 313 | } | 332 | } |
| 314 | 333 | ||
| 334 | static inline void xprt_set_bound(struct rpc_xprt *xprt) | ||
| 335 | { | ||
| 336 | test_and_set_bit(XPRT_BOUND, &xprt->state); | ||
| 337 | } | ||
| 338 | |||
| 339 | static inline int xprt_bound(struct rpc_xprt *xprt) | ||
| 340 | { | ||
| 341 | return test_bit(XPRT_BOUND, &xprt->state); | ||
| 342 | } | ||
| 343 | |||
| 344 | static inline void xprt_clear_bound(struct rpc_xprt *xprt) | ||
| 345 | { | ||
| 346 | clear_bit(XPRT_BOUND, &xprt->state); | ||
| 347 | } | ||
| 348 | |||
| 349 | static inline void xprt_clear_binding(struct rpc_xprt *xprt) | ||
| 350 | { | ||
| 351 | smp_mb__before_clear_bit(); | ||
| 352 | clear_bit(XPRT_BINDING, &xprt->state); | ||
| 353 | smp_mb__after_clear_bit(); | ||
| 354 | } | ||
| 355 | |||
| 356 | static inline int xprt_test_and_set_binding(struct rpc_xprt *xprt) | ||
| 357 | { | ||
| 358 | return test_and_set_bit(XPRT_BINDING, &xprt->state); | ||
| 359 | } | ||
| 360 | |||
| 315 | #endif /* __KERNEL__*/ | 361 | #endif /* __KERNEL__*/ |
| 316 | 362 | ||
| 317 | #endif /* _LINUX_SUNRPC_XPRT_H */ | 363 | #endif /* _LINUX_SUNRPC_XPRT_H */ |
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index 96e31aa64c..b1237f16ec 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
| @@ -10,29 +10,11 @@ | |||
| 10 | #include <linux/pm.h> | 10 | #include <linux/pm.h> |
| 11 | 11 | ||
| 12 | /* page backup entry */ | 12 | /* page backup entry */ |
| 13 | typedef struct pbe { | 13 | struct pbe { |
| 14 | unsigned long address; /* address of the copy */ | 14 | unsigned long address; /* address of the copy */ |
| 15 | unsigned long orig_address; /* original address of page */ | 15 | unsigned long orig_address; /* original address of page */ |
| 16 | struct pbe *next; | 16 | struct pbe *next; |
| 17 | } suspend_pagedir_t; | 17 | }; |
| 18 | |||
| 19 | #define for_each_pbe(pbe, pblist) \ | ||
| 20 | for (pbe = pblist ; pbe ; pbe = pbe->next) | ||
| 21 | |||
| 22 | #define PBES_PER_PAGE (PAGE_SIZE/sizeof(struct pbe)) | ||
| 23 | #define PB_PAGE_SKIP (PBES_PER_PAGE-1) | ||
| 24 | |||
| 25 | #define for_each_pb_page(pbe, pblist) \ | ||
| 26 | for (pbe = pblist ; pbe ; pbe = (pbe+PB_PAGE_SKIP)->next) | ||
| 27 | |||
| 28 | |||
| 29 | #define SWAP_FILENAME_MAXLENGTH 32 | ||
| 30 | |||
| 31 | |||
| 32 | extern dev_t swsusp_resume_device; | ||
| 33 | |||
| 34 | /* mm/vmscan.c */ | ||
| 35 | extern int shrink_mem(void); | ||
| 36 | 18 | ||
| 37 | /* mm/page_alloc.c */ | 19 | /* mm/page_alloc.c */ |
| 38 | extern void drain_local_pages(void); | 20 | extern void drain_local_pages(void); |
| @@ -53,18 +35,10 @@ static inline void pm_restore_console(void) {} | |||
| 53 | static inline int software_suspend(void) | 35 | static inline int software_suspend(void) |
| 54 | { | 36 | { |
| 55 | printk("Warning: fake suspend called\n"); | 37 | printk("Warning: fake suspend called\n"); |
| 56 | return -EPERM; | 38 | return -ENOSYS; |
| 57 | } | 39 | } |
| 58 | #endif /* CONFIG_PM */ | 40 | #endif /* CONFIG_PM */ |
| 59 | 41 | ||
| 60 | #ifdef CONFIG_SUSPEND_SMP | ||
| 61 | extern void disable_nonboot_cpus(void); | ||
| 62 | extern void enable_nonboot_cpus(void); | ||
| 63 | #else | ||
| 64 | static inline void disable_nonboot_cpus(void) {} | ||
| 65 | static inline void enable_nonboot_cpus(void) {} | ||
| 66 | #endif | ||
| 67 | |||
| 68 | void save_processor_state(void); | 42 | void save_processor_state(void); |
| 69 | void restore_processor_state(void); | 43 | void restore_processor_state(void); |
| 70 | struct saved_context; | 44 | struct saved_context; |
diff --git a/include/linux/swap.h b/include/linux/swap.h index 5e59184c90..e7c36ba2a2 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
| @@ -10,6 +10,10 @@ | |||
| 10 | #include <asm/atomic.h> | 10 | #include <asm/atomic.h> |
| 11 | #include <asm/page.h> | 11 | #include <asm/page.h> |
| 12 | 12 | ||
| 13 | struct notifier_block; | ||
| 14 | |||
| 15 | struct bio; | ||
| 16 | |||
| 13 | #define SWAP_FLAG_PREFER 0x8000 /* set if swap priority specified */ | 17 | #define SWAP_FLAG_PREFER 0x8000 /* set if swap priority specified */ |
| 14 | #define SWAP_FLAG_PRIO_MASK 0x7fff | 18 | #define SWAP_FLAG_PRIO_MASK 0x7fff |
| 15 | #define SWAP_FLAG_PRIO_SHIFT 0 | 19 | #define SWAP_FLAG_PRIO_SHIFT 0 |
| @@ -156,13 +160,14 @@ struct swap_list_t { | |||
| 156 | 160 | ||
| 157 | /* linux/mm/oom_kill.c */ | 161 | /* linux/mm/oom_kill.c */ |
| 158 | extern void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order); | 162 | extern void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order); |
| 163 | extern int register_oom_notifier(struct notifier_block *nb); | ||
| 164 | extern int unregister_oom_notifier(struct notifier_block *nb); | ||
| 159 | 165 | ||
| 160 | /* linux/mm/memory.c */ | 166 | /* linux/mm/memory.c */ |
| 161 | extern void swapin_readahead(swp_entry_t, unsigned long, struct vm_area_struct *); | 167 | extern void swapin_readahead(swp_entry_t, unsigned long, struct vm_area_struct *); |
| 162 | 168 | ||
| 163 | /* linux/mm/page_alloc.c */ | 169 | /* linux/mm/page_alloc.c */ |
| 164 | extern unsigned long totalram_pages; | 170 | extern unsigned long totalram_pages; |
| 165 | extern unsigned long totalhigh_pages; | ||
| 166 | extern unsigned long totalreserve_pages; | 171 | extern unsigned long totalreserve_pages; |
| 167 | extern long nr_swap_pages; | 172 | extern long nr_swap_pages; |
| 168 | extern unsigned int nr_free_pages(void); | 173 | extern unsigned int nr_free_pages(void); |
| @@ -190,6 +195,7 @@ extern long vm_total_pages; | |||
| 190 | #ifdef CONFIG_NUMA | 195 | #ifdef CONFIG_NUMA |
| 191 | extern int zone_reclaim_mode; | 196 | extern int zone_reclaim_mode; |
| 192 | extern int sysctl_min_unmapped_ratio; | 197 | extern int sysctl_min_unmapped_ratio; |
| 198 | extern int sysctl_min_slab_ratio; | ||
| 193 | extern int zone_reclaim(struct zone *, gfp_t, unsigned int); | 199 | extern int zone_reclaim(struct zone *, gfp_t, unsigned int); |
| 194 | #else | 200 | #else |
| 195 | #define zone_reclaim_mode 0 | 201 | #define zone_reclaim_mode 0 |
| @@ -212,7 +218,9 @@ extern void swap_unplug_io_fn(struct backing_dev_info *, struct page *); | |||
| 212 | /* linux/mm/page_io.c */ | 218 | /* linux/mm/page_io.c */ |
| 213 | extern int swap_readpage(struct file *, struct page *); | 219 | extern int swap_readpage(struct file *, struct page *); |
| 214 | extern int swap_writepage(struct page *page, struct writeback_control *wbc); | 220 | extern int swap_writepage(struct page *page, struct writeback_control *wbc); |
| 215 | extern int rw_swap_page_sync(int, swp_entry_t, struct page *); | 221 | extern int rw_swap_page_sync(int rw, swp_entry_t entry, struct page *page, |
| 222 | struct bio **bio_chain); | ||
| 223 | extern int end_swap_bio_read(struct bio *bio, unsigned int bytes_done, int err); | ||
| 216 | 224 | ||
| 217 | /* linux/mm/swap_state.c */ | 225 | /* linux/mm/swap_state.c */ |
| 218 | extern struct address_space swapper_space; | 226 | extern struct address_space swapper_space; |
diff --git a/include/linux/synclink.h b/include/linux/synclink.h index 0577f5284c..c8b042667a 100644 --- a/include/linux/synclink.h +++ b/include/linux/synclink.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * SyncLink Multiprotocol Serial Adapter Driver | 2 | * SyncLink Multiprotocol Serial Adapter Driver |
| 3 | * | 3 | * |
| 4 | * $Id: synclink.h,v 3.13 2006/05/23 18:25:06 paulkf Exp $ | 4 | * $Id: synclink.h,v 3.14 2006/07/17 20:15:43 paulkf Exp $ |
| 5 | * | 5 | * |
| 6 | * Copyright (C) 1998-2000 by Microgate Corporation | 6 | * Copyright (C) 1998-2000 by Microgate Corporation |
| 7 | * | 7 | * |
| @@ -124,6 +124,8 @@ | |||
| 124 | 124 | ||
| 125 | #define MGSL_MODE_ASYNC 1 | 125 | #define MGSL_MODE_ASYNC 1 |
| 126 | #define MGSL_MODE_HDLC 2 | 126 | #define MGSL_MODE_HDLC 2 |
| 127 | #define MGSL_MODE_MONOSYNC 3 | ||
| 128 | #define MGSL_MODE_BISYNC 4 | ||
| 127 | #define MGSL_MODE_RAW 6 | 129 | #define MGSL_MODE_RAW 6 |
| 128 | 130 | ||
| 129 | #define MGSL_BUS_TYPE_ISA 1 | 131 | #define MGSL_BUS_TYPE_ISA 1 |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 008f04c567..2d1c3d5c83 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
| @@ -53,6 +53,7 @@ struct mq_attr; | |||
| 53 | struct compat_stat; | 53 | struct compat_stat; |
| 54 | struct compat_timeval; | 54 | struct compat_timeval; |
| 55 | struct robust_list_head; | 55 | struct robust_list_head; |
| 56 | struct getcpu_cache; | ||
| 56 | 57 | ||
| 57 | #include <linux/types.h> | 58 | #include <linux/types.h> |
| 58 | #include <linux/aio_abi.h> | 59 | #include <linux/aio_abi.h> |
| @@ -596,5 +597,6 @@ asmlinkage long sys_get_robust_list(int pid, | |||
| 596 | size_t __user *len_ptr); | 597 | size_t __user *len_ptr); |
| 597 | asmlinkage long sys_set_robust_list(struct robust_list_head __user *head, | 598 | asmlinkage long sys_set_robust_list(struct robust_list_head __user *head, |
| 598 | size_t len); | 599 | size_t len); |
| 600 | asmlinkage long sys_getcpu(unsigned __user *cpu, unsigned __user *node, struct getcpu_cache __user *cache); | ||
| 599 | 601 | ||
| 600 | #endif | 602 | #endif |
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index e4b1a4d4dc..1b24bd45e0 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
| @@ -150,6 +150,8 @@ enum | |||
| 150 | KERN_IA64_UNALIGNED=72, /* int: ia64 unaligned userland trap enable */ | 150 | KERN_IA64_UNALIGNED=72, /* int: ia64 unaligned userland trap enable */ |
| 151 | KERN_COMPAT_LOG=73, /* int: print compat layer messages */ | 151 | KERN_COMPAT_LOG=73, /* int: print compat layer messages */ |
| 152 | KERN_MAX_LOCK_DEPTH=74, | 152 | KERN_MAX_LOCK_DEPTH=74, |
| 153 | KERN_NMI_WATCHDOG=75, /* int: enable/disable nmi watchdog */ | ||
| 154 | KERN_PANIC_ON_NMI=76, /* int: whether we will panic on an unrecovered */ | ||
| 153 | }; | 155 | }; |
| 154 | 156 | ||
| 155 | 157 | ||
| @@ -191,6 +193,7 @@ enum | |||
| 191 | VM_MIN_UNMAPPED=32, /* Set min percent of unmapped pages */ | 193 | VM_MIN_UNMAPPED=32, /* Set min percent of unmapped pages */ |
| 192 | VM_PANIC_ON_OOM=33, /* panic at out-of-memory */ | 194 | VM_PANIC_ON_OOM=33, /* panic at out-of-memory */ |
| 193 | VM_VDSO_ENABLED=34, /* map VDSO into new processes? */ | 195 | VM_VDSO_ENABLED=34, /* map VDSO into new processes? */ |
| 196 | VM_MIN_SLAB=35, /* Percent pages ignored by zone reclaim */ | ||
| 194 | }; | 197 | }; |
| 195 | 198 | ||
| 196 | 199 | ||
| @@ -411,6 +414,10 @@ enum | |||
| 411 | NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS=115, | 414 | NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS=115, |
| 412 | NET_TCP_DMA_COPYBREAK=116, | 415 | NET_TCP_DMA_COPYBREAK=116, |
| 413 | NET_TCP_SLOW_START_AFTER_IDLE=117, | 416 | NET_TCP_SLOW_START_AFTER_IDLE=117, |
| 417 | NET_CIPSOV4_CACHE_ENABLE=118, | ||
| 418 | NET_CIPSOV4_CACHE_BUCKET_SIZE=119, | ||
| 419 | NET_CIPSOV4_RBM_OPTFMT=120, | ||
| 420 | NET_CIPSOV4_RBM_STRICTVALID=121, | ||
| 414 | }; | 421 | }; |
| 415 | 422 | ||
| 416 | enum { | 423 | enum { |
| @@ -552,6 +559,7 @@ enum { | |||
| 552 | NET_IPV6_ACCEPT_RA_RTR_PREF=20, | 559 | NET_IPV6_ACCEPT_RA_RTR_PREF=20, |
| 553 | NET_IPV6_RTR_PROBE_INTERVAL=21, | 560 | NET_IPV6_RTR_PROBE_INTERVAL=21, |
| 554 | NET_IPV6_ACCEPT_RA_RT_INFO_MAX_PLEN=22, | 561 | NET_IPV6_ACCEPT_RA_RT_INFO_MAX_PLEN=22, |
| 562 | NET_IPV6_PROXY_NDP=23, | ||
| 555 | __NET_IPV6_MAX | 563 | __NET_IPV6_MAX |
| 556 | }; | 564 | }; |
| 557 | 565 | ||
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index 1ea5d3cda6..6d5c43d31d 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | #ifndef _SYSFS_H_ | 10 | #ifndef _SYSFS_H_ |
| 11 | #define _SYSFS_H_ | 11 | #define _SYSFS_H_ |
| 12 | 12 | ||
| 13 | #include <linux/compiler.h> | ||
| 13 | #include <asm/atomic.h> | 14 | #include <asm/atomic.h> |
| 14 | 15 | ||
| 15 | struct kobject; | 16 | struct kobject; |
| @@ -86,40 +87,44 @@ struct sysfs_dirent { | |||
| 86 | 87 | ||
| 87 | #ifdef CONFIG_SYSFS | 88 | #ifdef CONFIG_SYSFS |
| 88 | 89 | ||
| 89 | extern int | 90 | extern int __must_check |
| 90 | sysfs_create_dir(struct kobject *); | 91 | sysfs_create_dir(struct kobject *); |
| 91 | 92 | ||
| 92 | extern void | 93 | extern void |
| 93 | sysfs_remove_dir(struct kobject *); | 94 | sysfs_remove_dir(struct kobject *); |
| 94 | 95 | ||
| 95 | extern int | 96 | extern int __must_check |
| 96 | sysfs_rename_dir(struct kobject *, const char *new_name); | 97 | sysfs_rename_dir(struct kobject *, const char *new_name); |
| 97 | 98 | ||
| 98 | extern int | 99 | extern int __must_check |
| 99 | sysfs_create_file(struct kobject *, const struct attribute *); | 100 | sysfs_create_file(struct kobject *, const struct attribute *); |
| 100 | 101 | ||
| 101 | extern int | 102 | extern int __must_check |
| 102 | sysfs_update_file(struct kobject *, const struct attribute *); | 103 | sysfs_update_file(struct kobject *, const struct attribute *); |
| 103 | 104 | ||
| 104 | extern int | 105 | extern int __must_check |
| 105 | sysfs_chmod_file(struct kobject *kobj, struct attribute *attr, mode_t mode); | 106 | sysfs_chmod_file(struct kobject *kobj, struct attribute *attr, mode_t mode); |
| 106 | 107 | ||
| 107 | extern void | 108 | extern void |
| 108 | sysfs_remove_file(struct kobject *, const struct attribute *); | 109 | sysfs_remove_file(struct kobject *, const struct attribute *); |
| 109 | 110 | ||
| 110 | extern int | 111 | extern int __must_check |
| 111 | sysfs_create_link(struct kobject * kobj, struct kobject * target, const char * name); | 112 | sysfs_create_link(struct kobject * kobj, struct kobject * target, const char * name); |
| 112 | 113 | ||
| 113 | extern void | 114 | extern void |
| 114 | sysfs_remove_link(struct kobject *, const char * name); | 115 | sysfs_remove_link(struct kobject *, const char * name); |
| 115 | 116 | ||
| 116 | int sysfs_create_bin_file(struct kobject * kobj, struct bin_attribute * attr); | 117 | int __must_check sysfs_create_bin_file(struct kobject *kobj, |
| 117 | int sysfs_remove_bin_file(struct kobject * kobj, struct bin_attribute * attr); | 118 | struct bin_attribute *attr); |
| 119 | void sysfs_remove_bin_file(struct kobject *kobj, struct bin_attribute *attr); | ||
| 118 | 120 | ||
| 119 | int sysfs_create_group(struct kobject *, const struct attribute_group *); | 121 | int __must_check sysfs_create_group(struct kobject *, |
| 122 | const struct attribute_group *); | ||
| 120 | void sysfs_remove_group(struct kobject *, const struct attribute_group *); | 123 | void sysfs_remove_group(struct kobject *, const struct attribute_group *); |
| 121 | void sysfs_notify(struct kobject * k, char *dir, char *attr); | 124 | void sysfs_notify(struct kobject * k, char *dir, char *attr); |
| 122 | 125 | ||
| 126 | extern int __must_check sysfs_init(void); | ||
| 127 | |||
| 123 | #else /* CONFIG_SYSFS */ | 128 | #else /* CONFIG_SYSFS */ |
| 124 | 129 | ||
| 125 | static inline int sysfs_create_dir(struct kobject * k) | 130 | static inline int sysfs_create_dir(struct kobject * k) |
| @@ -191,6 +196,11 @@ static inline void sysfs_notify(struct kobject * k, char *dir, char *attr) | |||
| 191 | { | 196 | { |
| 192 | } | 197 | } |
| 193 | 198 | ||
| 199 | static inline int __must_check sysfs_init(void) | ||
| 200 | { | ||
| 201 | return 0; | ||
| 202 | } | ||
| 203 | |||
| 194 | #endif /* CONFIG_SYSFS */ | 204 | #endif /* CONFIG_SYSFS */ |
| 195 | 205 | ||
| 196 | #endif /* _SYSFS_H_ */ | 206 | #endif /* _SYSFS_H_ */ |
diff --git a/include/linux/sysrq.h b/include/linux/sysrq.h index 4812ff6056..e657e523b9 100644 --- a/include/linux/sysrq.h +++ b/include/linux/sysrq.h | |||
| @@ -11,6 +11,8 @@ | |||
| 11 | * based upon discusions in irc://irc.openprojects.net/#kernelnewbies | 11 | * based upon discusions in irc://irc.openprojects.net/#kernelnewbies |
| 12 | */ | 12 | */ |
| 13 | 13 | ||
| 14 | #ifndef _LINUX_SYSRQ_H | ||
| 15 | #define _LINUX_SYSRQ_H | ||
| 14 | 16 | ||
| 15 | struct pt_regs; | 17 | struct pt_regs; |
| 16 | struct tty_struct; | 18 | struct tty_struct; |
| @@ -57,3 +59,5 @@ static inline int __reterr(void) | |||
| 57 | #define unregister_sysrq_key(ig,nore) __reterr() | 59 | #define unregister_sysrq_key(ig,nore) __reterr() |
| 58 | 60 | ||
| 59 | #endif | 61 | #endif |
| 62 | |||
| 63 | #endif /* _LINUX_SYSRQ_H */ | ||
diff --git a/include/linux/taskstats.h b/include/linux/taskstats.h index f1cb6cddd1..45248806ae 100644 --- a/include/linux/taskstats.h +++ b/include/linux/taskstats.h | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | * | 2 | * |
| 3 | * Copyright (C) Shailabh Nagar, IBM Corp. 2006 | 3 | * Copyright (C) Shailabh Nagar, IBM Corp. 2006 |
| 4 | * (C) Balbir Singh, IBM Corp. 2006 | 4 | * (C) Balbir Singh, IBM Corp. 2006 |
| 5 | * (C) Jay Lan, SGI, 2006 | ||
| 5 | * | 6 | * |
| 6 | * This program is free software; you can redistribute it and/or modify it | 7 | * This program is free software; you can redistribute it and/or modify it |
| 7 | * under the terms of version 2.1 of the GNU Lesser General Public License | 8 | * under the terms of version 2.1 of the GNU Lesser General Public License |
| @@ -29,16 +30,25 @@ | |||
| 29 | * c) add new fields after version comment; maintain 64-bit alignment | 30 | * c) add new fields after version comment; maintain 64-bit alignment |
| 30 | */ | 31 | */ |
| 31 | 32 | ||
| 32 | #define TASKSTATS_VERSION 1 | 33 | |
| 34 | #define TASKSTATS_VERSION 2 | ||
| 35 | #define TS_COMM_LEN 32 /* should be >= TASK_COMM_LEN | ||
| 36 | * in linux/sched.h */ | ||
| 33 | 37 | ||
| 34 | struct taskstats { | 38 | struct taskstats { |
| 35 | 39 | ||
| 36 | /* Version 1 */ | 40 | /* The version number of this struct. This field is always set to |
| 41 | * TAKSTATS_VERSION, which is defined in <linux/taskstats.h>. | ||
| 42 | * Each time the struct is changed, the value should be incremented. | ||
| 43 | */ | ||
| 37 | __u16 version; | 44 | __u16 version; |
| 38 | __u16 padding[3]; /* Userspace should not interpret the padding | 45 | __u32 ac_exitcode; /* Exit status */ |
| 39 | * field which can be replaced by useful | 46 | |
| 40 | * fields if struct taskstats is extended. | 47 | /* The accounting flags of a task as defined in <linux/acct.h> |
| 41 | */ | 48 | * Defined values are AFORK, ASU, ACOMPAT, ACORE, and AXSIG. |
| 49 | */ | ||
| 50 | __u8 ac_flag; /* Record flags */ | ||
| 51 | __u8 ac_nice; /* task_nice */ | ||
| 42 | 52 | ||
| 43 | /* Delay accounting fields start | 53 | /* Delay accounting fields start |
| 44 | * | 54 | * |
| @@ -88,6 +98,48 @@ struct taskstats { | |||
| 88 | __u64 cpu_run_virtual_total; | 98 | __u64 cpu_run_virtual_total; |
| 89 | /* Delay accounting fields end */ | 99 | /* Delay accounting fields end */ |
| 90 | /* version 1 ends here */ | 100 | /* version 1 ends here */ |
| 101 | |||
| 102 | /* Basic Accounting Fields start */ | ||
| 103 | char ac_comm[TS_COMM_LEN]; /* Command name */ | ||
| 104 | __u8 ac_sched; /* Scheduling discipline */ | ||
| 105 | __u8 ac_pad[3]; | ||
| 106 | __u32 ac_uid; /* User ID */ | ||
| 107 | __u32 ac_gid; /* Group ID */ | ||
| 108 | __u32 ac_pid; /* Process ID */ | ||
| 109 | __u32 ac_ppid; /* Parent process ID */ | ||
| 110 | __u32 ac_btime; /* Begin time [sec since 1970] */ | ||
| 111 | __u64 ac_etime; /* Elapsed time [usec] */ | ||
| 112 | __u64 ac_utime; /* User CPU time [usec] */ | ||
| 113 | __u64 ac_stime; /* SYstem CPU time [usec] */ | ||
| 114 | __u64 ac_minflt; /* Minor Page Fault Count */ | ||
| 115 | __u64 ac_majflt; /* Major Page Fault Count */ | ||
| 116 | /* Basic Accounting Fields end */ | ||
| 117 | |||
| 118 | /* Extended accounting fields start */ | ||
| 119 | /* Accumulated RSS usage in duration of a task, in MBytes-usecs. | ||
| 120 | * The current rss usage is added to this counter every time | ||
| 121 | * a tick is charged to a task's system time. So, at the end we | ||
| 122 | * will have memory usage multiplied by system time. Thus an | ||
| 123 | * average usage per system time unit can be calculated. | ||
| 124 | */ | ||
| 125 | __u64 coremem; /* accumulated RSS usage in MB-usec */ | ||
| 126 | /* Accumulated virtual memory usage in duration of a task. | ||
| 127 | * Same as acct_rss_mem1 above except that we keep track of VM usage. | ||
| 128 | */ | ||
| 129 | __u64 virtmem; /* accumulated VM usage in MB-usec */ | ||
| 130 | |||
| 131 | /* High watermark of RSS and virtual memory usage in duration of | ||
| 132 | * a task, in KBytes. | ||
| 133 | */ | ||
| 134 | __u64 hiwater_rss; /* High-watermark of RSS usage, in KB */ | ||
| 135 | __u64 hiwater_vm; /* High-water VM usage, in KB */ | ||
| 136 | |||
| 137 | /* The following four fields are I/O statistics of a task. */ | ||
| 138 | __u64 read_char; /* bytes read */ | ||
| 139 | __u64 write_char; /* bytes written */ | ||
| 140 | __u64 read_syscalls; /* read syscalls */ | ||
| 141 | __u64 write_syscalls; /* write syscalls */ | ||
| 142 | /* Extended accounting fields end */ | ||
| 91 | }; | 143 | }; |
| 92 | 144 | ||
| 93 | 145 | ||
diff --git a/include/linux/tc_act/Kbuild b/include/linux/tc_act/Kbuild index 5251a505b2..78dfbac363 100644 --- a/include/linux/tc_act/Kbuild +++ b/include/linux/tc_act/Kbuild | |||
| @@ -1 +1,4 @@ | |||
| 1 | header-y += tc_gact.h tc_ipt.h tc_mirred.h tc_pedit.h | 1 | header-y += tc_gact.h |
| 2 | header-y += tc_ipt.h | ||
| 3 | header-y += tc_mirred.h | ||
| 4 | header-y += tc_pedit.h | ||
diff --git a/include/linux/tc_ematch/Kbuild b/include/linux/tc_ematch/Kbuild index 381e93018d..4a58a1c32a 100644 --- a/include/linux/tc_ematch/Kbuild +++ b/include/linux/tc_ematch/Kbuild | |||
| @@ -1 +1,4 @@ | |||
| 1 | headers-y := tc_em_cmp.h tc_em_meta.h tc_em_nbyte.h tc_em_text.h | 1 | header-y += tc_em_cmp.h |
| 2 | header-y += tc_em_meta.h | ||
| 3 | header-y += tc_em_nbyte.h | ||
| 4 | header-y += tc_em_text.h | ||
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 8ebf497907..0e058a2d1c 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
| @@ -21,10 +21,10 @@ | |||
| 21 | #include <asm/byteorder.h> | 21 | #include <asm/byteorder.h> |
| 22 | 22 | ||
| 23 | struct tcphdr { | 23 | struct tcphdr { |
| 24 | __u16 source; | 24 | __be16 source; |
| 25 | __u16 dest; | 25 | __be16 dest; |
| 26 | __u32 seq; | 26 | __be32 seq; |
| 27 | __u32 ack_seq; | 27 | __be32 ack_seq; |
| 28 | #if defined(__LITTLE_ENDIAN_BITFIELD) | 28 | #if defined(__LITTLE_ENDIAN_BITFIELD) |
| 29 | __u16 res1:4, | 29 | __u16 res1:4, |
| 30 | doff:4, | 30 | doff:4, |
| @@ -50,9 +50,9 @@ struct tcphdr { | |||
| 50 | #else | 50 | #else |
| 51 | #error "Adjust your <asm/byteorder.h> defines" | 51 | #error "Adjust your <asm/byteorder.h> defines" |
| 52 | #endif | 52 | #endif |
| 53 | __u16 window; | 53 | __be16 window; |
| 54 | __u16 check; | 54 | __be16 check; |
| 55 | __u16 urg_ptr; | 55 | __be16 urg_ptr; |
| 56 | }; | 56 | }; |
| 57 | 57 | ||
| 58 | /* | 58 | /* |
| @@ -62,7 +62,7 @@ struct tcphdr { | |||
| 62 | */ | 62 | */ |
| 63 | union tcp_word_hdr { | 63 | union tcp_word_hdr { |
| 64 | struct tcphdr hdr; | 64 | struct tcphdr hdr; |
| 65 | __u32 words[5]; | 65 | __be32 words[5]; |
| 66 | }; | 66 | }; |
| 67 | 67 | ||
| 68 | #define tcp_flag_word(tp) ( ((union tcp_word_hdr *)(tp))->words [3]) | 68 | #define tcp_flag_word(tp) ( ((union tcp_word_hdr *)(tp))->words [3]) |
| @@ -166,6 +166,11 @@ struct tcp_info | |||
| 166 | #include <net/inet_timewait_sock.h> | 166 | #include <net/inet_timewait_sock.h> |
| 167 | 167 | ||
| 168 | /* This defines a selective acknowledgement block. */ | 168 | /* This defines a selective acknowledgement block. */ |
| 169 | struct tcp_sack_block_wire { | ||
| 170 | __be32 start_seq; | ||
| 171 | __be32 end_seq; | ||
| 172 | }; | ||
| 173 | |||
| 169 | struct tcp_sack_block { | 174 | struct tcp_sack_block { |
| 170 | __u32 start_seq; | 175 | __u32 start_seq; |
| 171 | __u32 end_seq; | 176 | __u32 end_seq; |
| @@ -211,7 +216,7 @@ struct tcp_sock { | |||
| 211 | * Header prediction flags | 216 | * Header prediction flags |
| 212 | * 0x5?10 << 16 + snd_wnd in net byte order | 217 | * 0x5?10 << 16 + snd_wnd in net byte order |
| 213 | */ | 218 | */ |
| 214 | __u32 pred_flags; | 219 | __be32 pred_flags; |
| 215 | 220 | ||
| 216 | /* | 221 | /* |
| 217 | * RFC793 variables by their proper names. This means you can | 222 | * RFC793 variables by their proper names. This means you can |
diff --git a/include/linux/timex.h b/include/linux/timex.h index d543d3871e..049dfe4a11 100644 --- a/include/linux/timex.h +++ b/include/linux/timex.h | |||
| @@ -69,34 +69,28 @@ | |||
| 69 | * zero to MAXTC, the PLL will converge in 15 minutes to 16 hours, | 69 | * zero to MAXTC, the PLL will converge in 15 minutes to 16 hours, |
| 70 | * respectively. | 70 | * respectively. |
| 71 | */ | 71 | */ |
| 72 | #define SHIFT_KG 6 /* phase factor (shift) */ | 72 | #define SHIFT_PLL 4 /* PLL frequency factor (shift) */ |
| 73 | #define SHIFT_KF 16 /* PLL frequency factor (shift) */ | 73 | #define SHIFT_FLL 2 /* FLL frequency factor (shift) */ |
| 74 | #define SHIFT_KH 2 /* FLL frequency factor (shift) */ | 74 | #define MAXTC 10 /* maximum time constant (shift) */ |
| 75 | #define MAXTC 6 /* maximum time constant (shift) */ | ||
| 76 | 75 | ||
| 77 | /* | 76 | /* |
| 78 | * The SHIFT_SCALE define establishes the decimal point of the time_phase | 77 | * The SHIFT_UPDATE define establishes the decimal point of the |
| 79 | * variable which serves as an extension to the low-order bits of the | 78 | * time_offset variable which represents the current offset with |
| 80 | * system clock variable. The SHIFT_UPDATE define establishes the decimal | 79 | * respect to standard time. |
| 81 | * point of the time_offset variable which represents the current offset | ||
| 82 | * with respect to standard time. The FINENSEC define represents 1 nsec in | ||
| 83 | * scaled units. | ||
| 84 | * | 80 | * |
| 85 | * SHIFT_USEC defines the scaling (shift) of the time_freq and | 81 | * SHIFT_USEC defines the scaling (shift) of the time_freq and |
| 86 | * time_tolerance variables, which represent the current frequency | 82 | * time_tolerance variables, which represent the current frequency |
| 87 | * offset and maximum frequency tolerance. | 83 | * offset and maximum frequency tolerance. |
| 88 | * | ||
| 89 | * FINENSEC is 1 ns in SHIFT_UPDATE units of the time_phase variable. | ||
| 90 | */ | 84 | */ |
| 91 | #define SHIFT_SCALE 22 /* phase scale (shift) */ | 85 | #define SHIFT_UPDATE (SHIFT_HZ + 1) /* time offset scale (shift) */ |
| 92 | #define SHIFT_UPDATE (SHIFT_KG + MAXTC) /* time offset scale (shift) */ | ||
| 93 | #define SHIFT_USEC 16 /* frequency offset scale (shift) */ | 86 | #define SHIFT_USEC 16 /* frequency offset scale (shift) */ |
| 94 | #define FINENSEC (1L << (SHIFT_SCALE - 10)) /* ~1 ns in phase units */ | 87 | #define SHIFT_NSEC 12 /* kernel frequency offset scale */ |
| 95 | 88 | ||
| 96 | #define MAXPHASE 512000L /* max phase error (us) */ | 89 | #define MAXPHASE 512000L /* max phase error (us) */ |
| 97 | #define MAXFREQ (512L << SHIFT_USEC) /* max frequency error (ppm) */ | 90 | #define MAXFREQ (512L << SHIFT_USEC) /* max frequency error (ppm) */ |
| 98 | #define MINSEC 16L /* min interval between updates (s) */ | 91 | #define MAXFREQ_NSEC (512000L << SHIFT_NSEC) /* max frequency error (ppb) */ |
| 99 | #define MAXSEC 1200L /* max interval between updates (s) */ | 92 | #define MINSEC 256 /* min interval between updates (s) */ |
| 93 | #define MAXSEC 2048 /* max interval between updates (s) */ | ||
| 100 | #define NTP_PHASE_LIMIT (MAXPHASE << 5) /* beyond max. dispersion */ | 94 | #define NTP_PHASE_LIMIT (MAXPHASE << 5) /* beyond max. dispersion */ |
| 101 | 95 | ||
| 102 | /* | 96 | /* |
| @@ -204,33 +198,15 @@ extern int tickadj; /* amount of adjustment per tick */ | |||
| 204 | /* | 198 | /* |
| 205 | * phase-lock loop variables | 199 | * phase-lock loop variables |
| 206 | */ | 200 | */ |
| 207 | extern int time_state; /* clock status */ | ||
| 208 | extern int time_status; /* clock synchronization status bits */ | 201 | extern int time_status; /* clock synchronization status bits */ |
| 209 | extern long time_offset; /* time adjustment (us) */ | ||
| 210 | extern long time_constant; /* pll time constant */ | ||
| 211 | extern long time_tolerance; /* frequency tolerance (ppm) */ | ||
| 212 | extern long time_precision; /* clock precision (us) */ | ||
| 213 | extern long time_maxerror; /* maximum error */ | 202 | extern long time_maxerror; /* maximum error */ |
| 214 | extern long time_esterror; /* estimated error */ | 203 | extern long time_esterror; /* estimated error */ |
| 215 | 204 | ||
| 216 | extern long time_freq; /* frequency offset (scaled ppm) */ | 205 | extern long time_freq; /* frequency offset (scaled ppm) */ |
| 217 | extern long time_reftime; /* time at last adjustment (s) */ | ||
| 218 | 206 | ||
| 219 | extern long time_adjust; /* The amount of adjtime left */ | 207 | extern long time_adjust; /* The amount of adjtime left */ |
| 220 | extern long time_next_adjust; /* Value for time_adjust at next tick */ | ||
| 221 | 208 | ||
| 222 | /** | 209 | extern void ntp_clear(void); |
| 223 | * ntp_clear - Clears the NTP state variables | ||
| 224 | * | ||
| 225 | * Must be called while holding a write on the xtime_lock | ||
| 226 | */ | ||
| 227 | static inline void ntp_clear(void) | ||
| 228 | { | ||
| 229 | time_adjust = 0; /* stop active adjtime() */ | ||
| 230 | time_status |= STA_UNSYNC; | ||
| 231 | time_maxerror = NTP_PHASE_LIMIT; | ||
| 232 | time_esterror = NTP_PHASE_LIMIT; | ||
| 233 | } | ||
| 234 | 210 | ||
| 235 | /** | 211 | /** |
| 236 | * ntp_synced - Returns 1 if the NTP status is not UNSYNC | 212 | * ntp_synced - Returns 1 if the NTP status is not UNSYNC |
| @@ -294,11 +270,15 @@ extern void register_time_interpolator(struct time_interpolator *); | |||
| 294 | extern void unregister_time_interpolator(struct time_interpolator *); | 270 | extern void unregister_time_interpolator(struct time_interpolator *); |
| 295 | extern void time_interpolator_reset(void); | 271 | extern void time_interpolator_reset(void); |
| 296 | extern unsigned long time_interpolator_get_offset(void); | 272 | extern unsigned long time_interpolator_get_offset(void); |
| 273 | extern void time_interpolator_update(long delta_nsec); | ||
| 297 | 274 | ||
| 298 | #else /* !CONFIG_TIME_INTERPOLATION */ | 275 | #else /* !CONFIG_TIME_INTERPOLATION */ |
| 299 | 276 | ||
| 300 | static inline void | 277 | static inline void time_interpolator_reset(void) |
| 301 | time_interpolator_reset(void) | 278 | { |
| 279 | } | ||
| 280 | |||
| 281 | static inline void time_interpolator_update(long delta_nsec) | ||
| 302 | { | 282 | { |
| 303 | } | 283 | } |
| 304 | 284 | ||
| @@ -309,6 +289,8 @@ time_interpolator_reset(void) | |||
| 309 | /* Returns how long ticks are at present, in ns / 2^(SHIFT_SCALE-10). */ | 289 | /* Returns how long ticks are at present, in ns / 2^(SHIFT_SCALE-10). */ |
| 310 | extern u64 current_tick_length(void); | 290 | extern u64 current_tick_length(void); |
| 311 | 291 | ||
| 292 | extern void second_overflow(void); | ||
| 293 | extern void update_ntp_one_tick(void); | ||
| 312 | extern int do_adjtimex(struct timex *); | 294 | extern int do_adjtimex(struct timex *); |
| 313 | 295 | ||
| 314 | #endif /* KERNEL */ | 296 | #endif /* KERNEL */ |
diff --git a/include/linux/trdevice.h b/include/linux/trdevice.h index 99e02ef54c..bfc84a7aec 100644 --- a/include/linux/trdevice.h +++ b/include/linux/trdevice.h | |||
| @@ -28,7 +28,7 @@ | |||
| 28 | #include <linux/if_tr.h> | 28 | #include <linux/if_tr.h> |
| 29 | 29 | ||
| 30 | #ifdef __KERNEL__ | 30 | #ifdef __KERNEL__ |
| 31 | extern unsigned short tr_type_trans(struct sk_buff *skb, struct net_device *dev); | 31 | extern __be16 tr_type_trans(struct sk_buff *skb, struct net_device *dev); |
| 32 | extern void tr_source_route(struct sk_buff *skb, struct trh_hdr *trh, struct net_device *dev); | 32 | extern void tr_source_route(struct sk_buff *skb, struct trh_hdr *trh, struct net_device *dev); |
| 33 | extern struct net_device *alloc_trdev(int sizeof_priv); | 33 | extern struct net_device *alloc_trdev(int sizeof_priv); |
| 34 | 34 | ||
diff --git a/include/linux/tsacct_kern.h b/include/linux/tsacct_kern.h new file mode 100644 index 0000000000..7e50ac795b --- /dev/null +++ b/include/linux/tsacct_kern.h | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | /* | ||
| 2 | * tsacct_kern.h - kernel header for system accounting over taskstats interface | ||
| 3 | * | ||
| 4 | * Copyright (C) Jay Lan SGI | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef _LINUX_TSACCT_KERN_H | ||
| 8 | #define _LINUX_TSACCT_KERN_H | ||
| 9 | |||
| 10 | #include <linux/taskstats.h> | ||
| 11 | |||
| 12 | #ifdef CONFIG_TASKSTATS | ||
| 13 | extern void bacct_add_tsk(struct taskstats *stats, struct task_struct *tsk); | ||
| 14 | #else | ||
| 15 | static inline void bacct_add_tsk(struct taskstats *stats, struct task_struct *tsk) | ||
| 16 | {} | ||
| 17 | #endif /* CONFIG_TASKSTATS */ | ||
| 18 | |||
| 19 | #ifdef CONFIG_TASK_XACCT | ||
| 20 | extern void xacct_add_tsk(struct taskstats *stats, struct task_struct *p); | ||
| 21 | extern void acct_update_integrals(struct task_struct *tsk); | ||
| 22 | extern void acct_clear_integrals(struct task_struct *tsk); | ||
| 23 | #else | ||
| 24 | static inline void xacct_add_tsk(struct taskstats *stats, struct task_struct *p) | ||
| 25 | {} | ||
| 26 | static inline void acct_update_integrals(struct task_struct *tsk) | ||
| 27 | {} | ||
| 28 | static inline void acct_clear_integrals(struct task_struct *tsk) | ||
| 29 | {} | ||
| 30 | #endif /* CONFIG_TASK_XACCT */ | ||
| 31 | |||
| 32 | #endif | ||
| 33 | |||
| 34 | |||
diff --git a/include/linux/tty.h b/include/linux/tty.h index 04827ca657..44091c0db0 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
| @@ -174,7 +174,7 @@ struct tty_struct { | |||
| 174 | struct tty_driver *driver; | 174 | struct tty_driver *driver; |
| 175 | int index; | 175 | int index; |
| 176 | struct tty_ldisc ldisc; | 176 | struct tty_ldisc ldisc; |
| 177 | struct semaphore termios_sem; | 177 | struct mutex termios_mutex; |
| 178 | struct termios *termios, *termios_locked; | 178 | struct termios *termios, *termios_locked; |
| 179 | char name[64]; | 179 | char name[64]; |
| 180 | int pgrp; | 180 | int pgrp; |
| @@ -190,7 +190,6 @@ struct tty_struct { | |||
| 190 | struct tty_struct *link; | 190 | struct tty_struct *link; |
| 191 | struct fasync_struct *fasync; | 191 | struct fasync_struct *fasync; |
| 192 | struct tty_bufhead buf; | 192 | struct tty_bufhead buf; |
| 193 | int max_flip_cnt; | ||
| 194 | int alt_speed; /* For magic substitution of 38400 bps */ | 193 | int alt_speed; /* For magic substitution of 38400 bps */ |
| 195 | wait_queue_head_t write_wait; | 194 | wait_queue_head_t write_wait; |
| 196 | wait_queue_head_t read_wait; | 195 | wait_queue_head_t read_wait; |
| @@ -308,6 +307,9 @@ extern void tty_ldisc_put(int); | |||
| 308 | extern void tty_wakeup(struct tty_struct *tty); | 307 | extern void tty_wakeup(struct tty_struct *tty); |
| 309 | extern void tty_ldisc_flush(struct tty_struct *tty); | 308 | extern void tty_ldisc_flush(struct tty_struct *tty); |
| 310 | 309 | ||
| 310 | extern int tty_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | ||
| 311 | unsigned long arg); | ||
| 312 | |||
| 311 | extern struct mutex tty_mutex; | 313 | extern struct mutex tty_mutex; |
| 312 | 314 | ||
| 313 | /* n_tty.c */ | 315 | /* n_tty.c */ |
diff --git a/include/linux/types.h b/include/linux/types.h index 3f235660a3..406d4ae576 100644 --- a/include/linux/types.h +++ b/include/linux/types.h | |||
| @@ -33,6 +33,8 @@ typedef __kernel_clockid_t clockid_t; | |||
| 33 | typedef __kernel_mqd_t mqd_t; | 33 | typedef __kernel_mqd_t mqd_t; |
| 34 | 34 | ||
| 35 | #ifdef __KERNEL__ | 35 | #ifdef __KERNEL__ |
| 36 | typedef _Bool bool; | ||
| 37 | |||
| 36 | typedef __kernel_uid32_t uid_t; | 38 | typedef __kernel_uid32_t uid_t; |
| 37 | typedef __kernel_gid32_t gid_t; | 39 | typedef __kernel_gid32_t gid_t; |
| 38 | typedef __kernel_uid16_t uid16_t; | 40 | typedef __kernel_uid16_t uid16_t; |
diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h index 391e7ed1eb..a48d7f11c7 100644 --- a/include/linux/uaccess.h +++ b/include/linux/uaccess.h | |||
| @@ -19,4 +19,26 @@ static inline unsigned long __copy_from_user_nocache(void *to, | |||
| 19 | 19 | ||
| 20 | #endif /* ARCH_HAS_NOCACHE_UACCESS */ | 20 | #endif /* ARCH_HAS_NOCACHE_UACCESS */ |
| 21 | 21 | ||
| 22 | /** | ||
| 23 | * probe_kernel_address(): safely attempt to read from a location | ||
| 24 | * @addr: address to read from - its type is type typeof(retval)* | ||
| 25 | * @retval: read into this variable | ||
| 26 | * | ||
| 27 | * Safely read from address @addr into variable @revtal. If a kernel fault | ||
| 28 | * happens, handle that and return -EFAULT. | ||
| 29 | * We ensure that the __get_user() is executed in atomic context so that | ||
| 30 | * do_page_fault() doesn't attempt to take mmap_sem. This makes | ||
| 31 | * probe_kernel_address() suitable for use within regions where the caller | ||
| 32 | * already holds mmap_sem, or other locks which nest inside mmap_sem. | ||
| 33 | */ | ||
| 34 | #define probe_kernel_address(addr, retval) \ | ||
| 35 | ({ \ | ||
| 36 | long ret; \ | ||
| 37 | \ | ||
| 38 | inc_preempt_count(); \ | ||
| 39 | ret = __get_user(retval, addr); \ | ||
| 40 | dec_preempt_count(); \ | ||
| 41 | ret; \ | ||
| 42 | }) | ||
| 43 | |||
| 22 | #endif /* __LINUX_UACCESS_H__ */ | 44 | #endif /* __LINUX_UACCESS_H__ */ |
diff --git a/include/linux/udp.h b/include/linux/udp.h index 90223f057d..014b41d1e3 100644 --- a/include/linux/udp.h +++ b/include/linux/udp.h | |||
| @@ -20,10 +20,10 @@ | |||
| 20 | #include <linux/types.h> | 20 | #include <linux/types.h> |
| 21 | 21 | ||
| 22 | struct udphdr { | 22 | struct udphdr { |
| 23 | __u16 source; | 23 | __be16 source; |
| 24 | __u16 dest; | 24 | __be16 dest; |
| 25 | __u16 len; | 25 | __be16 len; |
| 26 | __u16 check; | 26 | __be16 check; |
| 27 | }; | 27 | }; |
| 28 | 28 | ||
| 29 | /* UDP socket options */ | 29 | /* UDP socket options */ |
diff --git a/include/linux/unwind.h b/include/linux/unwind.h index ce48e2cd37..73e1751d03 100644 --- a/include/linux/unwind.h +++ b/include/linux/unwind.h | |||
| @@ -12,8 +12,6 @@ | |||
| 12 | * is not much point in implementing the full Dwarf2 unwind API. | 12 | * is not much point in implementing the full Dwarf2 unwind API. |
| 13 | */ | 13 | */ |
| 14 | 14 | ||
| 15 | #include <linux/config.h> | ||
| 16 | |||
| 17 | struct module; | 15 | struct module; |
| 18 | 16 | ||
| 19 | #ifdef CONFIG_STACK_UNWIND | 17 | #ifdef CONFIG_STACK_UNWIND |
diff --git a/include/linux/usb.h b/include/linux/usb.h index d2bd0c8e01..190cc1b78f 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #include <linux/fs.h> /* for struct file_operations */ | 19 | #include <linux/fs.h> /* for struct file_operations */ |
| 20 | #include <linux/completion.h> /* for struct completion */ | 20 | #include <linux/completion.h> /* for struct completion */ |
| 21 | #include <linux/sched.h> /* for current && schedule_timeout */ | 21 | #include <linux/sched.h> /* for current && schedule_timeout */ |
| 22 | #include <linux/mutex.h> /* for struct mutex */ | ||
| 22 | 23 | ||
| 23 | struct usb_device; | 24 | struct usb_device; |
| 24 | struct usb_driver; | 25 | struct usb_driver; |
| @@ -102,8 +103,13 @@ enum usb_interface_condition { | |||
| 102 | * number from the USB core by calling usb_register_dev(). | 103 | * number from the USB core by calling usb_register_dev(). |
| 103 | * @condition: binding state of the interface: not bound, binding | 104 | * @condition: binding state of the interface: not bound, binding |
| 104 | * (in probe()), bound to a driver, or unbinding (in disconnect()) | 105 | * (in probe()), bound to a driver, or unbinding (in disconnect()) |
| 106 | * @is_active: flag set when the interface is bound and not suspended. | ||
| 107 | * @needs_remote_wakeup: flag set when the driver requires remote-wakeup | ||
| 108 | * capability during autosuspend. | ||
| 105 | * @dev: driver model's view of this device | 109 | * @dev: driver model's view of this device |
| 106 | * @class_dev: driver model's class view of this device. | 110 | * @class_dev: driver model's class view of this device. |
| 111 | * @pm_usage_cnt: PM usage counter for this interface; autosuspend is not | ||
| 112 | * allowed unless the counter is 0. | ||
| 107 | * | 113 | * |
| 108 | * USB device drivers attach to interfaces on a physical device. Each | 114 | * USB device drivers attach to interfaces on a physical device. Each |
| 109 | * interface encapsulates a single high level function, such as feeding | 115 | * interface encapsulates a single high level function, such as feeding |
| @@ -142,8 +148,12 @@ struct usb_interface { | |||
| 142 | int minor; /* minor number this interface is | 148 | int minor; /* minor number this interface is |
| 143 | * bound to */ | 149 | * bound to */ |
| 144 | enum usb_interface_condition condition; /* state of binding */ | 150 | enum usb_interface_condition condition; /* state of binding */ |
| 151 | unsigned is_active:1; /* the interface is not suspended */ | ||
| 152 | unsigned needs_remote_wakeup:1; /* driver requires remote wakeup */ | ||
| 153 | |||
| 145 | struct device dev; /* interface specific device info */ | 154 | struct device dev; /* interface specific device info */ |
| 146 | struct class_device *class_dev; | 155 | struct class_device *class_dev; |
| 156 | int pm_usage_cnt; /* usage counter for autosuspend */ | ||
| 147 | }; | 157 | }; |
| 148 | #define to_usb_interface(d) container_of(d, struct usb_interface, dev) | 158 | #define to_usb_interface(d) container_of(d, struct usb_interface, dev) |
| 149 | #define interface_to_usbdev(intf) \ | 159 | #define interface_to_usbdev(intf) \ |
| @@ -254,8 +264,6 @@ int __usb_get_extra_descriptor(char *buffer, unsigned size, | |||
| 254 | 264 | ||
| 255 | /* ----------------------------------------------------------------------- */ | 265 | /* ----------------------------------------------------------------------- */ |
| 256 | 266 | ||
| 257 | struct usb_operations; | ||
| 258 | |||
| 259 | /* USB device number allocation bitmap */ | 267 | /* USB device number allocation bitmap */ |
| 260 | struct usb_devmap { | 268 | struct usb_devmap { |
| 261 | unsigned long devicemap[128 / (8*sizeof(unsigned long))]; | 269 | unsigned long devicemap[128 / (8*sizeof(unsigned long))]; |
| @@ -268,6 +276,7 @@ struct usb_bus { | |||
| 268 | struct device *controller; /* host/master side hardware */ | 276 | struct device *controller; /* host/master side hardware */ |
| 269 | int busnum; /* Bus number (in order of reg) */ | 277 | int busnum; /* Bus number (in order of reg) */ |
| 270 | char *bus_name; /* stable id (PCI slot_name etc) */ | 278 | char *bus_name; /* stable id (PCI slot_name etc) */ |
| 279 | u8 uses_dma; /* Does the host controller use DMA? */ | ||
| 271 | u8 otg_port; /* 0, or number of OTG/HNP port */ | 280 | u8 otg_port; /* 0, or number of OTG/HNP port */ |
| 272 | unsigned is_b_host:1; /* true during some HNP roleswitches */ | 281 | unsigned is_b_host:1; /* true during some HNP roleswitches */ |
| 273 | unsigned b_hnp_enable:1; /* OTG: did A-Host enable HNP? */ | 282 | unsigned b_hnp_enable:1; /* OTG: did A-Host enable HNP? */ |
| @@ -276,10 +285,8 @@ struct usb_bus { | |||
| 276 | * round-robin allocation */ | 285 | * round-robin allocation */ |
| 277 | 286 | ||
| 278 | struct usb_devmap devmap; /* device address allocation map */ | 287 | struct usb_devmap devmap; /* device address allocation map */ |
| 279 | struct usb_operations *op; /* Operations (specific to the HC) */ | ||
| 280 | struct usb_device *root_hub; /* Root hub */ | 288 | struct usb_device *root_hub; /* Root hub */ |
| 281 | struct list_head bus_list; /* list of busses */ | 289 | struct list_head bus_list; /* list of busses */ |
| 282 | void *hcpriv; /* Host Controller private data */ | ||
| 283 | 290 | ||
| 284 | int bandwidth_allocated; /* on this bus: how much of the time | 291 | int bandwidth_allocated; /* on this bus: how much of the time |
| 285 | * reserved for periodic (intr/iso) | 292 | * reserved for periodic (intr/iso) |
| @@ -294,8 +301,6 @@ struct usb_bus { | |||
| 294 | struct dentry *usbfs_dentry; /* usbfs dentry entry for the bus */ | 301 | struct dentry *usbfs_dentry; /* usbfs dentry entry for the bus */ |
| 295 | 302 | ||
| 296 | struct class_device *class_dev; /* class device for this bus */ | 303 | struct class_device *class_dev; /* class device for this bus */ |
| 297 | struct kref kref; /* reference counting for this bus */ | ||
| 298 | void (*release)(struct usb_bus *bus); | ||
| 299 | 304 | ||
| 300 | #if defined(CONFIG_USB_MON) | 305 | #if defined(CONFIG_USB_MON) |
| 301 | struct mon_bus *mon_bus; /* non-null when associated */ | 306 | struct mon_bus *mon_bus; /* non-null when associated */ |
| @@ -350,6 +355,7 @@ struct usb_device { | |||
| 350 | 355 | ||
| 351 | unsigned short bus_mA; /* Current available from the bus */ | 356 | unsigned short bus_mA; /* Current available from the bus */ |
| 352 | u8 portnum; /* Parent port number (origin 1) */ | 357 | u8 portnum; /* Parent port number (origin 1) */ |
| 358 | u8 level; /* Number of USB hub ancestors */ | ||
| 353 | 359 | ||
| 354 | int have_langid; /* whether string_langid is valid */ | 360 | int have_langid; /* whether string_langid is valid */ |
| 355 | int string_langid; /* language ID for strings */ | 361 | int string_langid; /* language ID for strings */ |
| @@ -373,6 +379,15 @@ struct usb_device { | |||
| 373 | 379 | ||
| 374 | int maxchild; /* Number of ports if hub */ | 380 | int maxchild; /* Number of ports if hub */ |
| 375 | struct usb_device *children[USB_MAXCHILDREN]; | 381 | struct usb_device *children[USB_MAXCHILDREN]; |
| 382 | |||
| 383 | int pm_usage_cnt; /* usage counter for autosuspend */ | ||
| 384 | #ifdef CONFIG_PM | ||
| 385 | struct work_struct autosuspend; /* for delayed autosuspends */ | ||
| 386 | struct mutex pm_mutex; /* protects PM operations */ | ||
| 387 | |||
| 388 | unsigned auto_pm:1; /* autosuspend/resume in progress */ | ||
| 389 | unsigned do_remote_wakeup:1; /* remote wakeup should be enabled */ | ||
| 390 | #endif | ||
| 376 | }; | 391 | }; |
| 377 | #define to_usb_device(d) container_of(d, struct usb_device, dev) | 392 | #define to_usb_device(d) container_of(d, struct usb_device, dev) |
| 378 | 393 | ||
| @@ -384,7 +399,7 @@ extern void usb_put_dev(struct usb_device *dev); | |||
| 384 | #define usb_unlock_device(udev) up(&(udev)->dev.sem) | 399 | #define usb_unlock_device(udev) up(&(udev)->dev.sem) |
| 385 | #define usb_trylock_device(udev) down_trylock(&(udev)->dev.sem) | 400 | #define usb_trylock_device(udev) down_trylock(&(udev)->dev.sem) |
| 386 | extern int usb_lock_device_for_reset(struct usb_device *udev, | 401 | extern int usb_lock_device_for_reset(struct usb_device *udev, |
| 387 | struct usb_interface *iface); | 402 | const struct usb_interface *iface); |
| 388 | 403 | ||
| 389 | /* USB port reset for device reinitialization */ | 404 | /* USB port reset for device reinitialization */ |
| 390 | extern int usb_reset_device(struct usb_device *dev); | 405 | extern int usb_reset_device(struct usb_device *dev); |
| @@ -393,6 +408,17 @@ extern int usb_reset_composite_device(struct usb_device *dev, | |||
| 393 | 408 | ||
| 394 | extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id); | 409 | extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id); |
| 395 | 410 | ||
| 411 | /* USB autosuspend and autoresume */ | ||
| 412 | #ifdef CONFIG_USB_SUSPEND | ||
| 413 | extern int usb_autopm_get_interface(struct usb_interface *intf); | ||
| 414 | extern void usb_autopm_put_interface(struct usb_interface *intf); | ||
| 415 | |||
| 416 | #else | ||
| 417 | #define usb_autopm_get_interface(intf) 0 | ||
| 418 | #define usb_autopm_put_interface(intf) do {} while (0) | ||
| 419 | #endif | ||
| 420 | |||
| 421 | |||
| 396 | /*-------------------------------------------------------------------------*/ | 422 | /*-------------------------------------------------------------------------*/ |
| 397 | 423 | ||
| 398 | /* for drivers using iso endpoints */ | 424 | /* for drivers using iso endpoints */ |
| @@ -423,10 +449,10 @@ const struct usb_device_id *usb_match_id(struct usb_interface *interface, | |||
| 423 | 449 | ||
| 424 | extern struct usb_interface *usb_find_interface(struct usb_driver *drv, | 450 | extern struct usb_interface *usb_find_interface(struct usb_driver *drv, |
| 425 | int minor); | 451 | int minor); |
| 426 | extern struct usb_interface *usb_ifnum_to_if(struct usb_device *dev, | 452 | extern struct usb_interface *usb_ifnum_to_if(const struct usb_device *dev, |
| 427 | unsigned ifnum); | 453 | unsigned ifnum); |
| 428 | extern struct usb_host_interface *usb_altnum_to_altsetting( | 454 | extern struct usb_host_interface *usb_altnum_to_altsetting( |
| 429 | struct usb_interface *intf, unsigned int altnum); | 455 | const struct usb_interface *intf, unsigned int altnum); |
| 430 | 456 | ||
| 431 | 457 | ||
| 432 | /** | 458 | /** |
| @@ -464,6 +490,20 @@ static inline int usb_make_path (struct usb_device *dev, char *buf, | |||
| 464 | 490 | ||
| 465 | /*-------------------------------------------------------------------------*/ | 491 | /*-------------------------------------------------------------------------*/ |
| 466 | 492 | ||
| 493 | extern int usb_endpoint_dir_in(const struct usb_endpoint_descriptor *epd); | ||
| 494 | extern int usb_endpoint_dir_out(const struct usb_endpoint_descriptor *epd); | ||
| 495 | extern int usb_endpoint_xfer_bulk(const struct usb_endpoint_descriptor *epd); | ||
| 496 | extern int usb_endpoint_xfer_int(const struct usb_endpoint_descriptor *epd); | ||
| 497 | extern int usb_endpoint_xfer_isoc(const struct usb_endpoint_descriptor *epd); | ||
| 498 | extern int usb_endpoint_is_bulk_in(const struct usb_endpoint_descriptor *epd); | ||
| 499 | extern int usb_endpoint_is_bulk_out(const struct usb_endpoint_descriptor *epd); | ||
| 500 | extern int usb_endpoint_is_int_in(const struct usb_endpoint_descriptor *epd); | ||
| 501 | extern int usb_endpoint_is_int_out(const struct usb_endpoint_descriptor *epd); | ||
| 502 | extern int usb_endpoint_is_isoc_in(const struct usb_endpoint_descriptor *epd); | ||
| 503 | extern int usb_endpoint_is_isoc_out(const struct usb_endpoint_descriptor *epd); | ||
| 504 | |||
| 505 | /*-------------------------------------------------------------------------*/ | ||
| 506 | |||
| 467 | #define USB_DEVICE_ID_MATCH_DEVICE \ | 507 | #define USB_DEVICE_ID_MATCH_DEVICE \ |
| 468 | (USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_PRODUCT) | 508 | (USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_PRODUCT) |
| 469 | #define USB_DEVICE_ID_MATCH_DEV_RANGE \ | 509 | #define USB_DEVICE_ID_MATCH_DEV_RANGE \ |
| @@ -540,7 +580,17 @@ struct usb_dynids { | |||
| 540 | }; | 580 | }; |
| 541 | 581 | ||
| 542 | /** | 582 | /** |
| 543 | * struct usb_driver - identifies USB driver to usbcore | 583 | * struct usbdrv_wrap - wrapper for driver-model structure |
| 584 | * @driver: The driver-model core driver structure. | ||
| 585 | * @for_devices: Non-zero for device drivers, 0 for interface drivers. | ||
| 586 | */ | ||
| 587 | struct usbdrv_wrap { | ||
| 588 | struct device_driver driver; | ||
| 589 | int for_devices; | ||
| 590 | }; | ||
| 591 | |||
| 592 | /** | ||
| 593 | * struct usb_driver - identifies USB interface driver to usbcore | ||
| 544 | * @name: The driver name should be unique among USB drivers, | 594 | * @name: The driver name should be unique among USB drivers, |
| 545 | * and should normally be the same as the module name. | 595 | * and should normally be the same as the module name. |
| 546 | * @probe: Called to see if the driver is willing to manage a particular | 596 | * @probe: Called to see if the driver is willing to manage a particular |
| @@ -567,12 +617,14 @@ struct usb_dynids { | |||
| 567 | * or your driver's probe function will never get called. | 617 | * or your driver's probe function will never get called. |
| 568 | * @dynids: used internally to hold the list of dynamically added device | 618 | * @dynids: used internally to hold the list of dynamically added device |
| 569 | * ids for this driver. | 619 | * ids for this driver. |
| 570 | * @driver: the driver model core driver structure. | 620 | * @drvwrap: Driver-model core structure wrapper. |
| 571 | * @no_dynamic_id: if set to 1, the USB core will not allow dynamic ids to be | 621 | * @no_dynamic_id: if set to 1, the USB core will not allow dynamic ids to be |
| 572 | * added to this driver by preventing the sysfs file from being created. | 622 | * added to this driver by preventing the sysfs file from being created. |
| 623 | * @supports_autosuspend: if set to 0, the USB core will not allow autosuspend | ||
| 624 | * for interfaces bound to this driver. | ||
| 573 | * | 625 | * |
| 574 | * USB drivers must provide a name, probe() and disconnect() methods, | 626 | * USB interface drivers must provide a name, probe() and disconnect() |
| 575 | * and an id_table. Other driver fields are optional. | 627 | * methods, and an id_table. Other driver fields are optional. |
| 576 | * | 628 | * |
| 577 | * The id_table is used in hotplugging. It holds a set of descriptors, | 629 | * The id_table is used in hotplugging. It holds a set of descriptors, |
| 578 | * and specialized data may be associated with each entry. That table | 630 | * and specialized data may be associated with each entry. That table |
| @@ -606,10 +658,44 @@ struct usb_driver { | |||
| 606 | const struct usb_device_id *id_table; | 658 | const struct usb_device_id *id_table; |
| 607 | 659 | ||
| 608 | struct usb_dynids dynids; | 660 | struct usb_dynids dynids; |
| 609 | struct device_driver driver; | 661 | struct usbdrv_wrap drvwrap; |
| 610 | unsigned int no_dynamic_id:1; | 662 | unsigned int no_dynamic_id:1; |
| 663 | unsigned int supports_autosuspend:1; | ||
| 611 | }; | 664 | }; |
| 612 | #define to_usb_driver(d) container_of(d, struct usb_driver, driver) | 665 | #define to_usb_driver(d) container_of(d, struct usb_driver, drvwrap.driver) |
| 666 | |||
| 667 | /** | ||
| 668 | * struct usb_device_driver - identifies USB device driver to usbcore | ||
| 669 | * @name: The driver name should be unique among USB drivers, | ||
| 670 | * and should normally be the same as the module name. | ||
| 671 | * @probe: Called to see if the driver is willing to manage a particular | ||
| 672 | * device. If it is, probe returns zero and uses dev_set_drvdata() | ||
| 673 | * to associate driver-specific data with the device. If unwilling | ||
| 674 | * to manage the device, return a negative errno value. | ||
| 675 | * @disconnect: Called when the device is no longer accessible, usually | ||
| 676 | * because it has been (or is being) disconnected or the driver's | ||
| 677 | * module is being unloaded. | ||
| 678 | * @suspend: Called when the device is going to be suspended by the system. | ||
| 679 | * @resume: Called when the device is being resumed by the system. | ||
| 680 | * @drvwrap: Driver-model core structure wrapper. | ||
| 681 | * @supports_autosuspend: if set to 0, the USB core will not allow autosuspend | ||
| 682 | * for devices bound to this driver. | ||
| 683 | * | ||
| 684 | * USB drivers must provide all the fields listed above except drvwrap. | ||
| 685 | */ | ||
| 686 | struct usb_device_driver { | ||
| 687 | const char *name; | ||
| 688 | |||
| 689 | int (*probe) (struct usb_device *udev); | ||
| 690 | void (*disconnect) (struct usb_device *udev); | ||
| 691 | |||
| 692 | int (*suspend) (struct usb_device *udev, pm_message_t message); | ||
| 693 | int (*resume) (struct usb_device *udev); | ||
| 694 | struct usbdrv_wrap drvwrap; | ||
| 695 | unsigned int supports_autosuspend:1; | ||
| 696 | }; | ||
| 697 | #define to_usb_device_driver(d) container_of(d, struct usb_device_driver, \ | ||
| 698 | drvwrap.driver) | ||
| 613 | 699 | ||
| 614 | extern struct bus_type usb_bus_type; | 700 | extern struct bus_type usb_bus_type; |
| 615 | 701 | ||
| @@ -633,13 +719,17 @@ struct usb_class_driver { | |||
| 633 | * use these in module_init()/module_exit() | 719 | * use these in module_init()/module_exit() |
| 634 | * and don't forget MODULE_DEVICE_TABLE(usb, ...) | 720 | * and don't forget MODULE_DEVICE_TABLE(usb, ...) |
| 635 | */ | 721 | */ |
| 636 | int usb_register_driver(struct usb_driver *, struct module *); | 722 | extern int usb_register_driver(struct usb_driver *, struct module *); |
| 637 | static inline int usb_register(struct usb_driver *driver) | 723 | static inline int usb_register(struct usb_driver *driver) |
| 638 | { | 724 | { |
| 639 | return usb_register_driver(driver, THIS_MODULE); | 725 | return usb_register_driver(driver, THIS_MODULE); |
| 640 | } | 726 | } |
| 641 | extern void usb_deregister(struct usb_driver *); | 727 | extern void usb_deregister(struct usb_driver *); |
| 642 | 728 | ||
| 729 | extern int usb_register_device_driver(struct usb_device_driver *, | ||
| 730 | struct module *); | ||
| 731 | extern void usb_deregister_device_driver(struct usb_device_driver *); | ||
| 732 | |||
| 643 | extern int usb_register_dev(struct usb_interface *intf, | 733 | extern int usb_register_dev(struct usb_interface *intf, |
| 644 | struct usb_class_driver *class_driver); | 734 | struct usb_class_driver *class_driver); |
| 645 | extern void usb_deregister_dev(struct usb_interface *intf, | 735 | extern void usb_deregister_dev(struct usb_interface *intf, |
| @@ -885,7 +975,7 @@ struct urb | |||
| 885 | * @setup_packet: pointer to the setup_packet buffer | 975 | * @setup_packet: pointer to the setup_packet buffer |
| 886 | * @transfer_buffer: pointer to the transfer buffer | 976 | * @transfer_buffer: pointer to the transfer buffer |
| 887 | * @buffer_length: length of the transfer buffer | 977 | * @buffer_length: length of the transfer buffer |
| 888 | * @complete: pointer to the usb_complete_t function | 978 | * @complete_fn: pointer to the usb_complete_t function |
| 889 | * @context: what to set the urb context to. | 979 | * @context: what to set the urb context to. |
| 890 | * | 980 | * |
| 891 | * Initializes a control urb with the proper information needed to submit | 981 | * Initializes a control urb with the proper information needed to submit |
| @@ -897,7 +987,7 @@ static inline void usb_fill_control_urb (struct urb *urb, | |||
| 897 | unsigned char *setup_packet, | 987 | unsigned char *setup_packet, |
| 898 | void *transfer_buffer, | 988 | void *transfer_buffer, |
| 899 | int buffer_length, | 989 | int buffer_length, |
| 900 | usb_complete_t complete, | 990 | usb_complete_t complete_fn, |
| 901 | void *context) | 991 | void *context) |
| 902 | { | 992 | { |
| 903 | spin_lock_init(&urb->lock); | 993 | spin_lock_init(&urb->lock); |
| @@ -906,7 +996,7 @@ static inline void usb_fill_control_urb (struct urb *urb, | |||
| 906 | urb->setup_packet = setup_packet; | 996 | urb->setup_packet = setup_packet; |
| 907 | urb->transfer_buffer = transfer_buffer; | 997 | urb->transfer_buffer = transfer_buffer; |
| 908 | urb->transfer_buffer_length = buffer_length; | 998 | urb->transfer_buffer_length = buffer_length; |
| 909 | urb->complete = complete; | 999 | urb->complete = complete_fn; |
| 910 | urb->context = context; | 1000 | urb->context = context; |
| 911 | } | 1001 | } |
| 912 | 1002 | ||
| @@ -917,7 +1007,7 @@ static inline void usb_fill_control_urb (struct urb *urb, | |||
| 917 | * @pipe: the endpoint pipe | 1007 | * @pipe: the endpoint pipe |
| 918 | * @transfer_buffer: pointer to the transfer buffer | 1008 | * @transfer_buffer: pointer to the transfer buffer |
| 919 | * @buffer_length: length of the transfer buffer | 1009 | * @buffer_length: length of the transfer buffer |
| 920 | * @complete: pointer to the usb_complete_t function | 1010 | * @complete_fn: pointer to the usb_complete_t function |
| 921 | * @context: what to set the urb context to. | 1011 | * @context: what to set the urb context to. |
| 922 | * | 1012 | * |
| 923 | * Initializes a bulk urb with the proper information needed to submit it | 1013 | * Initializes a bulk urb with the proper information needed to submit it |
| @@ -928,7 +1018,7 @@ static inline void usb_fill_bulk_urb (struct urb *urb, | |||
| 928 | unsigned int pipe, | 1018 | unsigned int pipe, |
| 929 | void *transfer_buffer, | 1019 | void *transfer_buffer, |
| 930 | int buffer_length, | 1020 | int buffer_length, |
| 931 | usb_complete_t complete, | 1021 | usb_complete_t complete_fn, |
| 932 | void *context) | 1022 | void *context) |
| 933 | { | 1023 | { |
| 934 | spin_lock_init(&urb->lock); | 1024 | spin_lock_init(&urb->lock); |
| @@ -936,7 +1026,7 @@ static inline void usb_fill_bulk_urb (struct urb *urb, | |||
| 936 | urb->pipe = pipe; | 1026 | urb->pipe = pipe; |
| 937 | urb->transfer_buffer = transfer_buffer; | 1027 | urb->transfer_buffer = transfer_buffer; |
| 938 | urb->transfer_buffer_length = buffer_length; | 1028 | urb->transfer_buffer_length = buffer_length; |
| 939 | urb->complete = complete; | 1029 | urb->complete = complete_fn; |
| 940 | urb->context = context; | 1030 | urb->context = context; |
| 941 | } | 1031 | } |
| 942 | 1032 | ||
| @@ -947,7 +1037,7 @@ static inline void usb_fill_bulk_urb (struct urb *urb, | |||
| 947 | * @pipe: the endpoint pipe | 1037 | * @pipe: the endpoint pipe |
| 948 | * @transfer_buffer: pointer to the transfer buffer | 1038 | * @transfer_buffer: pointer to the transfer buffer |
| 949 | * @buffer_length: length of the transfer buffer | 1039 | * @buffer_length: length of the transfer buffer |
| 950 | * @complete: pointer to the usb_complete_t function | 1040 | * @complete_fn: pointer to the usb_complete_t function |
| 951 | * @context: what to set the urb context to. | 1041 | * @context: what to set the urb context to. |
| 952 | * @interval: what to set the urb interval to, encoded like | 1042 | * @interval: what to set the urb interval to, encoded like |
| 953 | * the endpoint descriptor's bInterval value. | 1043 | * the endpoint descriptor's bInterval value. |
| @@ -963,7 +1053,7 @@ static inline void usb_fill_int_urb (struct urb *urb, | |||
| 963 | unsigned int pipe, | 1053 | unsigned int pipe, |
| 964 | void *transfer_buffer, | 1054 | void *transfer_buffer, |
| 965 | int buffer_length, | 1055 | int buffer_length, |
| 966 | usb_complete_t complete, | 1056 | usb_complete_t complete_fn, |
| 967 | void *context, | 1057 | void *context, |
| 968 | int interval) | 1058 | int interval) |
| 969 | { | 1059 | { |
| @@ -972,7 +1062,7 @@ static inline void usb_fill_int_urb (struct urb *urb, | |||
| 972 | urb->pipe = pipe; | 1062 | urb->pipe = pipe; |
| 973 | urb->transfer_buffer = transfer_buffer; | 1063 | urb->transfer_buffer = transfer_buffer; |
| 974 | urb->transfer_buffer_length = buffer_length; | 1064 | urb->transfer_buffer_length = buffer_length; |
| 975 | urb->complete = complete; | 1065 | urb->complete = complete_fn; |
| 976 | urb->context = context; | 1066 | urb->context = context; |
| 977 | if (dev->speed == USB_SPEED_HIGH) | 1067 | if (dev->speed == USB_SPEED_HIGH) |
| 978 | urb->interval = 1 << (interval - 1); | 1068 | urb->interval = 1 << (interval - 1); |
| @@ -990,7 +1080,6 @@ extern int usb_submit_urb(struct urb *urb, gfp_t mem_flags); | |||
| 990 | extern int usb_unlink_urb(struct urb *urb); | 1080 | extern int usb_unlink_urb(struct urb *urb); |
| 991 | extern void usb_kill_urb(struct urb *urb); | 1081 | extern void usb_kill_urb(struct urb *urb); |
| 992 | 1082 | ||
| 993 | #define HAVE_USB_BUFFERS | ||
| 994 | void *usb_buffer_alloc (struct usb_device *dev, size_t size, | 1083 | void *usb_buffer_alloc (struct usb_device *dev, size_t size, |
| 995 | gfp_t mem_flags, dma_addr_t *dma); | 1084 | gfp_t mem_flags, dma_addr_t *dma); |
| 996 | void usb_buffer_free (struct usb_device *dev, size_t size, | 1085 | void usb_buffer_free (struct usb_device *dev, size_t size, |
| @@ -1003,14 +1092,14 @@ void usb_buffer_unmap (struct urb *urb); | |||
| 1003 | #endif | 1092 | #endif |
| 1004 | 1093 | ||
| 1005 | struct scatterlist; | 1094 | struct scatterlist; |
| 1006 | int usb_buffer_map_sg (struct usb_device *dev, unsigned pipe, | 1095 | int usb_buffer_map_sg(const struct usb_device *dev, unsigned pipe, |
| 1007 | struct scatterlist *sg, int nents); | 1096 | struct scatterlist *sg, int nents); |
| 1008 | #if 0 | 1097 | #if 0 |
| 1009 | void usb_buffer_dmasync_sg (struct usb_device *dev, unsigned pipe, | 1098 | void usb_buffer_dmasync_sg(const struct usb_device *dev, unsigned pipe, |
| 1010 | struct scatterlist *sg, int n_hw_ents); | 1099 | struct scatterlist *sg, int n_hw_ents); |
| 1011 | #endif | 1100 | #endif |
| 1012 | void usb_buffer_unmap_sg (struct usb_device *dev, unsigned pipe, | 1101 | void usb_buffer_unmap_sg(const struct usb_device *dev, unsigned pipe, |
| 1013 | struct scatterlist *sg, int n_hw_ents); | 1102 | struct scatterlist *sg, int n_hw_ents); |
| 1014 | 1103 | ||
| 1015 | /*-------------------------------------------------------------------* | 1104 | /*-------------------------------------------------------------------* |
| 1016 | * SYNCHRONOUS CALL SUPPORT * | 1105 | * SYNCHRONOUS CALL SUPPORT * |
| @@ -1038,6 +1127,9 @@ extern int usb_clear_halt(struct usb_device *dev, int pipe); | |||
| 1038 | extern int usb_reset_configuration(struct usb_device *dev); | 1127 | extern int usb_reset_configuration(struct usb_device *dev); |
| 1039 | extern int usb_set_interface(struct usb_device *dev, int ifnum, int alternate); | 1128 | extern int usb_set_interface(struct usb_device *dev, int ifnum, int alternate); |
| 1040 | 1129 | ||
| 1130 | /* this request isn't really synchronous, but it belongs with the others */ | ||
| 1131 | extern int usb_driver_set_configuration(struct usb_device *udev, int config); | ||
| 1132 | |||
| 1041 | /* | 1133 | /* |
| 1042 | * timeouts, in milliseconds, used for sending/receiving control messages | 1134 | * timeouts, in milliseconds, used for sending/receiving control messages |
| 1043 | * they typically complete within a few frames (msec) after they're issued | 1135 | * they typically complete within a few frames (msec) after they're issued |
diff --git a/include/linux/usb/audio.h b/include/linux/usb/audio.h new file mode 100644 index 0000000000..6bd235994d --- /dev/null +++ b/include/linux/usb/audio.h | |||
| @@ -0,0 +1,53 @@ | |||
| 1 | /* | ||
| 2 | * <linux/usb/audio.h> -- USB Audio definitions. | ||
| 3 | * | ||
| 4 | * Copyright (C) 2006 Thumtronics Pty Ltd. | ||
| 5 | * Developed for Thumtronics by Grey Innovation | ||
| 6 | * Ben Williamson <ben.williamson@greyinnovation.com> | ||
| 7 | * | ||
| 8 | * This software is distributed under the terms of the GNU General Public | ||
| 9 | * License ("GPL") version 2, as published by the Free Software Foundation. | ||
| 10 | * | ||
| 11 | * This file holds USB constants and structures defined | ||
| 12 | * by the USB Device Class Definition for Audio Devices. | ||
| 13 | * Comments below reference relevant sections of that document: | ||
| 14 | * | ||
| 15 | * http://www.usb.org/developers/devclass_docs/audio10.pdf | ||
| 16 | */ | ||
| 17 | |||
| 18 | #ifndef __LINUX_USB_AUDIO_H | ||
| 19 | #define __LINUX_USB_AUDIO_H | ||
| 20 | |||
| 21 | #include <linux/types.h> | ||
| 22 | |||
| 23 | /* A.2 Audio Interface Subclass Codes */ | ||
| 24 | #define USB_SUBCLASS_AUDIOCONTROL 0x01 | ||
| 25 | #define USB_SUBCLASS_AUDIOSTREAMING 0x02 | ||
| 26 | #define USB_SUBCLASS_MIDISTREAMING 0x03 | ||
| 27 | |||
| 28 | /* 4.3.2 Class-Specific AC Interface Descriptor */ | ||
| 29 | struct usb_ac_header_descriptor { | ||
| 30 | __u8 bLength; // 8+n | ||
| 31 | __u8 bDescriptorType; // USB_DT_CS_INTERFACE | ||
| 32 | __u8 bDescriptorSubtype; // USB_MS_HEADER | ||
| 33 | __le16 bcdADC; // 0x0100 | ||
| 34 | __le16 wTotalLength; // includes Unit and Terminal desc. | ||
| 35 | __u8 bInCollection; // n | ||
| 36 | __u8 baInterfaceNr[]; // [n] | ||
| 37 | } __attribute__ ((packed)); | ||
| 38 | |||
| 39 | #define USB_DT_AC_HEADER_SIZE(n) (8+(n)) | ||
| 40 | |||
| 41 | /* As above, but more useful for defining your own descriptors: */ | ||
| 42 | #define DECLARE_USB_AC_HEADER_DESCRIPTOR(n) \ | ||
| 43 | struct usb_ac_header_descriptor_##n { \ | ||
| 44 | __u8 bLength; \ | ||
| 45 | __u8 bDescriptorType; \ | ||
| 46 | __u8 bDescriptorSubtype; \ | ||
| 47 | __le16 bcdADC; \ | ||
| 48 | __le16 wTotalLength; \ | ||
| 49 | __u8 bInCollection; \ | ||
| 50 | __u8 baInterfaceNr[n]; \ | ||
| 51 | } __attribute__ ((packed)) | ||
| 52 | |||
| 53 | #endif | ||
diff --git a/include/linux/usb/midi.h b/include/linux/usb/midi.h new file mode 100644 index 0000000000..11a97d5ffd --- /dev/null +++ b/include/linux/usb/midi.h | |||
| @@ -0,0 +1,112 @@ | |||
| 1 | /* | ||
| 2 | * <linux/usb/midi.h> -- USB MIDI definitions. | ||
| 3 | * | ||
| 4 | * Copyright (C) 2006 Thumtronics Pty Ltd. | ||
| 5 | * Developed for Thumtronics by Grey Innovation | ||
| 6 | * Ben Williamson <ben.williamson@greyinnovation.com> | ||
| 7 | * | ||
| 8 | * This software is distributed under the terms of the GNU General Public | ||
| 9 | * License ("GPL") version 2, as published by the Free Software Foundation. | ||
| 10 | * | ||
| 11 | * This file holds USB constants and structures defined | ||
| 12 | * by the USB Device Class Definition for MIDI Devices. | ||
| 13 | * Comments below reference relevant sections of that document: | ||
| 14 | * | ||
| 15 | * http://www.usb.org/developers/devclass_docs/midi10.pdf | ||
| 16 | */ | ||
| 17 | |||
| 18 | #ifndef __LINUX_USB_MIDI_H | ||
| 19 | #define __LINUX_USB_MIDI_H | ||
| 20 | |||
| 21 | #include <linux/types.h> | ||
| 22 | |||
| 23 | /* A.1 MS Class-Specific Interface Descriptor Subtypes */ | ||
| 24 | #define USB_MS_HEADER 0x01 | ||
| 25 | #define USB_MS_MIDI_IN_JACK 0x02 | ||
| 26 | #define USB_MS_MIDI_OUT_JACK 0x03 | ||
| 27 | #define USB_MS_ELEMENT 0x04 | ||
| 28 | |||
| 29 | /* A.2 MS Class-Specific Endpoint Descriptor Subtypes */ | ||
| 30 | #define USB_MS_GENERAL 0x01 | ||
| 31 | |||
| 32 | /* A.3 MS MIDI IN and OUT Jack Types */ | ||
| 33 | #define USB_MS_EMBEDDED 0x01 | ||
| 34 | #define USB_MS_EXTERNAL 0x02 | ||
| 35 | |||
| 36 | /* 6.1.2.1 Class-Specific MS Interface Header Descriptor */ | ||
| 37 | struct usb_ms_header_descriptor { | ||
| 38 | __u8 bLength; | ||
| 39 | __u8 bDescriptorType; | ||
| 40 | __u8 bDescriptorSubtype; | ||
| 41 | __le16 bcdMSC; | ||
| 42 | __le16 wTotalLength; | ||
| 43 | } __attribute__ ((packed)); | ||
| 44 | |||
| 45 | #define USB_DT_MS_HEADER_SIZE 7 | ||
| 46 | |||
| 47 | /* 6.1.2.2 MIDI IN Jack Descriptor */ | ||
| 48 | struct usb_midi_in_jack_descriptor { | ||
| 49 | __u8 bLength; | ||
| 50 | __u8 bDescriptorType; // USB_DT_CS_INTERFACE | ||
| 51 | __u8 bDescriptorSubtype; // USB_MS_MIDI_IN_JACK | ||
| 52 | __u8 bJackType; // USB_MS_EMBEDDED/EXTERNAL | ||
| 53 | __u8 bJackID; | ||
| 54 | __u8 iJack; | ||
| 55 | } __attribute__ ((packed)); | ||
| 56 | |||
| 57 | #define USB_DT_MIDI_IN_SIZE 6 | ||
| 58 | |||
| 59 | struct usb_midi_source_pin { | ||
| 60 | __u8 baSourceID; | ||
| 61 | __u8 baSourcePin; | ||
| 62 | } __attribute__ ((packed)); | ||
| 63 | |||
| 64 | /* 6.1.2.3 MIDI OUT Jack Descriptor */ | ||
| 65 | struct usb_midi_out_jack_descriptor { | ||
| 66 | __u8 bLength; | ||
| 67 | __u8 bDescriptorType; // USB_DT_CS_INTERFACE | ||
| 68 | __u8 bDescriptorSubtype; // USB_MS_MIDI_OUT_JACK | ||
| 69 | __u8 bJackType; // USB_MS_EMBEDDED/EXTERNAL | ||
| 70 | __u8 bJackID; | ||
| 71 | __u8 bNrInputPins; // p | ||
| 72 | struct usb_midi_source_pin pins[]; // [p] | ||
| 73 | /*__u8 iJack; -- ommitted due to variable-sized pins[] */ | ||
| 74 | } __attribute__ ((packed)); | ||
| 75 | |||
| 76 | #define USB_DT_MIDI_OUT_SIZE(p) (7 + 2 * (p)) | ||
| 77 | |||
| 78 | /* As above, but more useful for defining your own descriptors: */ | ||
| 79 | #define DECLARE_USB_MIDI_OUT_JACK_DESCRIPTOR(p) \ | ||
| 80 | struct usb_midi_out_jack_descriptor_##p { \ | ||
| 81 | __u8 bLength; \ | ||
| 82 | __u8 bDescriptorType; \ | ||
| 83 | __u8 bDescriptorSubtype; \ | ||
| 84 | __u8 bJackType; \ | ||
| 85 | __u8 bJackID; \ | ||
| 86 | __u8 bNrInputPins; \ | ||
| 87 | struct usb_midi_source_pin pins[p]; \ | ||
| 88 | __u8 iJack; \ | ||
| 89 | } __attribute__ ((packed)) | ||
| 90 | |||
| 91 | /* 6.2.2 Class-Specific MS Bulk Data Endpoint Descriptor */ | ||
| 92 | struct usb_ms_endpoint_descriptor { | ||
| 93 | __u8 bLength; // 4+n | ||
| 94 | __u8 bDescriptorType; // USB_DT_CS_ENDPOINT | ||
| 95 | __u8 bDescriptorSubtype; // USB_MS_GENERAL | ||
| 96 | __u8 bNumEmbMIDIJack; // n | ||
| 97 | __u8 baAssocJackID[]; // [n] | ||
| 98 | } __attribute__ ((packed)); | ||
| 99 | |||
| 100 | #define USB_DT_MS_ENDPOINT_SIZE(n) (4 + (n)) | ||
| 101 | |||
| 102 | /* As above, but more useful for defining your own descriptors: */ | ||
| 103 | #define DECLARE_USB_MS_ENDPOINT_DESCRIPTOR(n) \ | ||
| 104 | struct usb_ms_endpoint_descriptor_##n { \ | ||
| 105 | __u8 bLength; \ | ||
| 106 | __u8 bDescriptorType; \ | ||
| 107 | __u8 bDescriptorSubtype; \ | ||
| 108 | __u8 bNumEmbMIDIJack; \ | ||
| 109 | __u8 baAssocJackID[n]; \ | ||
| 110 | } __attribute__ ((packed)) | ||
| 111 | |||
| 112 | #endif | ||
diff --git a/include/linux/usb_otg.h b/include/linux/usb/otg.h index f827f6e203..9897f7a818 100644 --- a/include/linux/usb_otg.h +++ b/include/linux/usb/otg.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | // include/linux/usb_otg.h | 1 | // include/linux/usb/otg.h |
| 2 | 2 | ||
| 3 | /* | 3 | /* |
| 4 | * These APIs may be used between USB controllers. USB device drivers | 4 | * These APIs may be used between USB controllers. USB device drivers |
| @@ -52,7 +52,7 @@ struct otg_transceiver { | |||
| 52 | u16 port_change; | 52 | u16 port_change; |
| 53 | 53 | ||
| 54 | /* bind/unbind the host controller */ | 54 | /* bind/unbind the host controller */ |
| 55 | int (*set_host)(struct otg_transceiver *otg, | 55 | int (*set_host)(struct otg_transceiver *otg, |
| 56 | struct usb_bus *host); | 56 | struct usb_bus *host); |
| 57 | 57 | ||
| 58 | /* bind/unbind the peripheral controller */ | 58 | /* bind/unbind the peripheral controller */ |
diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h index e7fc5fed5b..2ae76fe52f 100644 --- a/include/linux/usb_usual.h +++ b/include/linux/usb_usual.h | |||
| @@ -108,6 +108,9 @@ enum { US_DO_ALL_FLAGS }; | |||
| 108 | #ifdef CONFIG_USB_STORAGE_ALAUDA | 108 | #ifdef CONFIG_USB_STORAGE_ALAUDA |
| 109 | #define US_PR_ALAUDA 0xf4 /* Alauda chipsets */ | 109 | #define US_PR_ALAUDA 0xf4 /* Alauda chipsets */ |
| 110 | #endif | 110 | #endif |
| 111 | #ifdef CONFIG_USB_STORAGE_KARMA | ||
| 112 | #define US_PR_KARMA 0xf5 /* Rio Karma */ | ||
| 113 | #endif | ||
| 111 | 114 | ||
| 112 | #define US_PR_DEVICE 0xff /* Use device's value */ | 115 | #define US_PR_DEVICE 0xff /* Use device's value */ |
| 113 | 116 | ||
diff --git a/include/linux/usbdevice_fs.h b/include/linux/usbdevice_fs.h index 7b7aadb690..617d8a1c59 100644 --- a/include/linux/usbdevice_fs.h +++ b/include/linux/usbdevice_fs.h | |||
| @@ -32,11 +32,10 @@ | |||
| 32 | #define _LINUX_USBDEVICE_FS_H | 32 | #define _LINUX_USBDEVICE_FS_H |
| 33 | 33 | ||
| 34 | #include <linux/types.h> | 34 | #include <linux/types.h> |
| 35 | #include <linux/magic.h> | ||
| 35 | 36 | ||
| 36 | /* --------------------------------------------------------------------- */ | 37 | /* --------------------------------------------------------------------- */ |
| 37 | 38 | ||
| 38 | #define USBDEVICE_SUPER_MAGIC 0x9fa2 | ||
| 39 | |||
| 40 | /* usbdevfs ioctl codes */ | 39 | /* usbdevfs ioctl codes */ |
| 41 | 40 | ||
| 42 | struct usbdevfs_ctrltransfer { | 41 | struct usbdevfs_ctrltransfer { |
diff --git a/include/linux/utime.h b/include/linux/utime.h index c6bf27b789..640be6a195 100644 --- a/include/linux/utime.h +++ b/include/linux/utime.h | |||
| @@ -1,6 +1,8 @@ | |||
| 1 | #ifndef _LINUX_UTIME_H | 1 | #ifndef _LINUX_UTIME_H |
| 2 | #define _LINUX_UTIME_H | 2 | #define _LINUX_UTIME_H |
| 3 | 3 | ||
| 4 | #include <linux/types.h> | ||
| 5 | |||
| 4 | struct utimbuf { | 6 | struct utimbuf { |
| 5 | time_t actime; | 7 | time_t actime; |
| 6 | time_t modtime; | 8 | time_t modtime; |
diff --git a/include/linux/vermagic.h b/include/linux/vermagic.h index 46919f9f5e..4d0909e535 100644 --- a/include/linux/vermagic.h +++ b/include/linux/vermagic.h | |||
| @@ -24,5 +24,5 @@ | |||
| 24 | #define VERMAGIC_STRING \ | 24 | #define VERMAGIC_STRING \ |
| 25 | UTS_RELEASE " " \ | 25 | UTS_RELEASE " " \ |
| 26 | MODULE_VERMAGIC_SMP MODULE_VERMAGIC_PREEMPT \ | 26 | MODULE_VERMAGIC_SMP MODULE_VERMAGIC_PREEMPT \ |
| 27 | MODULE_VERMAGIC_MODULE_UNLOAD MODULE_ARCH_VERMAGIC \ | 27 | MODULE_VERMAGIC_MODULE_UNLOAD MODULE_ARCH_VERMAGIC |
| 28 | "gcc-" __stringify(__GNUC__) "." __stringify(__GNUC_MINOR__) | 28 | |
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index e3715d7741..44c59da26e 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
| @@ -1135,7 +1135,8 @@ struct v4l2_sliced_vbi_cap | |||
| 1135 | (equals frame lines 313-336 for 625 line video | 1135 | (equals frame lines 313-336 for 625 line video |
| 1136 | standards, 263-286 for 525 line standards) */ | 1136 | standards, 263-286 for 525 line standards) */ |
| 1137 | __u16 service_lines[2][24]; | 1137 | __u16 service_lines[2][24]; |
| 1138 | __u32 reserved[4]; /* must be 0 */ | 1138 | enum v4l2_buf_type type; |
| 1139 | __u32 reserved[3]; /* must be 0 */ | ||
| 1139 | }; | 1140 | }; |
| 1140 | 1141 | ||
| 1141 | struct v4l2_sliced_vbi_data | 1142 | struct v4l2_sliced_vbi_data |
| @@ -1242,7 +1243,7 @@ struct v4l2_streamparm | |||
| 1242 | #define VIDIOC_G_PRIORITY _IOR ('V', 67, enum v4l2_priority) | 1243 | #define VIDIOC_G_PRIORITY _IOR ('V', 67, enum v4l2_priority) |
| 1243 | #define VIDIOC_S_PRIORITY _IOW ('V', 68, enum v4l2_priority) | 1244 | #define VIDIOC_S_PRIORITY _IOW ('V', 68, enum v4l2_priority) |
| 1244 | #if 1 | 1245 | #if 1 |
| 1245 | #define VIDIOC_G_SLICED_VBI_CAP _IOR ('V', 69, struct v4l2_sliced_vbi_cap) | 1246 | #define VIDIOC_G_SLICED_VBI_CAP _IOWR ('V', 69, struct v4l2_sliced_vbi_cap) |
| 1246 | #endif | 1247 | #endif |
| 1247 | #define VIDIOC_LOG_STATUS _IO ('V', 70) | 1248 | #define VIDIOC_LOG_STATUS _IO ('V', 70) |
| 1248 | #define VIDIOC_G_EXT_CTRLS _IOWR ('V', 71, struct v4l2_ext_controls) | 1249 | #define VIDIOC_G_EXT_CTRLS _IOWR ('V', 71, struct v4l2_ext_controls) |
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index 71b6363caa..ce5f1482e6 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h | |||
| @@ -44,8 +44,6 @@ extern void *vmalloc_32_user(unsigned long size); | |||
| 44 | extern void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot); | 44 | extern void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot); |
| 45 | extern void *__vmalloc_area(struct vm_struct *area, gfp_t gfp_mask, | 45 | extern void *__vmalloc_area(struct vm_struct *area, gfp_t gfp_mask, |
| 46 | pgprot_t prot); | 46 | pgprot_t prot); |
| 47 | extern void *__vmalloc_node(unsigned long size, gfp_t gfp_mask, | ||
| 48 | pgprot_t prot, int node); | ||
| 49 | extern void vfree(void *addr); | 47 | extern void vfree(void *addr); |
| 50 | 48 | ||
| 51 | extern void *vmap(struct page **pages, unsigned int count, | 49 | extern void *vmap(struct page **pages, unsigned int count, |
| @@ -64,7 +62,6 @@ extern struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags, | |||
| 64 | extern struct vm_struct *get_vm_area_node(unsigned long size, | 62 | extern struct vm_struct *get_vm_area_node(unsigned long size, |
| 65 | unsigned long flags, int node); | 63 | unsigned long flags, int node); |
| 66 | extern struct vm_struct *remove_vm_area(void *addr); | 64 | extern struct vm_struct *remove_vm_area(void *addr); |
| 67 | extern struct vm_struct *__remove_vm_area(void *addr); | ||
| 68 | extern int map_vm_area(struct vm_struct *area, pgprot_t prot, | 65 | extern int map_vm_area(struct vm_struct *area, pgprot_t prot, |
| 69 | struct page ***pages); | 66 | struct page ***pages); |
| 70 | extern void unmap_vm_area(struct vm_struct *area); | 67 | extern void unmap_vm_area(struct vm_struct *area); |
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h index 2d9b1b6079..c89df55f6e 100644 --- a/include/linux/vmstat.h +++ b/include/linux/vmstat.h | |||
| @@ -3,7 +3,6 @@ | |||
| 3 | 3 | ||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | #include <linux/percpu.h> | 5 | #include <linux/percpu.h> |
| 6 | #include <linux/config.h> | ||
| 7 | #include <linux/mmzone.h> | 6 | #include <linux/mmzone.h> |
| 8 | #include <asm/atomic.h> | 7 | #include <asm/atomic.h> |
| 9 | 8 | ||
| @@ -18,7 +17,19 @@ | |||
| 18 | * generated will simply be the increment of a global address. | 17 | * generated will simply be the increment of a global address. |
| 19 | */ | 18 | */ |
| 20 | 19 | ||
| 21 | #define FOR_ALL_ZONES(x) x##_DMA, x##_DMA32, x##_NORMAL, x##_HIGH | 20 | #ifdef CONFIG_ZONE_DMA32 |
| 21 | #define DMA32_ZONE(xx) xx##_DMA32, | ||
| 22 | #else | ||
| 23 | #define DMA32_ZONE(xx) | ||
| 24 | #endif | ||
| 25 | |||
| 26 | #ifdef CONFIG_HIGHMEM | ||
| 27 | #define HIGHMEM_ZONE(xx) , xx##_HIGH | ||
| 28 | #else | ||
| 29 | #define HIGHMEM_ZONE(xx) | ||
| 30 | #endif | ||
| 31 | |||
| 32 | #define FOR_ALL_ZONES(xx) xx##_DMA, DMA32_ZONE(xx) xx##_NORMAL HIGHMEM_ZONE(xx) | ||
| 22 | 33 | ||
| 23 | enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, | 34 | enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, |
| 24 | FOR_ALL_ZONES(PGALLOC), | 35 | FOR_ALL_ZONES(PGALLOC), |
| @@ -124,12 +135,10 @@ static inline unsigned long node_page_state(int node, | |||
| 124 | struct zone *zones = NODE_DATA(node)->node_zones; | 135 | struct zone *zones = NODE_DATA(node)->node_zones; |
| 125 | 136 | ||
| 126 | return | 137 | return |
| 127 | #ifndef CONFIG_DMA_IS_NORMAL | 138 | #ifdef CONFIG_ZONE_DMA32 |
| 128 | #if !defined(CONFIG_DMA_IS_DMA32) && BITS_PER_LONG >= 64 | ||
| 129 | zone_page_state(&zones[ZONE_DMA32], item) + | 139 | zone_page_state(&zones[ZONE_DMA32], item) + |
| 130 | #endif | 140 | #endif |
| 131 | zone_page_state(&zones[ZONE_NORMAL], item) + | 141 | zone_page_state(&zones[ZONE_NORMAL], item) + |
| 132 | #endif | ||
| 133 | #ifdef CONFIG_HIGHMEM | 142 | #ifdef CONFIG_HIGHMEM |
| 134 | zone_page_state(&zones[ZONE_HIGHMEM], item) + | 143 | zone_page_state(&zones[ZONE_HIGHMEM], item) + |
| 135 | #endif | 144 | #endif |
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h index 918a29763a..1009d3fe1f 100644 --- a/include/linux/vt_kern.h +++ b/include/linux/vt_kern.h | |||
| @@ -33,7 +33,8 @@ extern int fg_console, last_console, want_console; | |||
| 33 | int vc_allocate(unsigned int console); | 33 | int vc_allocate(unsigned int console); |
| 34 | int vc_cons_allocated(unsigned int console); | 34 | int vc_cons_allocated(unsigned int console); |
| 35 | int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int lines); | 35 | int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int lines); |
| 36 | void vc_disallocate(unsigned int console); | 36 | int vc_lock_resize(struct vc_data *vc, unsigned int cols, unsigned int lines); |
| 37 | void vc_deallocate(unsigned int console); | ||
| 37 | void reset_palette(struct vc_data *vc); | 38 | void reset_palette(struct vc_data *vc); |
| 38 | void do_blank_screen(int entering_gfx); | 39 | void do_blank_screen(int entering_gfx); |
| 39 | void do_unblank_screen(int leaving_gfx); | 40 | void do_unblank_screen(int leaving_gfx); |
diff --git a/include/linux/wireless.h b/include/linux/wireless.h index 13588564b4..a50a0130fd 100644 --- a/include/linux/wireless.h +++ b/include/linux/wireless.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * This file define a set of standard wireless extensions | 2 | * This file define a set of standard wireless extensions |
| 3 | * | 3 | * |
| 4 | * Version : 20 17.2.06 | 4 | * Version : 21 14.3.06 |
| 5 | * | 5 | * |
| 6 | * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com> | 6 | * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com> |
| 7 | * Copyright (c) 1997-2006 Jean Tourrilhes, All Rights Reserved. | 7 | * Copyright (c) 1997-2006 Jean Tourrilhes, All Rights Reserved. |
| @@ -69,9 +69,14 @@ | |||
| 69 | 69 | ||
| 70 | /***************************** INCLUDES *****************************/ | 70 | /***************************** INCLUDES *****************************/ |
| 71 | 71 | ||
| 72 | /* This header is used in user-space, therefore need to be sanitised | ||
| 73 | * for that purpose. Those includes are usually not compatible with glibc. | ||
| 74 | * To know which includes to use in user-space, check iwlib.h. */ | ||
| 75 | #ifdef __KERNEL__ | ||
| 72 | #include <linux/types.h> /* for "caddr_t" et al */ | 76 | #include <linux/types.h> /* for "caddr_t" et al */ |
| 73 | #include <linux/socket.h> /* for "struct sockaddr" et al */ | 77 | #include <linux/socket.h> /* for "struct sockaddr" et al */ |
| 74 | #include <linux/if.h> /* for IFNAMSIZ and co... */ | 78 | #include <linux/if.h> /* for IFNAMSIZ and co... */ |
| 79 | #endif /* __KERNEL__ */ | ||
| 75 | 80 | ||
| 76 | /***************************** VERSION *****************************/ | 81 | /***************************** VERSION *****************************/ |
| 77 | /* | 82 | /* |
| @@ -80,7 +85,7 @@ | |||
| 80 | * (there is some stuff that will be added in the future...) | 85 | * (there is some stuff that will be added in the future...) |
| 81 | * I just plan to increment with each new version. | 86 | * I just plan to increment with each new version. |
| 82 | */ | 87 | */ |
| 83 | #define WIRELESS_EXT 20 | 88 | #define WIRELESS_EXT 21 |
| 84 | 89 | ||
| 85 | /* | 90 | /* |
| 86 | * Changes : | 91 | * Changes : |
| @@ -208,6 +213,14 @@ | |||
| 208 | * V19 to V20 | 213 | * V19 to V20 |
| 209 | * ---------- | 214 | * ---------- |
| 210 | * - RtNetlink requests support (SET/GET) | 215 | * - RtNetlink requests support (SET/GET) |
| 216 | * | ||
| 217 | * V20 to V21 | ||
| 218 | * ---------- | ||
| 219 | * - Remove (struct net_device *)->get_wireless_stats() | ||
| 220 | * - Change length in ESSID and NICK to strlen() instead of strlen()+1 | ||
| 221 | * - Add IW_RETRY_SHORT/IW_RETRY_LONG retry modifiers | ||
| 222 | * - Power/Retry relative values no longer * 100000 | ||
| 223 | * - Add explicit flag to tell stats are in 802.11k RCPI : IW_QUAL_RCPI | ||
| 211 | */ | 224 | */ |
| 212 | 225 | ||
| 213 | /**************************** CONSTANTS ****************************/ | 226 | /**************************** CONSTANTS ****************************/ |
| @@ -448,6 +461,7 @@ | |||
| 448 | #define IW_QUAL_QUAL_INVALID 0x10 /* Driver doesn't provide value */ | 461 | #define IW_QUAL_QUAL_INVALID 0x10 /* Driver doesn't provide value */ |
| 449 | #define IW_QUAL_LEVEL_INVALID 0x20 | 462 | #define IW_QUAL_LEVEL_INVALID 0x20 |
| 450 | #define IW_QUAL_NOISE_INVALID 0x40 | 463 | #define IW_QUAL_NOISE_INVALID 0x40 |
| 464 | #define IW_QUAL_RCPI 0x80 /* Level + Noise are 802.11k RCPI */ | ||
| 451 | #define IW_QUAL_ALL_INVALID 0x70 | 465 | #define IW_QUAL_ALL_INVALID 0x70 |
| 452 | 466 | ||
| 453 | /* Frequency flags */ | 467 | /* Frequency flags */ |
| @@ -500,10 +514,12 @@ | |||
| 500 | #define IW_RETRY_TYPE 0xF000 /* Type of parameter */ | 514 | #define IW_RETRY_TYPE 0xF000 /* Type of parameter */ |
| 501 | #define IW_RETRY_LIMIT 0x1000 /* Maximum number of retries*/ | 515 | #define IW_RETRY_LIMIT 0x1000 /* Maximum number of retries*/ |
| 502 | #define IW_RETRY_LIFETIME 0x2000 /* Maximum duration of retries in us */ | 516 | #define IW_RETRY_LIFETIME 0x2000 /* Maximum duration of retries in us */ |
| 503 | #define IW_RETRY_MODIFIER 0x000F /* Modify a parameter */ | 517 | #define IW_RETRY_MODIFIER 0x00FF /* Modify a parameter */ |
| 504 | #define IW_RETRY_MIN 0x0001 /* Value is a minimum */ | 518 | #define IW_RETRY_MIN 0x0001 /* Value is a minimum */ |
| 505 | #define IW_RETRY_MAX 0x0002 /* Value is a maximum */ | 519 | #define IW_RETRY_MAX 0x0002 /* Value is a maximum */ |
| 506 | #define IW_RETRY_RELATIVE 0x0004 /* Value is not in seconds/ms/us */ | 520 | #define IW_RETRY_RELATIVE 0x0004 /* Value is not in seconds/ms/us */ |
| 521 | #define IW_RETRY_SHORT 0x0010 /* Value is for short packets */ | ||
| 522 | #define IW_RETRY_LONG 0x0020 /* Value is for long packets */ | ||
| 507 | 523 | ||
| 508 | /* Scanning request flags */ | 524 | /* Scanning request flags */ |
| 509 | #define IW_SCAN_DEFAULT 0x0000 /* Default scan of the driver */ | 525 | #define IW_SCAN_DEFAULT 0x0000 /* Default scan of the driver */ |
| @@ -1017,7 +1033,7 @@ struct iw_range | |||
| 1017 | /* Note : this frequency list doesn't need to fit channel numbers, | 1033 | /* Note : this frequency list doesn't need to fit channel numbers, |
| 1018 | * because each entry contain its channel index */ | 1034 | * because each entry contain its channel index */ |
| 1019 | 1035 | ||
| 1020 | __u32 enc_capa; /* IW_ENC_CAPA_* bit field */ | 1036 | __u32 enc_capa; /* IW_ENC_CAPA_* bit field */ |
| 1021 | }; | 1037 | }; |
| 1022 | 1038 | ||
| 1023 | /* | 1039 | /* |
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index 9e38b566d0..4f4d98addb 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
| @@ -85,6 +85,7 @@ int wakeup_pdflush(long nr_pages); | |||
| 85 | void laptop_io_completion(void); | 85 | void laptop_io_completion(void); |
| 86 | void laptop_sync_completion(void); | 86 | void laptop_sync_completion(void); |
| 87 | void throttle_vm_writeout(void); | 87 | void throttle_vm_writeout(void); |
| 88 | void writeback_congestion_end(void); | ||
| 88 | 89 | ||
| 89 | /* These are exported to sysctl. */ | 90 | /* These are exported to sysctl. */ |
| 90 | extern int dirty_background_ratio; | 91 | extern int dirty_background_ratio; |
| @@ -110,11 +111,15 @@ balance_dirty_pages_ratelimited(struct address_space *mapping) | |||
| 110 | } | 111 | } |
| 111 | 112 | ||
| 112 | int pdflush_operation(void (*fn)(unsigned long), unsigned long arg0); | 113 | int pdflush_operation(void (*fn)(unsigned long), unsigned long arg0); |
| 114 | extern int generic_writepages(struct address_space *mapping, | ||
| 115 | struct writeback_control *wbc); | ||
| 113 | int do_writepages(struct address_space *mapping, struct writeback_control *wbc); | 116 | int do_writepages(struct address_space *mapping, struct writeback_control *wbc); |
| 114 | int sync_page_range(struct inode *inode, struct address_space *mapping, | 117 | int sync_page_range(struct inode *inode, struct address_space *mapping, |
| 115 | loff_t pos, loff_t count); | 118 | loff_t pos, loff_t count); |
| 116 | int sync_page_range_nolock(struct inode *inode, struct address_space *mapping, | 119 | int sync_page_range_nolock(struct inode *inode, struct address_space *mapping, |
| 117 | loff_t pos, loff_t count); | 120 | loff_t pos, loff_t count); |
| 121 | void set_page_dirty_balance(struct page *page); | ||
| 122 | void writeback_set_ratelimit(void); | ||
| 118 | 123 | ||
| 119 | /* pdflush.c */ | 124 | /* pdflush.c */ |
| 120 | extern int nr_pdflush_threads; /* Global so it can be exported to sysctl | 125 | extern int nr_pdflush_threads; /* Global so it can be exported to sysctl |
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h index 46a15c7a1a..430afd0582 100644 --- a/include/linux/xfrm.h +++ b/include/linux/xfrm.h | |||
| @@ -12,8 +12,8 @@ | |||
| 12 | */ | 12 | */ |
| 13 | typedef union | 13 | typedef union |
| 14 | { | 14 | { |
| 15 | __u32 a4; | 15 | __be32 a4; |
| 16 | __u32 a6[4]; | 16 | __be32 a6[4]; |
| 17 | } xfrm_address_t; | 17 | } xfrm_address_t; |
| 18 | 18 | ||
| 19 | /* Ident of a specific xfrm_state. It is used on input to lookup | 19 | /* Ident of a specific xfrm_state. It is used on input to lookup |
| @@ -23,7 +23,7 @@ typedef union | |||
| 23 | struct xfrm_id | 23 | struct xfrm_id |
| 24 | { | 24 | { |
| 25 | xfrm_address_t daddr; | 25 | xfrm_address_t daddr; |
| 26 | __u32 spi; | 26 | __be32 spi; |
| 27 | __u8 proto; | 27 | __u8 proto; |
| 28 | }; | 28 | }; |
| 29 | 29 | ||
| @@ -49,10 +49,10 @@ struct xfrm_selector | |||
| 49 | { | 49 | { |
| 50 | xfrm_address_t daddr; | 50 | xfrm_address_t daddr; |
| 51 | xfrm_address_t saddr; | 51 | xfrm_address_t saddr; |
| 52 | __u16 dport; | 52 | __be16 dport; |
| 53 | __u16 dport_mask; | 53 | __be16 dport_mask; |
| 54 | __u16 sport; | 54 | __be16 sport; |
| 55 | __u16 sport_mask; | 55 | __be16 sport_mask; |
| 56 | __u16 family; | 56 | __u16 family; |
| 57 | __u8 prefixlen_d; | 57 | __u8 prefixlen_d; |
| 58 | __u8 prefixlen_s; | 58 | __u8 prefixlen_s; |
| @@ -104,6 +104,13 @@ struct xfrm_stats { | |||
| 104 | 104 | ||
| 105 | enum | 105 | enum |
| 106 | { | 106 | { |
| 107 | XFRM_POLICY_TYPE_MAIN = 0, | ||
| 108 | XFRM_POLICY_TYPE_SUB = 1, | ||
| 109 | XFRM_POLICY_TYPE_MAX = 2 | ||
| 110 | }; | ||
| 111 | |||
| 112 | enum | ||
| 113 | { | ||
| 107 | XFRM_POLICY_IN = 0, | 114 | XFRM_POLICY_IN = 0, |
| 108 | XFRM_POLICY_OUT = 1, | 115 | XFRM_POLICY_OUT = 1, |
| 109 | XFRM_POLICY_FWD = 2, | 116 | XFRM_POLICY_FWD = 2, |
| @@ -120,7 +127,9 @@ enum | |||
| 120 | 127 | ||
| 121 | #define XFRM_MODE_TRANSPORT 0 | 128 | #define XFRM_MODE_TRANSPORT 0 |
| 122 | #define XFRM_MODE_TUNNEL 1 | 129 | #define XFRM_MODE_TUNNEL 1 |
| 123 | #define XFRM_MODE_MAX 2 | 130 | #define XFRM_MODE_ROUTEOPTIMIZATION 2 |
| 131 | #define XFRM_MODE_IN_TRIGGER 3 | ||
| 132 | #define XFRM_MODE_MAX 4 | ||
| 124 | 133 | ||
| 125 | /* Netlink configuration messages. */ | 134 | /* Netlink configuration messages. */ |
| 126 | enum { | 135 | enum { |
| @@ -164,6 +173,10 @@ enum { | |||
| 164 | #define XFRM_MSG_NEWAE XFRM_MSG_NEWAE | 173 | #define XFRM_MSG_NEWAE XFRM_MSG_NEWAE |
| 165 | XFRM_MSG_GETAE, | 174 | XFRM_MSG_GETAE, |
| 166 | #define XFRM_MSG_GETAE XFRM_MSG_GETAE | 175 | #define XFRM_MSG_GETAE XFRM_MSG_GETAE |
| 176 | |||
| 177 | XFRM_MSG_REPORT, | ||
| 178 | #define XFRM_MSG_REPORT XFRM_MSG_REPORT | ||
| 179 | |||
| 167 | __XFRM_MSG_MAX | 180 | __XFRM_MSG_MAX |
| 168 | }; | 181 | }; |
| 169 | #define XFRM_MSG_MAX (__XFRM_MSG_MAX - 1) | 182 | #define XFRM_MSG_MAX (__XFRM_MSG_MAX - 1) |
| @@ -217,6 +230,12 @@ enum xfrm_ae_ftype_t { | |||
| 217 | #define XFRM_AE_MAX (__XFRM_AE_MAX - 1) | 230 | #define XFRM_AE_MAX (__XFRM_AE_MAX - 1) |
| 218 | }; | 231 | }; |
| 219 | 232 | ||
| 233 | struct xfrm_userpolicy_type { | ||
| 234 | __u8 type; | ||
| 235 | __u16 reserved1; | ||
| 236 | __u8 reserved2; | ||
| 237 | }; | ||
| 238 | |||
| 220 | /* Netlink message attributes. */ | 239 | /* Netlink message attributes. */ |
| 221 | enum xfrm_attr_type_t { | 240 | enum xfrm_attr_type_t { |
| 222 | XFRMA_UNSPEC, | 241 | XFRMA_UNSPEC, |
| @@ -232,6 +251,10 @@ enum xfrm_attr_type_t { | |||
| 232 | XFRMA_REPLAY_VAL, | 251 | XFRMA_REPLAY_VAL, |
| 233 | XFRMA_REPLAY_THRESH, | 252 | XFRMA_REPLAY_THRESH, |
| 234 | XFRMA_ETIMER_THRESH, | 253 | XFRMA_ETIMER_THRESH, |
| 254 | XFRMA_SRCADDR, /* xfrm_address_t */ | ||
| 255 | XFRMA_COADDR, /* xfrm_address_t */ | ||
| 256 | XFRMA_LASTUSED, | ||
| 257 | XFRMA_POLICY_TYPE, /* struct xfrm_userpolicy_type */ | ||
| 235 | __XFRMA_MAX | 258 | __XFRMA_MAX |
| 236 | 259 | ||
| 237 | #define XFRMA_MAX (__XFRMA_MAX - 1) | 260 | #define XFRMA_MAX (__XFRMA_MAX - 1) |
| @@ -247,17 +270,18 @@ struct xfrm_usersa_info { | |||
| 247 | __u32 seq; | 270 | __u32 seq; |
| 248 | __u32 reqid; | 271 | __u32 reqid; |
| 249 | __u16 family; | 272 | __u16 family; |
| 250 | __u8 mode; /* 0=transport,1=tunnel */ | 273 | __u8 mode; /* XFRM_MODE_xxx */ |
| 251 | __u8 replay_window; | 274 | __u8 replay_window; |
| 252 | __u8 flags; | 275 | __u8 flags; |
| 253 | #define XFRM_STATE_NOECN 1 | 276 | #define XFRM_STATE_NOECN 1 |
| 254 | #define XFRM_STATE_DECAP_DSCP 2 | 277 | #define XFRM_STATE_DECAP_DSCP 2 |
| 255 | #define XFRM_STATE_NOPMTUDISC 4 | 278 | #define XFRM_STATE_NOPMTUDISC 4 |
| 279 | #define XFRM_STATE_WILDRECV 8 | ||
| 256 | }; | 280 | }; |
| 257 | 281 | ||
| 258 | struct xfrm_usersa_id { | 282 | struct xfrm_usersa_id { |
| 259 | xfrm_address_t daddr; | 283 | xfrm_address_t daddr; |
| 260 | __u32 spi; | 284 | __be32 spi; |
| 261 | __u16 family; | 285 | __u16 family; |
| 262 | __u8 proto; | 286 | __u8 proto; |
| 263 | }; | 287 | }; |
| @@ -319,12 +343,18 @@ struct xfrm_usersa_flush { | |||
| 319 | __u8 proto; | 343 | __u8 proto; |
| 320 | }; | 344 | }; |
| 321 | 345 | ||
| 346 | struct xfrm_user_report { | ||
| 347 | __u8 proto; | ||
| 348 | struct xfrm_selector sel; | ||
| 349 | }; | ||
| 350 | |||
| 322 | #ifndef __KERNEL__ | 351 | #ifndef __KERNEL__ |
| 323 | /* backwards compatibility for userspace */ | 352 | /* backwards compatibility for userspace */ |
| 324 | #define XFRMGRP_ACQUIRE 1 | 353 | #define XFRMGRP_ACQUIRE 1 |
| 325 | #define XFRMGRP_EXPIRE 2 | 354 | #define XFRMGRP_EXPIRE 2 |
| 326 | #define XFRMGRP_SA 4 | 355 | #define XFRMGRP_SA 4 |
| 327 | #define XFRMGRP_POLICY 8 | 356 | #define XFRMGRP_POLICY 8 |
| 357 | #define XFRMGRP_REPORT 0x10 | ||
| 328 | #endif | 358 | #endif |
| 329 | 359 | ||
| 330 | enum xfrm_nlgroups { | 360 | enum xfrm_nlgroups { |
| @@ -340,6 +370,8 @@ enum xfrm_nlgroups { | |||
| 340 | #define XFRMNLGRP_POLICY XFRMNLGRP_POLICY | 370 | #define XFRMNLGRP_POLICY XFRMNLGRP_POLICY |
| 341 | XFRMNLGRP_AEVENTS, | 371 | XFRMNLGRP_AEVENTS, |
| 342 | #define XFRMNLGRP_AEVENTS XFRMNLGRP_AEVENTS | 372 | #define XFRMNLGRP_AEVENTS XFRMNLGRP_AEVENTS |
| 373 | XFRMNLGRP_REPORT, | ||
| 374 | #define XFRMNLGRP_REPORT XFRMNLGRP_REPORT | ||
| 343 | __XFRMNLGRP_MAX | 375 | __XFRMNLGRP_MAX |
| 344 | }; | 376 | }; |
| 345 | #define XFRMNLGRP_MAX (__XFRMNLGRP_MAX - 1) | 377 | #define XFRMNLGRP_MAX (__XFRMNLGRP_MAX - 1) |
