Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Manually resolve conflict in include/mtd/Kbuild Signed-off-by: David Woodhouse <dwmw2@infradead.org>
This commit is contained in:
commit
8a84fc15ae
4921 changed files with 311324 additions and 135534 deletions
|
|
@ -1,63 +1,344 @@
|
|||
header-y := byteorder/ dvb/ hdlc/ isdn/ nfsd/ raid/ sunrpc/ tc_act/ \
|
||||
netfilter/ netfilter_arp/ netfilter_bridge/ netfilter_ipv4/ \
|
||||
netfilter_ipv6/
|
||||
header-y += byteorder/
|
||||
header-y += dvb/
|
||||
header-y += hdlc/
|
||||
header-y += isdn/
|
||||
header-y += nfsd/
|
||||
header-y += raid/
|
||||
header-y += sunrpc/
|
||||
header-y += tc_act/
|
||||
header-y += netfilter/
|
||||
header-y += netfilter_arp/
|
||||
header-y += netfilter_bridge/
|
||||
header-y += netfilter_ipv4/
|
||||
header-y += netfilter_ipv6/
|
||||
|
||||
header-y += affs_fs.h affs_hardblocks.h aio_abi.h a.out.h arcfb.h \
|
||||
atmapi.h atmbr2684.h atmclip.h atm_eni.h atm_he.h \
|
||||
atm_idt77105.h atmioc.h atmlec.h atmmpc.h atm_nicstar.h \
|
||||
atmppp.h atmsap.h atmsvc.h atm_zatm.h auto_fs4.h auxvec.h \
|
||||
awe_voice.h ax25.h b1lli.h baycom.h bfs_fs.h blkpg.h \
|
||||
bpqether.h cdk.h chio.h coda_psdev.h coff.h comstats.h \
|
||||
consolemap.h cycx_cfm.h dm-ioctl.h dn.h dqblk_v1.h \
|
||||
dqblk_v2.h dqblk_xfs.h efs_fs_sb.h elf-fdpic.h elf.h elf-em.h \
|
||||
fadvise.h fd.h fdreg.h ftape-header-segment.h ftape-vendors.h \
|
||||
fuse.h futex.h genetlink.h gen_stats.h gigaset_dev.h hdsmart.h \
|
||||
hpfs_fs.h hysdn_if.h i2c-dev.h i8k.h icmp.h \
|
||||
if_arcnet.h if_arp.h if_bonding.h if_cablemodem.h if_fc.h \
|
||||
if_fddi.h if.h if_hippi.h if_infiniband.h if_packet.h \
|
||||
if_plip.h if_ppp.h if_slip.h if_strip.h if_tunnel.h in6.h \
|
||||
in_route.h ioctl.h ip.h ipmi_msgdefs.h ip_mp_alg.h ipsec.h \
|
||||
ipx.h irda.h isdn_divertif.h iso_fs.h ite_gpio.h ixjuser.h \
|
||||
jffs2.h keyctl.h limits.h major.h matroxfb.h meye.h minix_fs.h \
|
||||
mmtimer.h mqueue.h mtio.h ncp_no.h netfilter_arp.h netrom.h \
|
||||
nfs2.h nfs4_mount.h nfs_mount.h openprom_fs.h param.h \
|
||||
pci_ids.h pci_regs.h personality.h pfkeyv2.h pg.h pkt_cls.h \
|
||||
pkt_sched.h posix_types.h ppdev.h prctl.h ps2esdi.h qic117.h \
|
||||
qnxtypes.h quotaio_v1.h quotaio_v2.h radeonfb.h raw.h \
|
||||
resource.h rose.h sctp.h smbno.h snmp.h sockios.h som.h \
|
||||
sound.h stddef.h synclink.h telephony.h termios.h ticable.h \
|
||||
times.h tiocl.h tipc.h toshiba.h ultrasound.h un.h utime.h \
|
||||
utsname.h video_decoder.h video_encoder.h videotext.h vt.h \
|
||||
wavefront.h wireless.h xattr.h x25.h zorro_ids.h
|
||||
header-y += affs_hardblocks.h
|
||||
header-y += aio_abi.h
|
||||
header-y += a.out.h
|
||||
header-y += arcfb.h
|
||||
header-y += atmapi.h
|
||||
header-y += atmbr2684.h
|
||||
header-y += atmclip.h
|
||||
header-y += atm_eni.h
|
||||
header-y += atm_he.h
|
||||
header-y += atm_idt77105.h
|
||||
header-y += atmioc.h
|
||||
header-y += atmlec.h
|
||||
header-y += atmmpc.h
|
||||
header-y += atm_nicstar.h
|
||||
header-y += atmppp.h
|
||||
header-y += atmsap.h
|
||||
header-y += atmsvc.h
|
||||
header-y += atm_zatm.h
|
||||
header-y += auto_fs4.h
|
||||
header-y += auxvec.h
|
||||
header-y += awe_voice.h
|
||||
header-y += ax25.h
|
||||
header-y += b1lli.h
|
||||
header-y += baycom.h
|
||||
header-y += bfs_fs.h
|
||||
header-y += blkpg.h
|
||||
header-y += bpqether.h
|
||||
header-y += cdk.h
|
||||
header-y += chio.h
|
||||
header-y += coda_psdev.h
|
||||
header-y += coff.h
|
||||
header-y += comstats.h
|
||||
header-y += consolemap.h
|
||||
header-y += cycx_cfm.h
|
||||
header-y += dm-ioctl.h
|
||||
header-y += dn.h
|
||||
header-y += dqblk_v1.h
|
||||
header-y += dqblk_v2.h
|
||||
header-y += dqblk_xfs.h
|
||||
header-y += efs_fs_sb.h
|
||||
header-y += elf-fdpic.h
|
||||
header-y += elf.h
|
||||
header-y += elf-em.h
|
||||
header-y += fadvise.h
|
||||
header-y += fd.h
|
||||
header-y += fdreg.h
|
||||
header-y += fib_rules.h
|
||||
header-y += ftape-header-segment.h
|
||||
header-y += ftape-vendors.h
|
||||
header-y += fuse.h
|
||||
header-y += futex.h
|
||||
header-y += genetlink.h
|
||||
header-y += gen_stats.h
|
||||
header-y += gigaset_dev.h
|
||||
header-y += hdsmart.h
|
||||
header-y += hysdn_if.h
|
||||
header-y += i2c-dev.h
|
||||
header-y += i8k.h
|
||||
header-y += icmp.h
|
||||
header-y += if_addr.h
|
||||
header-y += if_arcnet.h
|
||||
header-y += if_arp.h
|
||||
header-y += if_bonding.h
|
||||
header-y += if_cablemodem.h
|
||||
header-y += if_fc.h
|
||||
header-y += if_fddi.h
|
||||
header-y += if.h
|
||||
header-y += if_hippi.h
|
||||
header-y += if_infiniband.h
|
||||
header-y += if_link.h
|
||||
header-y += if_packet.h
|
||||
header-y += if_plip.h
|
||||
header-y += if_ppp.h
|
||||
header-y += if_slip.h
|
||||
header-y += if_strip.h
|
||||
header-y += if_tunnel.h
|
||||
header-y += in6.h
|
||||
header-y += in_route.h
|
||||
header-y += ioctl.h
|
||||
header-y += ip.h
|
||||
header-y += ipmi_msgdefs.h
|
||||
header-y += ip_mp_alg.h
|
||||
header-y += ipsec.h
|
||||
header-y += ipx.h
|
||||
header-y += irda.h
|
||||
header-y += isdn_divertif.h
|
||||
header-y += iso_fs.h
|
||||
header-y += ite_gpio.h
|
||||
header-y += ixjuser.h
|
||||
header-y += jffs2.h
|
||||
header-y += keyctl.h
|
||||
header-y += limits.h
|
||||
header-y += magic.h
|
||||
header-y += major.h
|
||||
header-y += matroxfb.h
|
||||
header-y += meye.h
|
||||
header-y += minix_fs.h
|
||||
header-y += mmtimer.h
|
||||
header-y += mqueue.h
|
||||
header-y += mtio.h
|
||||
header-y += ncp_no.h
|
||||
header-y += neighbour.h
|
||||
header-y += netfilter_arp.h
|
||||
header-y += netrom.h
|
||||
header-y += nfs2.h
|
||||
header-y += nfs4_mount.h
|
||||
header-y += nfs_mount.h
|
||||
header-y += param.h
|
||||
header-y += pci_ids.h
|
||||
header-y += pci_regs.h
|
||||
header-y += personality.h
|
||||
header-y += pfkeyv2.h
|
||||
header-y += pg.h
|
||||
header-y += pkt_cls.h
|
||||
header-y += pkt_sched.h
|
||||
header-y += posix_types.h
|
||||
header-y += ppdev.h
|
||||
header-y += prctl.h
|
||||
header-y += ps2esdi.h
|
||||
header-y += qic117.h
|
||||
header-y += qnxtypes.h
|
||||
header-y += quotaio_v1.h
|
||||
header-y += quotaio_v2.h
|
||||
header-y += radeonfb.h
|
||||
header-y += raw.h
|
||||
header-y += resource.h
|
||||
header-y += rose.h
|
||||
header-y += sctp.h
|
||||
header-y += smbno.h
|
||||
header-y += snmp.h
|
||||
header-y += sockios.h
|
||||
header-y += som.h
|
||||
header-y += sound.h
|
||||
header-y += synclink.h
|
||||
header-y += telephony.h
|
||||
header-y += termios.h
|
||||
header-y += ticable.h
|
||||
header-y += times.h
|
||||
header-y += tiocl.h
|
||||
header-y += tipc.h
|
||||
header-y += toshiba.h
|
||||
header-y += ultrasound.h
|
||||
header-y += un.h
|
||||
header-y += utime.h
|
||||
header-y += utsname.h
|
||||
header-y += video_decoder.h
|
||||
header-y += video_encoder.h
|
||||
header-y += videotext.h
|
||||
header-y += vt.h
|
||||
header-y += wavefront.h
|
||||
header-y += wireless.h
|
||||
header-y += xattr.h
|
||||
header-y += x25.h
|
||||
header-y += zorro_ids.h
|
||||
|
||||
unifdef-y += acct.h adb.h adfs_fs.h agpgart.h apm_bios.h atalk.h \
|
||||
atmarp.h atmdev.h atm.h atm_tcp.h audit.h auto_fs.h binfmts.h \
|
||||
capability.h capi.h cciss_ioctl.h cdrom.h cm4000_cs.h \
|
||||
cn_proc.h coda.h connector.h cramfs_fs.h cuda.h cyclades.h \
|
||||
dccp.h dirent.h divert.h elfcore.h errno.h errqueue.h \
|
||||
ethtool.h eventpoll.h ext2_fs.h ext3_fs.h fb.h fcntl.h \
|
||||
filter.h flat.h fs.h ftape.h gameport.h generic_serial.h \
|
||||
genhd.h hayesesp.h hdlcdrv.h hdlc.h hdreg.h hiddev.h hpet.h \
|
||||
i2c.h i2o-dev.h icmpv6.h if_bridge.h if_ec.h \
|
||||
if_eql.h if_ether.h if_frad.h if_ltalk.h if_pppox.h \
|
||||
if_shaper.h if_tr.h if_tun.h if_vlan.h if_wanpipe.h igmp.h \
|
||||
inet_diag.h in.h inotify.h input.h ipc.h ipmi.h ipv6.h \
|
||||
ipv6_route.h isdn.h isdnif.h isdn_ppp.h isicom.h jbd.h \
|
||||
joystick.h kdev_t.h kd.h kernelcapi.h kernel.h keyboard.h \
|
||||
llc.h loop.h lp.h mempolicy.h mii.h mman.h mroute.h msdos_fs.h \
|
||||
msg.h nbd.h ncp_fs.h ncp.h ncp_mount.h netdevice.h \
|
||||
netfilter_bridge.h netfilter_decnet.h netfilter.h \
|
||||
netfilter_ipv4.h netfilter_ipv6.h netfilter_logging.h net.h \
|
||||
netlink.h nfs3.h nfs4.h nfsacl.h nfs_fs.h nfs.h nfs_idmap.h \
|
||||
n_r3964.h nubus.h nvram.h parport.h patchkey.h pci.h pktcdvd.h \
|
||||
pmu.h poll.h ppp_defs.h ppp-comp.h ptrace.h qnx4_fs.h quota.h \
|
||||
random.h reboot.h reiserfs_fs.h reiserfs_xattr.h romfs_fs.h \
|
||||
route.h rtc.h rtnetlink.h scc.h sched.h sdla.h \
|
||||
selinux_netlink.h sem.h serial_core.h serial.h serio.h shm.h \
|
||||
signal.h smb_fs.h smb.h smb_mount.h socket.h sonet.h sonypi.h \
|
||||
soundcard.h stat.h sysctl.h tcp.h time.h timex.h tty.h types.h \
|
||||
udf_fs_i.h udp.h uinput.h uio.h unistd.h usb_ch9.h \
|
||||
usbdevice_fs.h user.h videodev2.h videodev.h wait.h \
|
||||
wanrouter.h watchdog.h xfrm.h zftape.h
|
||||
unifdef-y += acct.h
|
||||
unifdef-y += adb.h
|
||||
unifdef-y += adfs_fs.h
|
||||
unifdef-y += agpgart.h
|
||||
unifdef-y += apm_bios.h
|
||||
unifdef-y += atalk.h
|
||||
unifdef-y += atmarp.h
|
||||
unifdef-y += atmdev.h
|
||||
unifdef-y += atm.h
|
||||
unifdef-y += atm_tcp.h
|
||||
unifdef-y += audit.h
|
||||
unifdef-y += auto_fs.h
|
||||
unifdef-y += binfmts.h
|
||||
unifdef-y += capability.h
|
||||
unifdef-y += capi.h
|
||||
unifdef-y += cciss_ioctl.h
|
||||
unifdef-y += cdrom.h
|
||||
unifdef-y += cm4000_cs.h
|
||||
unifdef-y += cn_proc.h
|
||||
unifdef-y += coda.h
|
||||
unifdef-y += connector.h
|
||||
unifdef-y += cramfs_fs.h
|
||||
unifdef-y += cuda.h
|
||||
unifdef-y += cyclades.h
|
||||
unifdef-y += dccp.h
|
||||
unifdef-y += dirent.h
|
||||
unifdef-y += divert.h
|
||||
unifdef-y += elfcore.h
|
||||
unifdef-y += errno.h
|
||||
unifdef-y += errqueue.h
|
||||
unifdef-y += ethtool.h
|
||||
unifdef-y += eventpoll.h
|
||||
unifdef-y += ext2_fs.h
|
||||
unifdef-y += ext3_fs.h
|
||||
unifdef-y += fb.h
|
||||
unifdef-y += fcntl.h
|
||||
unifdef-y += filter.h
|
||||
unifdef-y += flat.h
|
||||
unifdef-y += fs.h
|
||||
unifdef-y += ftape.h
|
||||
unifdef-y += gameport.h
|
||||
unifdef-y += generic_serial.h
|
||||
unifdef-y += genhd.h
|
||||
unifdef-y += hayesesp.h
|
||||
unifdef-y += hdlcdrv.h
|
||||
unifdef-y += hdlc.h
|
||||
unifdef-y += hdreg.h
|
||||
unifdef-y += hiddev.h
|
||||
unifdef-y += hpet.h
|
||||
unifdef-y += i2c.h
|
||||
unifdef-y += i2o-dev.h
|
||||
unifdef-y += icmpv6.h
|
||||
unifdef-y += if_bridge.h
|
||||
unifdef-y += if_ec.h
|
||||
unifdef-y += if_eql.h
|
||||
unifdef-y += if_ether.h
|
||||
unifdef-y += if_frad.h
|
||||
unifdef-y += if_ltalk.h
|
||||
unifdef-y += if_pppox.h
|
||||
unifdef-y += if_shaper.h
|
||||
unifdef-y += if_tr.h
|
||||
unifdef-y += if_tun.h
|
||||
unifdef-y += if_vlan.h
|
||||
unifdef-y += if_wanpipe.h
|
||||
unifdef-y += igmp.h
|
||||
unifdef-y += inet_diag.h
|
||||
unifdef-y += in.h
|
||||
unifdef-y += inotify.h
|
||||
unifdef-y += input.h
|
||||
unifdef-y += ipc.h
|
||||
unifdef-y += ipmi.h
|
||||
unifdef-y += ipv6.h
|
||||
unifdef-y += ipv6_route.h
|
||||
unifdef-y += isdn.h
|
||||
unifdef-y += isdnif.h
|
||||
unifdef-y += isdn_ppp.h
|
||||
unifdef-y += isicom.h
|
||||
unifdef-y += jbd.h
|
||||
unifdef-y += joystick.h
|
||||
unifdef-y += kdev_t.h
|
||||
unifdef-y += kd.h
|
||||
unifdef-y += kernelcapi.h
|
||||
unifdef-y += kernel.h
|
||||
unifdef-y += keyboard.h
|
||||
unifdef-y += llc.h
|
||||
unifdef-y += loop.h
|
||||
unifdef-y += lp.h
|
||||
unifdef-y += mempolicy.h
|
||||
unifdef-y += mii.h
|
||||
unifdef-y += mman.h
|
||||
unifdef-y += mroute.h
|
||||
unifdef-y += msdos_fs.h
|
||||
unifdef-y += msg.h
|
||||
unifdef-y += nbd.h
|
||||
unifdef-y += ncp_fs.h
|
||||
unifdef-y += ncp.h
|
||||
unifdef-y += ncp_mount.h
|
||||
unifdef-y += netdevice.h
|
||||
unifdef-y += netfilter_bridge.h
|
||||
unifdef-y += netfilter_decnet.h
|
||||
unifdef-y += netfilter.h
|
||||
unifdef-y += netfilter_ipv4.h
|
||||
unifdef-y += netfilter_ipv6.h
|
||||
unifdef-y += net.h
|
||||
unifdef-y += netlink.h
|
||||
unifdef-y += nfs3.h
|
||||
unifdef-y += nfs4.h
|
||||
unifdef-y += nfsacl.h
|
||||
unifdef-y += nfs_fs.h
|
||||
unifdef-y += nfs.h
|
||||
unifdef-y += nfs_idmap.h
|
||||
unifdef-y += n_r3964.h
|
||||
unifdef-y += nubus.h
|
||||
unifdef-y += nvram.h
|
||||
unifdef-y += parport.h
|
||||
unifdef-y += patchkey.h
|
||||
unifdef-y += pci.h
|
||||
unifdef-y += pktcdvd.h
|
||||
unifdef-y += pmu.h
|
||||
unifdef-y += poll.h
|
||||
unifdef-y += ppp_defs.h
|
||||
unifdef-y += ppp-comp.h
|
||||
unifdef-y += ptrace.h
|
||||
unifdef-y += qnx4_fs.h
|
||||
unifdef-y += quota.h
|
||||
unifdef-y += random.h
|
||||
unifdef-y += reboot.h
|
||||
unifdef-y += reiserfs_fs.h
|
||||
unifdef-y += reiserfs_xattr.h
|
||||
unifdef-y += romfs_fs.h
|
||||
unifdef-y += route.h
|
||||
unifdef-y += rtc.h
|
||||
unifdef-y += rtnetlink.h
|
||||
unifdef-y += scc.h
|
||||
unifdef-y += sched.h
|
||||
unifdef-y += sdla.h
|
||||
unifdef-y += selinux_netlink.h
|
||||
unifdef-y += sem.h
|
||||
unifdef-y += serial_core.h
|
||||
unifdef-y += serial.h
|
||||
unifdef-y += serio.h
|
||||
unifdef-y += shm.h
|
||||
unifdef-y += signal.h
|
||||
unifdef-y += smb_fs.h
|
||||
unifdef-y += smb.h
|
||||
unifdef-y += smb_mount.h
|
||||
unifdef-y += socket.h
|
||||
unifdef-y += sonet.h
|
||||
unifdef-y += sonypi.h
|
||||
unifdef-y += soundcard.h
|
||||
unifdef-y += stat.h
|
||||
unifdef-y += stddef.h
|
||||
unifdef-y += sysctl.h
|
||||
unifdef-y += tcp.h
|
||||
unifdef-y += time.h
|
||||
unifdef-y += timex.h
|
||||
unifdef-y += tty.h
|
||||
unifdef-y += types.h
|
||||
unifdef-y += udf_fs_i.h
|
||||
unifdef-y += udp.h
|
||||
unifdef-y += uinput.h
|
||||
unifdef-y += uio.h
|
||||
unifdef-y += unistd.h
|
||||
unifdef-y += usb_ch9.h
|
||||
unifdef-y += usbdevice_fs.h
|
||||
unifdef-y += user.h
|
||||
unifdef-y += videodev2.h
|
||||
unifdef-y += videodev.h
|
||||
unifdef-y += wait.h
|
||||
unifdef-y += wanrouter.h
|
||||
unifdef-y += watchdog.h
|
||||
unifdef-y += xfrm.h
|
||||
unifdef-y += zftape.h
|
||||
|
||||
objhdr-y := version.h
|
||||
objhdr-y += version.h
|
||||
|
|
|
|||
|
|
@ -124,16 +124,12 @@ extern void acct_auto_close(struct super_block *sb);
|
|||
extern void acct_init_pacct(struct pacct_struct *pacct);
|
||||
extern void acct_collect(long exitcode, int group_dead);
|
||||
extern void acct_process(void);
|
||||
extern void acct_update_integrals(struct task_struct *tsk);
|
||||
extern void acct_clear_integrals(struct task_struct *tsk);
|
||||
#else
|
||||
#define acct_auto_close_mnt(x) do { } while (0)
|
||||
#define acct_auto_close(x) do { } while (0)
|
||||
#define acct_init_pacct(x) do { } while (0)
|
||||
#define acct_collect(x,y) do { } while (0)
|
||||
#define acct_process() do { } while (0)
|
||||
#define acct_update_integrals(x) do { } while (0)
|
||||
#define acct_clear_integrals(task) do { } while (0)
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
#define _ADFS_FS_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/magic.h>
|
||||
|
||||
/*
|
||||
* Disc Record at disc address 0xc00
|
||||
|
|
@ -38,7 +39,6 @@ struct adfs_discrecord {
|
|||
#define ADFS_DR_OFFSET (0x1c0)
|
||||
#define ADFS_DR_SIZE 60
|
||||
#define ADFS_DR_SIZE_BITS (ADFS_DR_SIZE << 3)
|
||||
#define ADFS_SUPER_MAGIC 0xadf5
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/adfs_fs_i.h>
|
||||
|
|
|
|||
24
include/linux/aer.h
Normal file
24
include/linux/aer.h
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* Copyright (C) 2006 Intel Corp.
|
||||
* Tom Long Nguyen (tom.l.nguyen@intel.com)
|
||||
* Zhang Yanmin (yanmin.zhang@intel.com)
|
||||
*/
|
||||
|
||||
#ifndef _AER_H_
|
||||
#define _AER_H_
|
||||
|
||||
#if defined(CONFIG_PCIEAER)
|
||||
/* pci-e port driver needs this function to enable aer */
|
||||
extern int pci_enable_pcie_error_reporting(struct pci_dev *dev);
|
||||
extern int pci_find_aer_capability(struct pci_dev *dev);
|
||||
extern int pci_disable_pcie_error_reporting(struct pci_dev *dev);
|
||||
extern int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev);
|
||||
#else
|
||||
#define pci_enable_pcie_error_reporting(dev) do { } while (0)
|
||||
#define pci_find_aer_capability(dev) do { } while (0)
|
||||
#define pci_disable_pcie_error_reporting(dev) do { } while (0)
|
||||
#define pci_cleanup_aer_uncorrect_error_status(dev) do { } while (0)
|
||||
#endif
|
||||
|
||||
#endif //_AER_H_
|
||||
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
#ifndef _AFFS_FS_H
|
||||
#define _AFFS_FS_H
|
||||
/*
|
||||
* The affs filesystem constants/structures
|
||||
*/
|
||||
#define AFFS_SUPER_MAGIC 0xadff
|
||||
#endif
|
||||
|
|
@ -4,8 +4,10 @@
|
|||
#include <linux/list.h>
|
||||
#include <linux/workqueue.h>
|
||||
#include <linux/aio_abi.h>
|
||||
#include <linux/uio.h>
|
||||
|
||||
#include <asm/atomic.h>
|
||||
#include <linux/uio.h>
|
||||
|
||||
#define AIO_MAXSEGS 4
|
||||
#define AIO_KIOGRP_NR_ATOMIC 8
|
||||
|
|
@ -110,8 +112,10 @@ struct kiocb {
|
|||
char __user *ki_buf; /* remaining iocb->aio_buf */
|
||||
size_t ki_left; /* remaining bytes */
|
||||
long ki_retried; /* just for testing */
|
||||
long ki_kicked; /* just for testing */
|
||||
long ki_queued; /* just for testing */
|
||||
struct iovec ki_inline_vec; /* inline vector */
|
||||
struct iovec *ki_iovec;
|
||||
unsigned long ki_nr_segs;
|
||||
unsigned long ki_cur_seg;
|
||||
|
||||
struct list_head ki_list; /* the aio core uses this
|
||||
* for cancellation */
|
||||
|
|
@ -213,11 +217,11 @@ int FASTCALL(io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb,
|
|||
struct iocb *iocb));
|
||||
|
||||
#define get_ioctx(kioctx) do { \
|
||||
BUG_ON(unlikely(atomic_read(&(kioctx)->users) <= 0)); \
|
||||
BUG_ON(atomic_read(&(kioctx)->users) <= 0); \
|
||||
atomic_inc(&(kioctx)->users); \
|
||||
} while (0)
|
||||
#define put_ioctx(kioctx) do { \
|
||||
BUG_ON(unlikely(atomic_read(&(kioctx)->users) <= 0)); \
|
||||
BUG_ON(atomic_read(&(kioctx)->users) <= 0); \
|
||||
if (unlikely(atomic_dec_and_test(&(kioctx)->users))) \
|
||||
__put_ioctx(kioctx); \
|
||||
} while (0)
|
||||
|
|
|
|||
|
|
@ -41,6 +41,8 @@ enum {
|
|||
* IOCB_CMD_POLL = 5,
|
||||
*/
|
||||
IOCB_CMD_NOOP = 6,
|
||||
IOCB_CMD_PREADV = 7,
|
||||
IOCB_CMD_PWRITEV = 8,
|
||||
};
|
||||
|
||||
/* read() from /dev/aio returns these structures. */
|
||||
|
|
|
|||
|
|
@ -40,6 +40,8 @@ enum {
|
|||
ATA_MAX_DEVICES = 2, /* per bus/port */
|
||||
ATA_MAX_PRD = 256, /* we could make these 256/256 */
|
||||
ATA_SECT_SIZE = 512,
|
||||
ATA_MAX_SECTORS = 256,
|
||||
ATA_MAX_SECTORS_LBA48 = 65535,/* TODO: 65536? */
|
||||
|
||||
ATA_ID_WORDS = 256,
|
||||
ATA_ID_SERNO_OFS = 10,
|
||||
|
|
@ -168,12 +170,16 @@ enum {
|
|||
XFER_UDMA_2 = 0x42,
|
||||
XFER_UDMA_1 = 0x41,
|
||||
XFER_UDMA_0 = 0x40,
|
||||
XFER_MW_DMA_4 = 0x24, /* CFA only */
|
||||
XFER_MW_DMA_3 = 0x23, /* CFA only */
|
||||
XFER_MW_DMA_2 = 0x22,
|
||||
XFER_MW_DMA_1 = 0x21,
|
||||
XFER_MW_DMA_0 = 0x20,
|
||||
XFER_SW_DMA_2 = 0x12,
|
||||
XFER_SW_DMA_1 = 0x11,
|
||||
XFER_SW_DMA_0 = 0x10,
|
||||
XFER_PIO_6 = 0x0E, /* CFA only */
|
||||
XFER_PIO_5 = 0x0D, /* CFA only */
|
||||
XFER_PIO_4 = 0x0C,
|
||||
XFER_PIO_3 = 0x0B,
|
||||
XFER_PIO_2 = 0x0A,
|
||||
|
|
@ -272,7 +278,6 @@ struct ata_taskfile {
|
|||
};
|
||||
|
||||
#define ata_id_is_ata(id) (((id)[0] & (1 << 15)) == 0)
|
||||
#define ata_id_is_cfa(id) ((id)[0] == 0x848A)
|
||||
#define ata_id_is_sata(id) ((id)[93] == 0)
|
||||
#define ata_id_rahead_enabled(id) ((id)[85] & (1 << 6))
|
||||
#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)
|
|||
{
|
||||
unsigned int mver;
|
||||
|
||||
if (id[ATA_ID_MAJOR_VER] == 0xFFFF)
|
||||
return 0;
|
||||
|
||||
for (mver = 14; mver >= 1; mver--)
|
||||
if (id[ATA_ID_MAJOR_VER] & (1 << mver))
|
||||
break;
|
||||
|
|
@ -312,8 +320,8 @@ static inline unsigned int ata_id_major_version(const u16 *id)
|
|||
|
||||
static inline int ata_id_current_chs_valid(const u16 *id)
|
||||
{
|
||||
/* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command
|
||||
has not been issued to the device then the values of
|
||||
/* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command
|
||||
has not been issued to the device then the values of
|
||||
id[54] to id[56] are vendor specific. */
|
||||
return (id[53] & 0x01) && /* Current translation valid */
|
||||
id[54] && /* cylinders in current translation */
|
||||
|
|
@ -322,6 +330,18 @@ static inline int ata_id_current_chs_valid(const u16 *id)
|
|||
id[56]; /* sectors in current translation */
|
||||
}
|
||||
|
||||
static inline int ata_id_is_cfa(const u16 *id)
|
||||
{
|
||||
u16 v = id[0];
|
||||
if (v == 0x848A) /* Standard CF */
|
||||
return 1;
|
||||
/* Could be CF hiding as standard ATA */
|
||||
if (ata_id_major_version(id) >= 3 && id[82] != 0xFFFF &&
|
||||
(id[82] & ( 1 << 2)))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int atapi_cdb_len(const u16 *dev_id)
|
||||
{
|
||||
u16 tmp = dev_id[0] & 0x3;
|
||||
|
|
|
|||
|
|
@ -88,15 +88,7 @@ static inline struct atalk_sock *at_sk(struct sock *sk)
|
|||
#include <asm/byteorder.h>
|
||||
|
||||
struct ddpehdr {
|
||||
#ifdef __LITTLE_ENDIAN_BITFIELD
|
||||
__u16 deh_len:10,
|
||||
deh_hops:4,
|
||||
deh_pad:2;
|
||||
#else
|
||||
__u16 deh_pad:2,
|
||||
deh_hops:4,
|
||||
deh_len:10;
|
||||
#endif
|
||||
__be16 deh_len_hops; /* lower 10 bits are length, next 4 - hops */
|
||||
__be16 deh_sum;
|
||||
__be16 deh_dnet;
|
||||
__be16 deh_snet;
|
||||
|
|
@ -112,36 +104,6 @@ static __inline__ struct ddpehdr *ddp_hdr(struct sk_buff *skb)
|
|||
return (struct ddpehdr *)skb->h.raw;
|
||||
}
|
||||
|
||||
/*
|
||||
* Don't drop the struct into the struct above. You'll get some
|
||||
* surprise padding.
|
||||
*/
|
||||
struct ddpebits {
|
||||
#ifdef __LITTLE_ENDIAN_BITFIELD
|
||||
__u16 deh_len:10,
|
||||
deh_hops:4,
|
||||
deh_pad:2;
|
||||
#else
|
||||
__u16 deh_pad:2,
|
||||
deh_hops:4,
|
||||
deh_len:10;
|
||||
#endif
|
||||
};
|
||||
|
||||
/* Short form header */
|
||||
struct ddpshdr {
|
||||
#ifdef __LITTLE_ENDIAN_BITFIELD
|
||||
__u16 dsh_len:10,
|
||||
dsh_pad:6;
|
||||
#else
|
||||
__u16 dsh_pad:6,
|
||||
dsh_len:10;
|
||||
#endif
|
||||
__u8 dsh_dport;
|
||||
__u8 dsh_sport;
|
||||
/* And netatalk apps expect to stick the type in themselves */
|
||||
};
|
||||
|
||||
/* AppleTalk AARP headers */
|
||||
struct elapaarp {
|
||||
__be16 hw_type;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
/*
|
||||
*
|
||||
* ATM Lan Emulation Daemon vs. driver interface
|
||||
*
|
||||
* mkiiskila@yahoo.com
|
||||
* ATM Lan Emulation Daemon driver interface
|
||||
*
|
||||
* Marko Kiiskila <mkiiskila@yahoo.com>
|
||||
*/
|
||||
|
||||
#ifndef _ATMLEC_H_
|
||||
|
|
@ -13,76 +11,87 @@
|
|||
#include <linux/atmioc.h>
|
||||
#include <linux/atm.h>
|
||||
#include <linux/if_ether.h>
|
||||
|
||||
/* ATM lec daemon control socket */
|
||||
#define ATMLEC_CTRL _IO('a',ATMIOC_LANE)
|
||||
#define ATMLEC_DATA _IO('a',ATMIOC_LANE+1)
|
||||
#define ATMLEC_MCAST _IO('a',ATMIOC_LANE+2)
|
||||
#define ATMLEC_CTRL _IO('a', ATMIOC_LANE)
|
||||
#define ATMLEC_DATA _IO('a', ATMIOC_LANE+1)
|
||||
#define ATMLEC_MCAST _IO('a', ATMIOC_LANE+2)
|
||||
|
||||
/* Maximum number of LEC interfaces (tweakable) */
|
||||
#define MAX_LEC_ITF 48
|
||||
|
||||
/* From the total of MAX_LEC_ITF, last NUM_TR_DEVS are reserved for Token Ring.
|
||||
/*
|
||||
* From the total of MAX_LEC_ITF, last NUM_TR_DEVS are reserved for Token Ring.
|
||||
* E.g. if MAX_LEC_ITF = 48 and NUM_TR_DEVS = 8, then lec0-lec39 are for
|
||||
* Ethernet ELANs and lec40-lec47 are for Token Ring ELANS.
|
||||
*/
|
||||
#define NUM_TR_DEVS 8
|
||||
|
||||
typedef enum {
|
||||
l_set_mac_addr, l_del_mac_addr,
|
||||
l_svc_setup,
|
||||
l_addr_delete, l_topology_change,
|
||||
l_flush_complete, l_arp_update,
|
||||
l_narp_req, /* LANE2 mandates the use of this */
|
||||
l_config, l_flush_tran_id,
|
||||
l_set_lecid, l_arp_xmt,
|
||||
l_rdesc_arp_xmt,
|
||||
l_associate_req,
|
||||
l_should_bridge /* should we bridge this MAC? */
|
||||
typedef enum {
|
||||
l_set_mac_addr,
|
||||
l_del_mac_addr,
|
||||
l_svc_setup,
|
||||
l_addr_delete,
|
||||
l_topology_change,
|
||||
l_flush_complete,
|
||||
l_arp_update,
|
||||
l_narp_req, /* LANE2 mandates the use of this */
|
||||
l_config,
|
||||
l_flush_tran_id,
|
||||
l_set_lecid,
|
||||
l_arp_xmt,
|
||||
l_rdesc_arp_xmt,
|
||||
l_associate_req,
|
||||
l_should_bridge /* should we bridge this MAC? */
|
||||
} atmlec_msg_type;
|
||||
|
||||
#define ATMLEC_MSG_TYPE_MAX l_should_bridge
|
||||
|
||||
struct atmlec_config_msg {
|
||||
unsigned int maximum_unknown_frame_count;
|
||||
unsigned int max_unknown_frame_time;
|
||||
unsigned short max_retry_count;
|
||||
unsigned int aging_time;
|
||||
unsigned int forward_delay_time;
|
||||
unsigned int arp_response_time;
|
||||
unsigned int flush_timeout;
|
||||
unsigned int path_switching_delay;
|
||||
unsigned int lane_version; /* LANE2: 1 for LANEv1, 2 for LANEv2 */
|
||||
int mtu;
|
||||
int is_proxy;
|
||||
unsigned int maximum_unknown_frame_count;
|
||||
unsigned int max_unknown_frame_time;
|
||||
unsigned short max_retry_count;
|
||||
unsigned int aging_time;
|
||||
unsigned int forward_delay_time;
|
||||
unsigned int arp_response_time;
|
||||
unsigned int flush_timeout;
|
||||
unsigned int path_switching_delay;
|
||||
unsigned int lane_version; /* LANE2: 1 for LANEv1, 2 for LANEv2 */
|
||||
int mtu;
|
||||
int is_proxy;
|
||||
};
|
||||
|
||||
|
||||
struct atmlec_msg {
|
||||
atmlec_msg_type type;
|
||||
int sizeoftlvs; /* LANE2: if != 0, tlvs follow */
|
||||
union {
|
||||
struct {
|
||||
unsigned char mac_addr[ETH_ALEN];
|
||||
unsigned char atm_addr[ATM_ESA_LEN];
|
||||
unsigned int flag;/* Topology_change flag,
|
||||
remoteflag, permanent flag,
|
||||
lecid, transaction id */
|
||||
unsigned int targetless_le_arp; /* LANE2 */
|
||||
unsigned int no_source_le_narp; /* LANE2 */
|
||||
} normal;
|
||||
struct atmlec_config_msg config;
|
||||
struct {
|
||||
uint16_t lec_id; /* requestor lec_id */
|
||||
uint32_t tran_id; /* transaction id */
|
||||
unsigned char mac_addr[ETH_ALEN]; /* dst mac addr */
|
||||
unsigned char atm_addr[ATM_ESA_LEN]; /* reqestor ATM addr */
|
||||
} proxy;
|
||||
/* For mapping LE_ARP requests to responses. Filled by */
|
||||
} content; /* zeppelin, returned by kernel. Used only when proxying */
|
||||
atmlec_msg_type type;
|
||||
int sizeoftlvs; /* LANE2: if != 0, tlvs follow */
|
||||
union {
|
||||
struct {
|
||||
unsigned char mac_addr[ETH_ALEN];
|
||||
unsigned char atm_addr[ATM_ESA_LEN];
|
||||
unsigned int flag; /*
|
||||
* Topology_change flag,
|
||||
* remoteflag, permanent flag,
|
||||
* lecid, transaction id
|
||||
*/
|
||||
unsigned int targetless_le_arp; /* LANE2 */
|
||||
unsigned int no_source_le_narp; /* LANE2 */
|
||||
} normal;
|
||||
struct atmlec_config_msg config;
|
||||
struct {
|
||||
uint16_t lec_id; /* requestor lec_id */
|
||||
uint32_t tran_id; /* transaction id */
|
||||
unsigned char mac_addr[ETH_ALEN]; /* dst mac addr */
|
||||
unsigned char atm_addr[ATM_ESA_LEN]; /* reqestor ATM addr */
|
||||
} proxy; /*
|
||||
* For mapping LE_ARP requests to responses. Filled by
|
||||
* zeppelin, returned by kernel. Used only when proxying
|
||||
*/
|
||||
} content;
|
||||
} __ATM_API_ALIGN;
|
||||
|
||||
struct atmlec_ioc {
|
||||
int dev_num;
|
||||
unsigned char atm_addr[ATM_ESA_LEN];
|
||||
unsigned char receive; /* 1= receive vcc, 0 = send vcc */
|
||||
int dev_num;
|
||||
unsigned char atm_addr[ATM_ESA_LEN];
|
||||
unsigned char receive; /* 1= receive vcc, 0 = send vcc */
|
||||
};
|
||||
#endif /* _ATMLEC_H_ */
|
||||
|
|
|
|||
|
|
@ -95,6 +95,11 @@
|
|||
#define AUDIT_MAC_POLICY_LOAD 1403 /* Policy file load */
|
||||
#define AUDIT_MAC_STATUS 1404 /* Changed enforcing,permissive,off */
|
||||
#define AUDIT_MAC_CONFIG_CHANGE 1405 /* Changes to booleans */
|
||||
#define AUDIT_MAC_UNLBL_ALLOW 1406 /* NetLabel: allow unlabeled traffic */
|
||||
#define AUDIT_MAC_CIPSOV4_ADD 1407 /* NetLabel: add CIPSOv4 DOI entry */
|
||||
#define AUDIT_MAC_CIPSOV4_DEL 1408 /* NetLabel: del CIPSOv4 DOI entry */
|
||||
#define AUDIT_MAC_MAP_ADD 1409 /* NetLabel: add LSM domain mapping */
|
||||
#define AUDIT_MAC_MAP_DEL 1410 /* NetLabel: del LSM domain mapping */
|
||||
|
||||
#define AUDIT_FIRST_KERN_ANOM_MSG 1700
|
||||
#define AUDIT_LAST_KERN_ANOM_MSG 1799
|
||||
|
|
|
|||
|
|
@ -148,6 +148,7 @@ struct bio {
|
|||
#define BIO_RW_BARRIER 2
|
||||
#define BIO_RW_FAILFAST 3
|
||||
#define BIO_RW_SYNC 4
|
||||
#define BIO_RW_META 5
|
||||
|
||||
/*
|
||||
* upper 16 bits of bi_rw define the io priority of this bio
|
||||
|
|
@ -178,6 +179,7 @@ struct bio {
|
|||
#define bio_sync(bio) ((bio)->bi_rw & (1 << BIO_RW_SYNC))
|
||||
#define bio_failfast(bio) ((bio)->bi_rw & (1 << BIO_RW_FAILFAST))
|
||||
#define bio_rw_ahead(bio) ((bio)->bi_rw & (1 << BIO_RW_AHEAD))
|
||||
#define bio_rw_meta(bio) ((bio)->bi_rw & (1 << BIO_RW_META))
|
||||
|
||||
/*
|
||||
* will die
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#ifndef _LINUX_BLKDEV_H
|
||||
#define _LINUX_BLKDEV_H
|
||||
|
||||
#include <linux/sched.h>
|
||||
#include <linux/major.h>
|
||||
#include <linux/genhd.h>
|
||||
#include <linux/list.h>
|
||||
|
|
@ -16,6 +17,22 @@
|
|||
|
||||
#include <asm/scatterlist.h>
|
||||
|
||||
#ifdef CONFIG_LBD
|
||||
# include <asm/div64.h>
|
||||
# define sector_div(a, b) do_div(a, b)
|
||||
#else
|
||||
# define sector_div(n, b)( \
|
||||
{ \
|
||||
int _res; \
|
||||
_res = (n) % (b); \
|
||||
(n) /= (b); \
|
||||
_res; \
|
||||
} \
|
||||
)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BLOCK
|
||||
|
||||
struct scsi_ioctl_command;
|
||||
|
||||
struct request_queue;
|
||||
|
|
@ -90,7 +107,7 @@ struct io_context {
|
|||
atomic_t refcount;
|
||||
struct task_struct *task;
|
||||
|
||||
int (*set_ioprio)(struct io_context *, unsigned int);
|
||||
unsigned int ioprio_changed;
|
||||
|
||||
/*
|
||||
* For request batching
|
||||
|
|
@ -104,8 +121,7 @@ struct io_context {
|
|||
|
||||
void put_io_context(struct io_context *ioc);
|
||||
void exit_io_context(void);
|
||||
struct io_context *current_io_context(gfp_t gfp_flags);
|
||||
struct io_context *get_io_context(gfp_t gfp_flags);
|
||||
struct io_context *get_io_context(gfp_t gfp_flags, int node);
|
||||
void copy_io_context(struct io_context **pdst, struct io_context **psrc);
|
||||
void swap_io_context(struct io_context **ioc1, struct io_context **ioc2);
|
||||
|
||||
|
|
@ -120,6 +136,90 @@ struct request_list {
|
|||
wait_queue_head_t wait[2];
|
||||
};
|
||||
|
||||
/*
|
||||
* request command types
|
||||
*/
|
||||
enum rq_cmd_type_bits {
|
||||
REQ_TYPE_FS = 1, /* fs request */
|
||||
REQ_TYPE_BLOCK_PC, /* scsi command */
|
||||
REQ_TYPE_SENSE, /* sense request */
|
||||
REQ_TYPE_PM_SUSPEND, /* suspend request */
|
||||
REQ_TYPE_PM_RESUME, /* resume request */
|
||||
REQ_TYPE_PM_SHUTDOWN, /* shutdown request */
|
||||
REQ_TYPE_FLUSH, /* flush request */
|
||||
REQ_TYPE_SPECIAL, /* driver defined type */
|
||||
REQ_TYPE_LINUX_BLOCK, /* generic block layer message */
|
||||
/*
|
||||
* for ATA/ATAPI devices. this really doesn't belong here, ide should
|
||||
* use REQ_TYPE_SPECIAL and use rq->cmd[0] with the range of driver
|
||||
* private REQ_LB opcodes to differentiate what type of request this is
|
||||
*/
|
||||
REQ_TYPE_ATA_CMD,
|
||||
REQ_TYPE_ATA_TASK,
|
||||
REQ_TYPE_ATA_TASKFILE,
|
||||
};
|
||||
|
||||
/*
|
||||
* For request of type REQ_TYPE_LINUX_BLOCK, rq->cmd[0] is the opcode being
|
||||
* sent down (similar to how REQ_TYPE_BLOCK_PC means that ->cmd[] holds a
|
||||
* SCSI cdb.
|
||||
*
|
||||
* 0x00 -> 0x3f are driver private, to be used for whatever purpose they need,
|
||||
* typically to differentiate REQ_TYPE_SPECIAL requests.
|
||||
*
|
||||
*/
|
||||
enum {
|
||||
/*
|
||||
* just examples for now
|
||||
*/
|
||||
REQ_LB_OP_EJECT = 0x40, /* eject request */
|
||||
REQ_LB_OP_FLUSH = 0x41, /* flush device */
|
||||
};
|
||||
|
||||
/*
|
||||
* request type modified bits. first three bits match BIO_RW* bits, important
|
||||
*/
|
||||
enum rq_flag_bits {
|
||||
__REQ_RW, /* not set, read. set, write */
|
||||
__REQ_FAILFAST, /* no low level driver retries */
|
||||
__REQ_SORTED, /* elevator knows about this request */
|
||||
__REQ_SOFTBARRIER, /* may not be passed by ioscheduler */
|
||||
__REQ_HARDBARRIER, /* may not be passed by drive either */
|
||||
__REQ_FUA, /* forced unit access */
|
||||
__REQ_NOMERGE, /* don't touch this for merging */
|
||||
__REQ_STARTED, /* drive already may have started this one */
|
||||
__REQ_DONTPREP, /* don't call prep for this one */
|
||||
__REQ_QUEUED, /* uses queueing */
|
||||
__REQ_ELVPRIV, /* elevator private data attached */
|
||||
__REQ_FAILED, /* set if the request failed */
|
||||
__REQ_QUIET, /* don't worry about errors */
|
||||
__REQ_PREEMPT, /* set for "ide_preempt" requests */
|
||||
__REQ_ORDERED_COLOR, /* is before or after barrier */
|
||||
__REQ_RW_SYNC, /* request is sync (O_DIRECT) */
|
||||
__REQ_ALLOCED, /* request came from our alloc pool */
|
||||
__REQ_RW_META, /* metadata io request */
|
||||
__REQ_NR_BITS, /* stops here */
|
||||
};
|
||||
|
||||
#define REQ_RW (1 << __REQ_RW)
|
||||
#define REQ_FAILFAST (1 << __REQ_FAILFAST)
|
||||
#define REQ_SORTED (1 << __REQ_SORTED)
|
||||
#define REQ_SOFTBARRIER (1 << __REQ_SOFTBARRIER)
|
||||
#define REQ_HARDBARRIER (1 << __REQ_HARDBARRIER)
|
||||
#define REQ_FUA (1 << __REQ_FUA)
|
||||
#define REQ_NOMERGE (1 << __REQ_NOMERGE)
|
||||
#define REQ_STARTED (1 << __REQ_STARTED)
|
||||
#define REQ_DONTPREP (1 << __REQ_DONTPREP)
|
||||
#define REQ_QUEUED (1 << __REQ_QUEUED)
|
||||
#define REQ_ELVPRIV (1 << __REQ_ELVPRIV)
|
||||
#define REQ_FAILED (1 << __REQ_FAILED)
|
||||
#define REQ_QUIET (1 << __REQ_QUIET)
|
||||
#define REQ_PREEMPT (1 << __REQ_PREEMPT)
|
||||
#define REQ_ORDERED_COLOR (1 << __REQ_ORDERED_COLOR)
|
||||
#define REQ_RW_SYNC (1 << __REQ_RW_SYNC)
|
||||
#define REQ_ALLOCED (1 << __REQ_ALLOCED)
|
||||
#define REQ_RW_META (1 << __REQ_RW_META)
|
||||
|
||||
#define BLK_MAX_CDB 16
|
||||
|
||||
/*
|
||||
|
|
@ -129,30 +229,46 @@ struct request {
|
|||
struct list_head queuelist;
|
||||
struct list_head donelist;
|
||||
|
||||
unsigned long flags; /* see REQ_ bits below */
|
||||
request_queue_t *q;
|
||||
|
||||
unsigned int cmd_flags;
|
||||
enum rq_cmd_type_bits cmd_type;
|
||||
|
||||
/* Maintain bio traversal state for part by part I/O submission.
|
||||
* hard_* are block layer internals, no driver should touch them!
|
||||
*/
|
||||
|
||||
sector_t sector; /* next sector to submit */
|
||||
sector_t hard_sector; /* next sector to complete */
|
||||
unsigned long nr_sectors; /* no. of sectors left to submit */
|
||||
unsigned long hard_nr_sectors; /* no. of sectors left to complete */
|
||||
/* no. of sectors left to submit in the current segment */
|
||||
unsigned int current_nr_sectors;
|
||||
|
||||
sector_t hard_sector; /* next sector to complete */
|
||||
unsigned long hard_nr_sectors; /* no. of sectors left to complete */
|
||||
/* no. of sectors left to complete in the current segment */
|
||||
unsigned int hard_cur_sectors;
|
||||
|
||||
struct bio *bio;
|
||||
struct bio *biotail;
|
||||
|
||||
void *elevator_private;
|
||||
void *completion_data;
|
||||
struct hlist_node hash; /* merge hash */
|
||||
/*
|
||||
* The rb_node is only used inside the io scheduler, requests
|
||||
* are pruned when moved to the dispatch queue. So let the
|
||||
* completion_data share space with the rb_node.
|
||||
*/
|
||||
union {
|
||||
struct rb_node rb_node; /* sort/lookup */
|
||||
void *completion_data;
|
||||
};
|
||||
|
||||
/*
|
||||
* two pointers are available for the IO schedulers, if they need
|
||||
* more they have to dynamically allocate it.
|
||||
*/
|
||||
void *elevator_private;
|
||||
void *elevator_private2;
|
||||
|
||||
int rq_status; /* should split this into a few status bits */
|
||||
int errors;
|
||||
struct gendisk *rq_disk;
|
||||
unsigned long start_time;
|
||||
|
||||
|
|
@ -170,16 +286,14 @@ struct request {
|
|||
|
||||
unsigned short ioprio;
|
||||
|
||||
int tag;
|
||||
|
||||
int ref_count;
|
||||
request_queue_t *q;
|
||||
struct request_list *rl;
|
||||
|
||||
struct completion *waiting;
|
||||
void *special;
|
||||
char *buffer;
|
||||
|
||||
int tag;
|
||||
int errors;
|
||||
|
||||
int ref_count;
|
||||
|
||||
/*
|
||||
* when request is used as a packet command carrier
|
||||
*/
|
||||
|
|
@ -195,80 +309,14 @@ struct request {
|
|||
int retries;
|
||||
|
||||
/*
|
||||
* completion callback. end_io_data should be folded in with waiting
|
||||
* completion callback.
|
||||
*/
|
||||
rq_end_io_fn *end_io;
|
||||
void *end_io_data;
|
||||
};
|
||||
|
||||
/*
|
||||
* first three bits match BIO_RW* bits, important
|
||||
*/
|
||||
enum rq_flag_bits {
|
||||
__REQ_RW, /* not set, read. set, write */
|
||||
__REQ_FAILFAST, /* no low level driver retries */
|
||||
__REQ_SORTED, /* elevator knows about this request */
|
||||
__REQ_SOFTBARRIER, /* may not be passed by ioscheduler */
|
||||
__REQ_HARDBARRIER, /* may not be passed by drive either */
|
||||
__REQ_FUA, /* forced unit access */
|
||||
__REQ_CMD, /* is a regular fs rw request */
|
||||
__REQ_NOMERGE, /* don't touch this for merging */
|
||||
__REQ_STARTED, /* drive already may have started this one */
|
||||
__REQ_DONTPREP, /* don't call prep for this one */
|
||||
__REQ_QUEUED, /* uses queueing */
|
||||
__REQ_ELVPRIV, /* elevator private data attached */
|
||||
/*
|
||||
* for ATA/ATAPI devices
|
||||
*/
|
||||
__REQ_PC, /* packet command (special) */
|
||||
__REQ_BLOCK_PC, /* queued down pc from block layer */
|
||||
__REQ_SENSE, /* sense retrival */
|
||||
|
||||
__REQ_FAILED, /* set if the request failed */
|
||||
__REQ_QUIET, /* don't worry about errors */
|
||||
__REQ_SPECIAL, /* driver suplied command */
|
||||
__REQ_DRIVE_CMD,
|
||||
__REQ_DRIVE_TASK,
|
||||
__REQ_DRIVE_TASKFILE,
|
||||
__REQ_PREEMPT, /* set for "ide_preempt" requests */
|
||||
__REQ_PM_SUSPEND, /* suspend request */
|
||||
__REQ_PM_RESUME, /* resume request */
|
||||
__REQ_PM_SHUTDOWN, /* shutdown request */
|
||||
__REQ_ORDERED_COLOR, /* is before or after barrier */
|
||||
__REQ_RW_SYNC, /* request is sync (O_DIRECT) */
|
||||
__REQ_NR_BITS, /* stops here */
|
||||
};
|
||||
|
||||
#define REQ_RW (1 << __REQ_RW)
|
||||
#define REQ_FAILFAST (1 << __REQ_FAILFAST)
|
||||
#define REQ_SORTED (1 << __REQ_SORTED)
|
||||
#define REQ_SOFTBARRIER (1 << __REQ_SOFTBARRIER)
|
||||
#define REQ_HARDBARRIER (1 << __REQ_HARDBARRIER)
|
||||
#define REQ_FUA (1 << __REQ_FUA)
|
||||
#define REQ_CMD (1 << __REQ_CMD)
|
||||
#define REQ_NOMERGE (1 << __REQ_NOMERGE)
|
||||
#define REQ_STARTED (1 << __REQ_STARTED)
|
||||
#define REQ_DONTPREP (1 << __REQ_DONTPREP)
|
||||
#define REQ_QUEUED (1 << __REQ_QUEUED)
|
||||
#define REQ_ELVPRIV (1 << __REQ_ELVPRIV)
|
||||
#define REQ_PC (1 << __REQ_PC)
|
||||
#define REQ_BLOCK_PC (1 << __REQ_BLOCK_PC)
|
||||
#define REQ_SENSE (1 << __REQ_SENSE)
|
||||
#define REQ_FAILED (1 << __REQ_FAILED)
|
||||
#define REQ_QUIET (1 << __REQ_QUIET)
|
||||
#define REQ_SPECIAL (1 << __REQ_SPECIAL)
|
||||
#define REQ_DRIVE_CMD (1 << __REQ_DRIVE_CMD)
|
||||
#define REQ_DRIVE_TASK (1 << __REQ_DRIVE_TASK)
|
||||
#define REQ_DRIVE_TASKFILE (1 << __REQ_DRIVE_TASKFILE)
|
||||
#define REQ_PREEMPT (1 << __REQ_PREEMPT)
|
||||
#define REQ_PM_SUSPEND (1 << __REQ_PM_SUSPEND)
|
||||
#define REQ_PM_RESUME (1 << __REQ_PM_RESUME)
|
||||
#define REQ_PM_SHUTDOWN (1 << __REQ_PM_SHUTDOWN)
|
||||
#define REQ_ORDERED_COLOR (1 << __REQ_ORDERED_COLOR)
|
||||
#define REQ_RW_SYNC (1 << __REQ_RW_SYNC)
|
||||
|
||||
/*
|
||||
* State information carried for REQ_PM_SUSPEND and REQ_PM_RESUME
|
||||
* State information carried for REQ_TYPE_PM_SUSPEND and REQ_TYPE_PM_RESUME
|
||||
* requests. Some step values could eventually be made generic.
|
||||
*/
|
||||
struct request_pm_state
|
||||
|
|
@ -417,9 +465,9 @@ struct request_queue
|
|||
unsigned int sg_timeout;
|
||||
unsigned int sg_reserved_size;
|
||||
int node;
|
||||
|
||||
#ifdef CONFIG_BLK_DEV_IO_TRACE
|
||||
struct blk_trace *blk_trace;
|
||||
|
||||
#endif
|
||||
/*
|
||||
* reserved for flush operations
|
||||
*/
|
||||
|
|
@ -432,9 +480,6 @@ struct request_queue
|
|||
struct mutex sysfs_lock;
|
||||
};
|
||||
|
||||
#define RQ_INACTIVE (-1)
|
||||
#define RQ_ACTIVE 1
|
||||
|
||||
#define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */
|
||||
#define QUEUE_FLAG_QUEUED 1 /* uses generic tag queueing */
|
||||
#define QUEUE_FLAG_STOPPED 2 /* queue is stopped */
|
||||
|
|
@ -490,25 +535,34 @@ enum {
|
|||
#define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags)
|
||||
#define blk_queue_flushing(q) ((q)->ordseq)
|
||||
|
||||
#define blk_fs_request(rq) ((rq)->flags & REQ_CMD)
|
||||
#define blk_pc_request(rq) ((rq)->flags & REQ_BLOCK_PC)
|
||||
#define blk_noretry_request(rq) ((rq)->flags & REQ_FAILFAST)
|
||||
#define blk_rq_started(rq) ((rq)->flags & REQ_STARTED)
|
||||
#define blk_fs_request(rq) ((rq)->cmd_type == REQ_TYPE_FS)
|
||||
#define blk_pc_request(rq) ((rq)->cmd_type == REQ_TYPE_BLOCK_PC)
|
||||
#define blk_special_request(rq) ((rq)->cmd_type == REQ_TYPE_SPECIAL)
|
||||
#define blk_sense_request(rq) ((rq)->cmd_type == REQ_TYPE_SENSE)
|
||||
|
||||
#define blk_noretry_request(rq) ((rq)->cmd_flags & REQ_FAILFAST)
|
||||
#define blk_rq_started(rq) ((rq)->cmd_flags & REQ_STARTED)
|
||||
|
||||
#define blk_account_rq(rq) (blk_rq_started(rq) && blk_fs_request(rq))
|
||||
|
||||
#define blk_pm_suspend_request(rq) ((rq)->flags & REQ_PM_SUSPEND)
|
||||
#define blk_pm_resume_request(rq) ((rq)->flags & REQ_PM_RESUME)
|
||||
#define blk_pm_suspend_request(rq) ((rq)->cmd_type == REQ_TYPE_PM_SUSPEND)
|
||||
#define blk_pm_resume_request(rq) ((rq)->cmd_type == REQ_TYPE_PM_RESUME)
|
||||
#define blk_pm_request(rq) \
|
||||
((rq)->flags & (REQ_PM_SUSPEND | REQ_PM_RESUME))
|
||||
(blk_pm_suspend_request(rq) || blk_pm_resume_request(rq))
|
||||
|
||||
#define blk_sorted_rq(rq) ((rq)->flags & REQ_SORTED)
|
||||
#define blk_barrier_rq(rq) ((rq)->flags & REQ_HARDBARRIER)
|
||||
#define blk_fua_rq(rq) ((rq)->flags & REQ_FUA)
|
||||
#define blk_sorted_rq(rq) ((rq)->cmd_flags & REQ_SORTED)
|
||||
#define blk_barrier_rq(rq) ((rq)->cmd_flags & REQ_HARDBARRIER)
|
||||
#define blk_fua_rq(rq) ((rq)->cmd_flags & REQ_FUA)
|
||||
|
||||
#define list_entry_rq(ptr) list_entry((ptr), struct request, queuelist)
|
||||
|
||||
#define rq_data_dir(rq) ((rq)->flags & 1)
|
||||
#define rq_data_dir(rq) ((rq)->cmd_flags & 1)
|
||||
|
||||
/*
|
||||
* We regard a request as sync, if it's a READ or a SYNC write.
|
||||
*/
|
||||
#define rq_is_sync(rq) (rq_data_dir((rq)) == READ || (rq)->cmd_flags & REQ_RW_SYNC)
|
||||
#define rq_is_meta(rq) ((rq)->cmd_flags & REQ_RW_META)
|
||||
|
||||
static inline int blk_queue_full(struct request_queue *q, int rw)
|
||||
{
|
||||
|
|
@ -541,13 +595,7 @@ static inline void blk_clear_queue_full(struct request_queue *q, int rw)
|
|||
#define RQ_NOMERGE_FLAGS \
|
||||
(REQ_NOMERGE | REQ_STARTED | REQ_HARDBARRIER | REQ_SOFTBARRIER)
|
||||
#define rq_mergeable(rq) \
|
||||
(!((rq)->flags & RQ_NOMERGE_FLAGS) && blk_fs_request((rq)))
|
||||
|
||||
/*
|
||||
* noop, requests are automagically marked as active/inactive by I/O
|
||||
* scheduler -- see elv_next_request
|
||||
*/
|
||||
#define blk_queue_headactive(q, head_active)
|
||||
(!((rq)->cmd_flags & RQ_NOMERGE_FLAGS) && blk_fs_request((rq)))
|
||||
|
||||
/*
|
||||
* q->prep_rq_fn return values
|
||||
|
|
@ -586,11 +634,6 @@ static inline void blk_queue_bounce(request_queue_t *q, struct bio **bio)
|
|||
if ((rq->bio)) \
|
||||
for (_bio = (rq)->bio; _bio; _bio = _bio->bi_next)
|
||||
|
||||
struct sec_size {
|
||||
unsigned block_size;
|
||||
unsigned block_size_bits;
|
||||
};
|
||||
|
||||
extern int blk_register_queue(struct gendisk *disk);
|
||||
extern void blk_unregister_queue(struct gendisk *disk);
|
||||
extern void register_disk(struct gendisk *dev);
|
||||
|
|
@ -612,6 +655,7 @@ extern void blk_stop_queue(request_queue_t *q);
|
|||
extern void blk_sync_queue(struct request_queue *q);
|
||||
extern void __blk_stop_queue(request_queue_t *q);
|
||||
extern void blk_run_queue(request_queue_t *);
|
||||
extern void blk_start_queueing(request_queue_t *);
|
||||
extern void blk_queue_activity_fn(request_queue_t *, activity_fn *, void *);
|
||||
extern int blk_rq_map_user(request_queue_t *, struct request *, void __user *, unsigned int);
|
||||
extern int blk_rq_unmap_user(struct bio *, unsigned int);
|
||||
|
|
@ -655,16 +699,6 @@ extern void end_that_request_last(struct request *, int);
|
|||
extern void end_request(struct request *req, int uptodate);
|
||||
extern void blk_complete_request(struct request *);
|
||||
|
||||
static inline int rq_all_done(struct request *rq, unsigned int nr_bytes)
|
||||
{
|
||||
if (blk_fs_request(rq))
|
||||
return (nr_bytes >= (rq->hard_nr_sectors << 9));
|
||||
else if (blk_pc_request(rq))
|
||||
return nr_bytes >= rq->data_len;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* end_that_request_first/chunk() takes an uptodate argument. we account
|
||||
* any value <= as an io error. 0 means -EIO for compatability reasons,
|
||||
|
|
@ -678,21 +712,6 @@ static inline void blkdev_dequeue_request(struct request *req)
|
|||
elv_dequeue_request(req->q, req);
|
||||
}
|
||||
|
||||
/*
|
||||
* This should be in elevator.h, but that requires pulling in rq and q
|
||||
*/
|
||||
static inline void elv_dispatch_add_tail(struct request_queue *q,
|
||||
struct request *rq)
|
||||
{
|
||||
if (q->last_merge == rq)
|
||||
q->last_merge = NULL;
|
||||
q->nr_sorted--;
|
||||
|
||||
q->end_sector = rq_end_sector(rq);
|
||||
q->boundary_rq = rq;
|
||||
list_add_tail(&rq->queuelist, &q->queue_head);
|
||||
}
|
||||
|
||||
/*
|
||||
* Access functions for manipulating queue properties
|
||||
*/
|
||||
|
|
@ -737,7 +756,7 @@ extern void blk_put_queue(request_queue_t *);
|
|||
*/
|
||||
#define blk_queue_tag_depth(q) ((q)->queue_tags->busy)
|
||||
#define blk_queue_tag_queue(q) ((q)->queue_tags->busy < (q)->queue_tags->max_depth)
|
||||
#define blk_rq_tagged(rq) ((rq)->flags & REQ_QUEUED)
|
||||
#define blk_rq_tagged(rq) ((rq)->cmd_flags & REQ_QUEUED)
|
||||
extern int blk_queue_start_tag(request_queue_t *, struct request *);
|
||||
extern struct request *blk_queue_find_tag(request_queue_t *, int);
|
||||
extern void blk_queue_end_tag(request_queue_t *, struct request *);
|
||||
|
|
@ -746,6 +765,9 @@ extern void blk_queue_free_tags(request_queue_t *);
|
|||
extern int blk_queue_resize_tags(request_queue_t *, int);
|
||||
extern void blk_queue_invalidate_tags(request_queue_t *);
|
||||
extern long blk_congestion_wait(int rw, long timeout);
|
||||
extern struct blk_queue_tag *blk_init_tags(int);
|
||||
extern void blk_free_tags(struct blk_queue_tag *);
|
||||
extern void blk_congestion_end(int rw);
|
||||
|
||||
extern void blk_rq_bio_prep(request_queue_t *, struct request *, struct bio *);
|
||||
extern int blkdev_issue_flush(struct block_device *, sector_t *);
|
||||
|
|
@ -784,14 +806,6 @@ static inline int queue_dma_alignment(request_queue_t *q)
|
|||
return retval;
|
||||
}
|
||||
|
||||
static inline int bdev_dma_aligment(struct block_device *bdev)
|
||||
{
|
||||
return queue_dma_alignment(bdev_get_queue(bdev));
|
||||
}
|
||||
|
||||
#define blk_finished_io(nsects) do { } while (0)
|
||||
#define blk_started_io(nsects) do { } while (0)
|
||||
|
||||
/* assumes size > 256 */
|
||||
static inline unsigned int blksize_bits(unsigned int size)
|
||||
{
|
||||
|
|
@ -821,24 +835,32 @@ struct work_struct;
|
|||
int kblockd_schedule_work(struct work_struct *work);
|
||||
void kblockd_flush(void);
|
||||
|
||||
#ifdef CONFIG_LBD
|
||||
# include <asm/div64.h>
|
||||
# define sector_div(a, b) do_div(a, b)
|
||||
#else
|
||||
# define sector_div(n, b)( \
|
||||
{ \
|
||||
int _res; \
|
||||
_res = (n) % (b); \
|
||||
(n) /= (b); \
|
||||
_res; \
|
||||
} \
|
||||
)
|
||||
#endif
|
||||
|
||||
#define MODULE_ALIAS_BLOCKDEV(major,minor) \
|
||||
MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor))
|
||||
#define MODULE_ALIAS_BLOCKDEV_MAJOR(major) \
|
||||
MODULE_ALIAS("block-major-" __stringify(major) "-*")
|
||||
|
||||
|
||||
#else /* CONFIG_BLOCK */
|
||||
/*
|
||||
* stubs for when the block layer is configured out
|
||||
*/
|
||||
#define buffer_heads_over_limit 0
|
||||
|
||||
static inline long blk_congestion_wait(int rw, long timeout)
|
||||
{
|
||||
return io_schedule_timeout(timeout);
|
||||
}
|
||||
|
||||
static inline long nr_blockdev_pages(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void exit_io_context(void)
|
||||
{
|
||||
}
|
||||
|
||||
#endif /* CONFIG_BLOCK */
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ enum blktrace_cat {
|
|||
BLK_TC_PC = 1 << 9, /* pc requests */
|
||||
BLK_TC_NOTIFY = 1 << 10, /* special message */
|
||||
BLK_TC_AHEAD = 1 << 11, /* readahead */
|
||||
BLK_TC_META = 1 << 12, /* metadata */
|
||||
|
||||
BLK_TC_END = 1 << 15, /* only 16-bits, reminder */
|
||||
};
|
||||
|
|
@ -148,7 +149,7 @@ static inline void blk_add_trace_rq(struct request_queue *q, struct request *rq,
|
|||
u32 what)
|
||||
{
|
||||
struct blk_trace *bt = q->blk_trace;
|
||||
int rw = rq->flags & 0x03;
|
||||
int rw = rq->cmd_flags & 0x03;
|
||||
|
||||
if (likely(!bt))
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -4,11 +4,8 @@
|
|||
#ifndef _LINUX_BOOTMEM_H
|
||||
#define _LINUX_BOOTMEM_H
|
||||
|
||||
#include <asm/pgtable.h>
|
||||
#include <asm/dma.h>
|
||||
#include <linux/cache.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/mmzone.h>
|
||||
#include <asm/dma.h>
|
||||
|
||||
/*
|
||||
* simple boot-time physical memory area allocator.
|
||||
|
|
@ -41,45 +38,64 @@ typedef struct bootmem_data {
|
|||
struct list_head list;
|
||||
} bootmem_data_t;
|
||||
|
||||
extern unsigned long __init bootmem_bootmap_pages (unsigned long);
|
||||
extern unsigned long __init init_bootmem (unsigned long addr, unsigned long memend);
|
||||
extern void __init free_bootmem (unsigned long addr, unsigned long size);
|
||||
extern void * __init __alloc_bootmem (unsigned long size, unsigned long align, unsigned long goal);
|
||||
extern void * __init __alloc_bootmem_nopanic (unsigned long size, unsigned long align, unsigned long goal);
|
||||
extern void * __init __alloc_bootmem_low(unsigned long size,
|
||||
unsigned long align,
|
||||
unsigned long goal);
|
||||
extern void * __init __alloc_bootmem_low_node(pg_data_t *pgdat,
|
||||
unsigned long size,
|
||||
unsigned long align,
|
||||
unsigned long goal);
|
||||
extern void * __init __alloc_bootmem_core(struct bootmem_data *bdata,
|
||||
unsigned long size, unsigned long align, unsigned long goal,
|
||||
unsigned long limit);
|
||||
extern unsigned long bootmem_bootmap_pages(unsigned long);
|
||||
extern unsigned long init_bootmem(unsigned long addr, unsigned long memend);
|
||||
extern void free_bootmem(unsigned long addr, unsigned long size);
|
||||
extern void *__alloc_bootmem(unsigned long size,
|
||||
unsigned long align,
|
||||
unsigned long goal);
|
||||
extern void *__alloc_bootmem_nopanic(unsigned long size,
|
||||
unsigned long align,
|
||||
unsigned long goal);
|
||||
extern void *__alloc_bootmem_low(unsigned long size,
|
||||
unsigned long align,
|
||||
unsigned long goal);
|
||||
extern void *__alloc_bootmem_low_node(pg_data_t *pgdat,
|
||||
unsigned long size,
|
||||
unsigned long align,
|
||||
unsigned long goal);
|
||||
extern void *__alloc_bootmem_core(struct bootmem_data *bdata,
|
||||
unsigned long size,
|
||||
unsigned long align,
|
||||
unsigned long goal,
|
||||
unsigned long limit);
|
||||
|
||||
#ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE
|
||||
extern void __init reserve_bootmem (unsigned long addr, unsigned long size);
|
||||
extern void reserve_bootmem(unsigned long addr, unsigned long size);
|
||||
#define alloc_bootmem(x) \
|
||||
__alloc_bootmem((x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS))
|
||||
__alloc_bootmem(x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS))
|
||||
#define alloc_bootmem_low(x) \
|
||||
__alloc_bootmem_low((x), SMP_CACHE_BYTES, 0)
|
||||
__alloc_bootmem_low(x, SMP_CACHE_BYTES, 0)
|
||||
#define alloc_bootmem_pages(x) \
|
||||
__alloc_bootmem((x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS))
|
||||
__alloc_bootmem(x, PAGE_SIZE, __pa(MAX_DMA_ADDRESS))
|
||||
#define alloc_bootmem_low_pages(x) \
|
||||
__alloc_bootmem_low((x), PAGE_SIZE, 0)
|
||||
__alloc_bootmem_low(x, PAGE_SIZE, 0)
|
||||
#endif /* !CONFIG_HAVE_ARCH_BOOTMEM_NODE */
|
||||
extern unsigned long __init free_all_bootmem (void);
|
||||
extern void * __init __alloc_bootmem_node (pg_data_t *pgdat, unsigned long size, unsigned long align, unsigned long goal);
|
||||
extern unsigned long __init init_bootmem_node (pg_data_t *pgdat, unsigned long freepfn, unsigned long startpfn, unsigned long endpfn);
|
||||
extern void __init reserve_bootmem_node (pg_data_t *pgdat, unsigned long physaddr, unsigned long size);
|
||||
extern void __init free_bootmem_node (pg_data_t *pgdat, unsigned long addr, unsigned long size);
|
||||
extern unsigned long __init free_all_bootmem_node (pg_data_t *pgdat);
|
||||
|
||||
extern unsigned long free_all_bootmem(void);
|
||||
extern unsigned long free_all_bootmem_node(pg_data_t *pgdat);
|
||||
extern void *__alloc_bootmem_node(pg_data_t *pgdat,
|
||||
unsigned long size,
|
||||
unsigned long align,
|
||||
unsigned long goal);
|
||||
extern unsigned long init_bootmem_node(pg_data_t *pgdat,
|
||||
unsigned long freepfn,
|
||||
unsigned long startpfn,
|
||||
unsigned long endpfn);
|
||||
extern void reserve_bootmem_node(pg_data_t *pgdat,
|
||||
unsigned long physaddr,
|
||||
unsigned long size);
|
||||
extern void free_bootmem_node(pg_data_t *pgdat,
|
||||
unsigned long addr,
|
||||
unsigned long size);
|
||||
|
||||
#ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE
|
||||
#define alloc_bootmem_node(pgdat, x) \
|
||||
__alloc_bootmem_node((pgdat), (x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS))
|
||||
__alloc_bootmem_node(pgdat, x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS))
|
||||
#define alloc_bootmem_pages_node(pgdat, x) \
|
||||
__alloc_bootmem_node((pgdat), (x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS))
|
||||
__alloc_bootmem_node(pgdat, x, PAGE_SIZE, __pa(MAX_DMA_ADDRESS))
|
||||
#define alloc_bootmem_low_pages_node(pgdat, x) \
|
||||
__alloc_bootmem_low_node((pgdat), (x), PAGE_SIZE, 0)
|
||||
__alloc_bootmem_low_node(pgdat, x, PAGE_SIZE, 0)
|
||||
#endif /* !CONFIG_HAVE_ARCH_BOOTMEM_NODE */
|
||||
|
||||
#ifdef CONFIG_HAVE_ARCH_ALLOC_REMAP
|
||||
|
|
@ -89,19 +105,19 @@ static inline void *alloc_remap(int nid, unsigned long size)
|
|||
{
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
#endif /* CONFIG_HAVE_ARCH_ALLOC_REMAP */
|
||||
|
||||
extern unsigned long __meminitdata nr_kernel_pages;
|
||||
extern unsigned long nr_all_pages;
|
||||
|
||||
extern void *__init alloc_large_system_hash(const char *tablename,
|
||||
unsigned long bucketsize,
|
||||
unsigned long numentries,
|
||||
int scale,
|
||||
int flags,
|
||||
unsigned int *_hash_shift,
|
||||
unsigned int *_hash_mask,
|
||||
unsigned long limit);
|
||||
extern void *alloc_large_system_hash(const char *tablename,
|
||||
unsigned long bucketsize,
|
||||
unsigned long numentries,
|
||||
int scale,
|
||||
int flags,
|
||||
unsigned int *_hash_shift,
|
||||
unsigned int *_hash_mask,
|
||||
unsigned long limit);
|
||||
|
||||
#define HASH_HIGHMEM 0x00000001 /* Consider highmem? */
|
||||
#define HASH_EARLY 0x00000002 /* Allocating during early boot? */
|
||||
|
|
@ -114,7 +130,7 @@ extern void *__init alloc_large_system_hash(const char *tablename,
|
|||
#else
|
||||
#define HASHDIST_DEFAULT 0
|
||||
#endif
|
||||
extern int __initdata hashdist; /* Distribute hashes across NUMA nodes? */
|
||||
extern int hashdist; /* Distribute hashes across NUMA nodes? */
|
||||
|
||||
|
||||
#endif /* _LINUX_BOOTMEM_H */
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@
|
|||
#include <linux/wait.h>
|
||||
#include <asm/atomic.h>
|
||||
|
||||
#ifdef CONFIG_BLOCK
|
||||
|
||||
enum bh_state_bits {
|
||||
BH_Uptodate, /* Contains valid data */
|
||||
BH_Dirty, /* Is dirty */
|
||||
|
|
@ -190,9 +192,7 @@ extern int buffer_heads_over_limit;
|
|||
* Generic address_space_operations implementations for buffer_head-backed
|
||||
* address_spaces.
|
||||
*/
|
||||
int try_to_release_page(struct page * page, gfp_t gfp_mask);
|
||||
void block_invalidatepage(struct page *page, unsigned long offset);
|
||||
void do_invalidatepage(struct page *page, unsigned long offset);
|
||||
int block_write_full_page(struct page *page, get_block_t *get_block,
|
||||
struct writeback_control *wbc);
|
||||
int block_read_full_page(struct page*, get_block_t*);
|
||||
|
|
@ -302,4 +302,19 @@ static inline void lock_buffer(struct buffer_head *bh)
|
|||
__lock_buffer(bh);
|
||||
}
|
||||
|
||||
extern int __set_page_dirty_buffers(struct page *page);
|
||||
|
||||
#else /* CONFIG_BLOCK */
|
||||
|
||||
static inline void buffer_init(void) {}
|
||||
static inline int try_to_free_buffers(struct page *page) { return 1; }
|
||||
static inline int sync_blockdev(struct block_device *bdev) { return 0; }
|
||||
static inline int inode_has_buffers(struct inode *inode) { return 0; }
|
||||
static inline void invalidate_inode_buffers(struct inode *inode) {}
|
||||
static inline int remove_inode_buffers(struct inode *inode) { return 1; }
|
||||
static inline int sync_mapping_buffers(struct address_space *mapping) { return 0; }
|
||||
static inline void invalidate_bdev(struct block_device *bdev, int destroy_dirty_buffers) {}
|
||||
|
||||
|
||||
#endif /* CONFIG_BLOCK */
|
||||
#endif /* _LINUX_BUFFER_HEAD_H */
|
||||
|
|
|
|||
|
|
@ -1,2 +1,7 @@
|
|||
unifdef-y += generic.h swabb.h swab.h
|
||||
header-y += big_endian.h little_endian.h pdp_endian.h
|
||||
header-y += big_endian.h
|
||||
header-y += little_endian.h
|
||||
header-y += pdp_endian.h
|
||||
|
||||
unifdef-y += generic.h
|
||||
unifdef-y += swabb.h
|
||||
unifdef-y += swab.h
|
||||
|
|
|
|||
|
|
@ -23,5 +23,7 @@ void cdev_del(struct cdev *);
|
|||
|
||||
void cd_forget(struct inode *);
|
||||
|
||||
extern struct backing_dev_info directly_mappable_cdev_bdi;
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
#ifndef __CODA_PSDEV_H
|
||||
#define __CODA_PSDEV_H
|
||||
|
||||
#include <linux/magic.h>
|
||||
|
||||
#define CODA_PSDEV_MAJOR 67
|
||||
#define MAX_CODADEVS 5 /* how many do we allow */
|
||||
|
||||
#define CODA_SUPER_MAGIC 0x73757245
|
||||
|
||||
struct kstatfs;
|
||||
|
||||
struct coda_sb_info
|
||||
|
|
|
|||
|
|
@ -90,6 +90,7 @@ COMPATIBLE_IOCTL(FDTWADDLE)
|
|||
COMPATIBLE_IOCTL(FDFMTTRK)
|
||||
COMPATIBLE_IOCTL(FDRAWCMD)
|
||||
/* 0x12 */
|
||||
#ifdef CONFIG_BLOCK
|
||||
COMPATIBLE_IOCTL(BLKRASET)
|
||||
COMPATIBLE_IOCTL(BLKROSET)
|
||||
COMPATIBLE_IOCTL(BLKROGET)
|
||||
|
|
@ -103,6 +104,7 @@ COMPATIBLE_IOCTL(BLKTRACESETUP)
|
|||
COMPATIBLE_IOCTL(BLKTRACETEARDOWN)
|
||||
ULONG_IOCTL(BLKRASET)
|
||||
ULONG_IOCTL(BLKFRASET)
|
||||
#endif
|
||||
/* RAID */
|
||||
COMPATIBLE_IOCTL(RAID_VERSION)
|
||||
COMPATIBLE_IOCTL(GET_ARRAY_INFO)
|
||||
|
|
@ -395,12 +397,6 @@ COMPATIBLE_IOCTL(DVD_WRITE_STRUCT)
|
|||
COMPATIBLE_IOCTL(DVD_AUTH)
|
||||
/* pktcdvd */
|
||||
COMPATIBLE_IOCTL(PACKET_CTRL_CMD)
|
||||
/* Big L */
|
||||
ULONG_IOCTL(LOOP_SET_FD)
|
||||
ULONG_IOCTL(LOOP_CHANGE_FD)
|
||||
COMPATIBLE_IOCTL(LOOP_CLR_FD)
|
||||
COMPATIBLE_IOCTL(LOOP_GET_STATUS64)
|
||||
COMPATIBLE_IOCTL(LOOP_SET_STATUS64)
|
||||
/* Big A */
|
||||
/* sparc only */
|
||||
/* Big Q for sound/OSS */
|
||||
|
|
@ -573,18 +569,6 @@ COMPATIBLE_IOCTL(RAW_SETBIND)
|
|||
COMPATIBLE_IOCTL(RAW_GETBIND)
|
||||
/* SMB ioctls which do not need any translations */
|
||||
COMPATIBLE_IOCTL(SMB_IOC_NEWCONN)
|
||||
/* NCP ioctls which do not need any translations */
|
||||
COMPATIBLE_IOCTL(NCP_IOC_CONN_LOGGED_IN)
|
||||
COMPATIBLE_IOCTL(NCP_IOC_SIGN_INIT)
|
||||
COMPATIBLE_IOCTL(NCP_IOC_SIGN_WANTED)
|
||||
COMPATIBLE_IOCTL(NCP_IOC_SET_SIGN_WANTED)
|
||||
COMPATIBLE_IOCTL(NCP_IOC_LOCKUNLOCK)
|
||||
COMPATIBLE_IOCTL(NCP_IOC_GETROOT)
|
||||
COMPATIBLE_IOCTL(NCP_IOC_SETROOT)
|
||||
COMPATIBLE_IOCTL(NCP_IOC_GETCHARSETS)
|
||||
COMPATIBLE_IOCTL(NCP_IOC_SETCHARSETS)
|
||||
COMPATIBLE_IOCTL(NCP_IOC_GETDENTRYTTL)
|
||||
COMPATIBLE_IOCTL(NCP_IOC_SETDENTRYTTL)
|
||||
/* Little a */
|
||||
COMPATIBLE_IOCTL(ATMSIGD_CTRL)
|
||||
COMPATIBLE_IOCTL(ATMARPD_CTRL)
|
||||
|
|
|
|||
|
|
@ -10,11 +10,11 @@
|
|||
# define __force __attribute__((force))
|
||||
# define __nocast __attribute__((nocast))
|
||||
# define __iomem __attribute__((noderef, address_space(2)))
|
||||
# define __acquires(x) __attribute__((context(0,1)))
|
||||
# define __releases(x) __attribute__((context(1,0)))
|
||||
# define __acquire(x) __context__(1)
|
||||
# define __release(x) __context__(-1)
|
||||
# define __cond_lock(x) ((x) ? ({ __context__(1); 1; }) : 0)
|
||||
# define __acquires(x) __attribute__((context(x,0,1)))
|
||||
# define __releases(x) __attribute__((context(x,1,0)))
|
||||
# define __acquire(x) __context__(x,1)
|
||||
# define __release(x) __context__(x,-1)
|
||||
# define __cond_lock(x,c) ((c) ? ({ __acquire(x); 1; }) : 0)
|
||||
extern void __chk_user_ptr(void __user *);
|
||||
extern void __chk_io_ptr(void __iomem *);
|
||||
#else
|
||||
|
|
@ -31,7 +31,7 @@ extern void __chk_io_ptr(void __iomem *);
|
|||
# define __releases(x)
|
||||
# define __acquire(x) (void)0
|
||||
# define __release(x) (void)0
|
||||
# define __cond_lock(x) (x)
|
||||
# define __cond_lock(x,c) (c)
|
||||
#endif
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
|
@ -99,6 +99,11 @@ extern void __chk_io_ptr(void __iomem *);
|
|||
#define __must_check
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_ENABLE_MUST_CHECK
|
||||
#undef __must_check
|
||||
#define __must_check
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Allow us to avoid 'defined but not used' warnings on functions and data,
|
||||
* as well as force them to be emitted to the assembly file.
|
||||
|
|
|
|||
|
|
@ -120,9 +120,14 @@ extern void console_stop(struct console *);
|
|||
extern void console_start(struct console *);
|
||||
extern int is_console_locked(void);
|
||||
|
||||
#ifndef CONFIG_DISABLE_CONSOLE_SUSPEND
|
||||
/* Suspend and resume console messages over PM events */
|
||||
extern void suspend_console(void);
|
||||
extern void resume_console(void);
|
||||
#else
|
||||
static inline void suspend_console(void) {}
|
||||
static inline void resume_console(void) {}
|
||||
#endif /* CONFIG_DISABLE_CONSOLE_SUSPEND */
|
||||
|
||||
/* Some debug stub to catch some of the obvious races in the VT code */
|
||||
#if 1
|
||||
|
|
|
|||
|
|
@ -89,4 +89,12 @@ int cpu_down(unsigned int cpu);
|
|||
static inline int cpu_is_offline(int cpu) { return 0; }
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SUSPEND_SMP
|
||||
extern int disable_nonboot_cpus(void);
|
||||
extern void enable_nonboot_cpus(void);
|
||||
#else
|
||||
static inline int disable_nonboot_cpus(void) { return 0; }
|
||||
static inline void enable_nonboot_cpus(void) {}
|
||||
#endif
|
||||
|
||||
#endif /* _LINUX_CPU_H_ */
|
||||
|
|
|
|||
|
|
@ -63,6 +63,8 @@ static inline int cpuset_do_slab_mem_spread(void)
|
|||
return current->flags & PF_SPREAD_SLAB;
|
||||
}
|
||||
|
||||
extern void cpuset_track_online_nodes(void);
|
||||
|
||||
#else /* !CONFIG_CPUSETS */
|
||||
|
||||
static inline int cpuset_init_early(void) { return 0; }
|
||||
|
|
@ -126,6 +128,8 @@ static inline int cpuset_do_slab_mem_spread(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static inline void cpuset_track_online_nodes(void) {}
|
||||
|
||||
#endif /* !CONFIG_CPUSETS */
|
||||
|
||||
#endif /* _LINUX_CPUSET_H */
|
||||
|
|
|
|||
|
|
@ -87,6 +87,6 @@ struct cramfs_super {
|
|||
/* Uncompression interfaces to the underlying zlib */
|
||||
int cramfs_uncompress_block(void *dst, int dstlen, void *src, int srclen);
|
||||
int cramfs_uncompress_init(void);
|
||||
int cramfs_uncompress_exit(void);
|
||||
void cramfs_uncompress_exit(void);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -17,20 +17,36 @@
|
|||
#ifndef _LINUX_CRYPTO_H
|
||||
#define _LINUX_CRYPTO_H
|
||||
|
||||
#include <asm/atomic.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/string.h>
|
||||
#include <asm/page.h>
|
||||
#include <linux/uaccess.h>
|
||||
|
||||
/*
|
||||
* Algorithm masks and types.
|
||||
*/
|
||||
#define CRYPTO_ALG_TYPE_MASK 0x000000ff
|
||||
#define CRYPTO_ALG_TYPE_MASK 0x0000000f
|
||||
#define CRYPTO_ALG_TYPE_CIPHER 0x00000001
|
||||
#define CRYPTO_ALG_TYPE_DIGEST 0x00000002
|
||||
#define CRYPTO_ALG_TYPE_COMPRESS 0x00000004
|
||||
#define CRYPTO_ALG_TYPE_HASH 0x00000003
|
||||
#define CRYPTO_ALG_TYPE_BLKCIPHER 0x00000004
|
||||
#define CRYPTO_ALG_TYPE_COMPRESS 0x00000005
|
||||
|
||||
#define CRYPTO_ALG_TYPE_HASH_MASK 0x0000000e
|
||||
|
||||
#define CRYPTO_ALG_LARVAL 0x00000010
|
||||
#define CRYPTO_ALG_DEAD 0x00000020
|
||||
#define CRYPTO_ALG_DYING 0x00000040
|
||||
#define CRYPTO_ALG_ASYNC 0x00000080
|
||||
|
||||
/*
|
||||
* Set this bit if and only if the algorithm requires another algorithm of
|
||||
* the same type to handle corner cases.
|
||||
*/
|
||||
#define CRYPTO_ALG_NEED_FALLBACK 0x00000100
|
||||
|
||||
/*
|
||||
* Transform masks and values (for crt_flags).
|
||||
|
|
@ -61,8 +77,37 @@
|
|||
#define CRYPTO_DIR_ENCRYPT 1
|
||||
#define CRYPTO_DIR_DECRYPT 0
|
||||
|
||||
/*
|
||||
* The macro CRYPTO_MINALIGN_ATTR (along with the void * type in the actual
|
||||
* declaration) is used to ensure that the crypto_tfm context structure is
|
||||
* aligned correctly for the given architecture so that there are no alignment
|
||||
* faults for C data types. In particular, this is required on platforms such
|
||||
* as arm where pointers are 32-bit aligned but there are data types such as
|
||||
* u64 which require 64-bit alignment.
|
||||
*/
|
||||
#if defined(ARCH_KMALLOC_MINALIGN)
|
||||
#define CRYPTO_MINALIGN ARCH_KMALLOC_MINALIGN
|
||||
#elif defined(ARCH_SLAB_MINALIGN)
|
||||
#define CRYPTO_MINALIGN ARCH_SLAB_MINALIGN
|
||||
#endif
|
||||
|
||||
#ifdef CRYPTO_MINALIGN
|
||||
#define CRYPTO_MINALIGN_ATTR __attribute__ ((__aligned__(CRYPTO_MINALIGN)))
|
||||
#else
|
||||
#define CRYPTO_MINALIGN_ATTR
|
||||
#endif
|
||||
|
||||
struct scatterlist;
|
||||
struct crypto_blkcipher;
|
||||
struct crypto_hash;
|
||||
struct crypto_tfm;
|
||||
struct crypto_type;
|
||||
|
||||
struct blkcipher_desc {
|
||||
struct crypto_blkcipher *tfm;
|
||||
void *info;
|
||||
u32 flags;
|
||||
};
|
||||
|
||||
struct cipher_desc {
|
||||
struct crypto_tfm *tfm;
|
||||
|
|
@ -72,30 +117,50 @@ struct cipher_desc {
|
|||
void *info;
|
||||
};
|
||||
|
||||
struct hash_desc {
|
||||
struct crypto_hash *tfm;
|
||||
u32 flags;
|
||||
};
|
||||
|
||||
/*
|
||||
* Algorithms: modular crypto algorithm implementations, managed
|
||||
* via crypto_register_alg() and crypto_unregister_alg().
|
||||
*/
|
||||
struct blkcipher_alg {
|
||||
int (*setkey)(struct crypto_tfm *tfm, const u8 *key,
|
||||
unsigned int keylen);
|
||||
int (*encrypt)(struct blkcipher_desc *desc,
|
||||
struct scatterlist *dst, struct scatterlist *src,
|
||||
unsigned int nbytes);
|
||||
int (*decrypt)(struct blkcipher_desc *desc,
|
||||
struct scatterlist *dst, struct scatterlist *src,
|
||||
unsigned int nbytes);
|
||||
|
||||
unsigned int min_keysize;
|
||||
unsigned int max_keysize;
|
||||
unsigned int ivsize;
|
||||
};
|
||||
|
||||
struct cipher_alg {
|
||||
unsigned int cia_min_keysize;
|
||||
unsigned int cia_max_keysize;
|
||||
int (*cia_setkey)(struct crypto_tfm *tfm, const u8 *key,
|
||||
unsigned int keylen, u32 *flags);
|
||||
unsigned int keylen);
|
||||
void (*cia_encrypt)(struct crypto_tfm *tfm, u8 *dst, const u8 *src);
|
||||
void (*cia_decrypt)(struct crypto_tfm *tfm, u8 *dst, const u8 *src);
|
||||
|
||||
unsigned int (*cia_encrypt_ecb)(const struct cipher_desc *desc,
|
||||
u8 *dst, const u8 *src,
|
||||
unsigned int nbytes);
|
||||
unsigned int nbytes) __deprecated;
|
||||
unsigned int (*cia_decrypt_ecb)(const struct cipher_desc *desc,
|
||||
u8 *dst, const u8 *src,
|
||||
unsigned int nbytes);
|
||||
unsigned int nbytes) __deprecated;
|
||||
unsigned int (*cia_encrypt_cbc)(const struct cipher_desc *desc,
|
||||
u8 *dst, const u8 *src,
|
||||
unsigned int nbytes);
|
||||
unsigned int nbytes) __deprecated;
|
||||
unsigned int (*cia_decrypt_cbc)(const struct cipher_desc *desc,
|
||||
u8 *dst, const u8 *src,
|
||||
unsigned int nbytes);
|
||||
unsigned int nbytes) __deprecated;
|
||||
};
|
||||
|
||||
struct digest_alg {
|
||||
|
|
@ -105,7 +170,20 @@ struct digest_alg {
|
|||
unsigned int len);
|
||||
void (*dia_final)(struct crypto_tfm *tfm, u8 *out);
|
||||
int (*dia_setkey)(struct crypto_tfm *tfm, const u8 *key,
|
||||
unsigned int keylen, u32 *flags);
|
||||
unsigned int keylen);
|
||||
};
|
||||
|
||||
struct hash_alg {
|
||||
int (*init)(struct hash_desc *desc);
|
||||
int (*update)(struct hash_desc *desc, struct scatterlist *sg,
|
||||
unsigned int nbytes);
|
||||
int (*final)(struct hash_desc *desc, u8 *out);
|
||||
int (*digest)(struct hash_desc *desc, struct scatterlist *sg,
|
||||
unsigned int nbytes, u8 *out);
|
||||
int (*setkey)(struct crypto_hash *tfm, const u8 *key,
|
||||
unsigned int keylen);
|
||||
|
||||
unsigned int digestsize;
|
||||
};
|
||||
|
||||
struct compress_alg {
|
||||
|
|
@ -115,30 +193,40 @@ struct compress_alg {
|
|||
unsigned int slen, u8 *dst, unsigned int *dlen);
|
||||
};
|
||||
|
||||
#define cra_blkcipher cra_u.blkcipher
|
||||
#define cra_cipher cra_u.cipher
|
||||
#define cra_digest cra_u.digest
|
||||
#define cra_hash cra_u.hash
|
||||
#define cra_compress cra_u.compress
|
||||
|
||||
struct crypto_alg {
|
||||
struct list_head cra_list;
|
||||
struct list_head cra_users;
|
||||
|
||||
u32 cra_flags;
|
||||
unsigned int cra_blocksize;
|
||||
unsigned int cra_ctxsize;
|
||||
unsigned int cra_alignmask;
|
||||
|
||||
int cra_priority;
|
||||
atomic_t cra_refcnt;
|
||||
|
||||
char cra_name[CRYPTO_MAX_ALG_NAME];
|
||||
char cra_driver_name[CRYPTO_MAX_ALG_NAME];
|
||||
|
||||
const struct crypto_type *cra_type;
|
||||
|
||||
union {
|
||||
struct blkcipher_alg blkcipher;
|
||||
struct cipher_alg cipher;
|
||||
struct digest_alg digest;
|
||||
struct hash_alg hash;
|
||||
struct compress_alg compress;
|
||||
} cra_u;
|
||||
|
||||
int (*cra_init)(struct crypto_tfm *tfm);
|
||||
void (*cra_exit)(struct crypto_tfm *tfm);
|
||||
void (*cra_destroy)(struct crypto_alg *alg);
|
||||
|
||||
struct module *cra_module;
|
||||
};
|
||||
|
|
@ -153,20 +241,39 @@ int crypto_unregister_alg(struct crypto_alg *alg);
|
|||
* Algorithm query interface.
|
||||
*/
|
||||
#ifdef CONFIG_CRYPTO
|
||||
int crypto_alg_available(const char *name, u32 flags);
|
||||
int crypto_alg_available(const char *name, u32 flags)
|
||||
__deprecated_for_modules;
|
||||
int crypto_has_alg(const char *name, u32 type, u32 mask);
|
||||
#else
|
||||
static int crypto_alg_available(const char *name, u32 flags);
|
||||
__deprecated_for_modules;
|
||||
static inline int crypto_alg_available(const char *name, u32 flags)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int crypto_has_alg(const char *name, u32 type, u32 mask)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Transforms: user-instantiated objects which encapsulate algorithms
|
||||
* and core processing logic. Managed via crypto_alloc_tfm() and
|
||||
* crypto_free_tfm(), as well as the various helpers below.
|
||||
* and core processing logic. Managed via crypto_alloc_*() and
|
||||
* crypto_free_*(), as well as the various helpers below.
|
||||
*/
|
||||
|
||||
struct blkcipher_tfm {
|
||||
void *iv;
|
||||
int (*setkey)(struct crypto_tfm *tfm, const u8 *key,
|
||||
unsigned int keylen);
|
||||
int (*encrypt)(struct blkcipher_desc *desc, struct scatterlist *dst,
|
||||
struct scatterlist *src, unsigned int nbytes);
|
||||
int (*decrypt)(struct blkcipher_desc *desc, struct scatterlist *dst,
|
||||
struct scatterlist *src, unsigned int nbytes);
|
||||
};
|
||||
|
||||
struct cipher_tfm {
|
||||
void *cit_iv;
|
||||
unsigned int cit_ivsize;
|
||||
|
|
@ -190,20 +297,20 @@ struct cipher_tfm {
|
|||
struct scatterlist *src,
|
||||
unsigned int nbytes, u8 *iv);
|
||||
void (*cit_xor_block)(u8 *dst, const u8 *src);
|
||||
void (*cit_encrypt_one)(struct crypto_tfm *tfm, u8 *dst, const u8 *src);
|
||||
void (*cit_decrypt_one)(struct crypto_tfm *tfm, u8 *dst, const u8 *src);
|
||||
};
|
||||
|
||||
struct digest_tfm {
|
||||
void (*dit_init)(struct crypto_tfm *tfm);
|
||||
void (*dit_update)(struct crypto_tfm *tfm,
|
||||
struct scatterlist *sg, unsigned int nsg);
|
||||
void (*dit_final)(struct crypto_tfm *tfm, u8 *out);
|
||||
void (*dit_digest)(struct crypto_tfm *tfm, struct scatterlist *sg,
|
||||
unsigned int nsg, u8 *out);
|
||||
int (*dit_setkey)(struct crypto_tfm *tfm,
|
||||
const u8 *key, unsigned int keylen);
|
||||
#ifdef CONFIG_CRYPTO_HMAC
|
||||
void *dit_hmac_block;
|
||||
#endif
|
||||
struct hash_tfm {
|
||||
int (*init)(struct hash_desc *desc);
|
||||
int (*update)(struct hash_desc *desc,
|
||||
struct scatterlist *sg, unsigned int nsg);
|
||||
int (*final)(struct hash_desc *desc, u8 *out);
|
||||
int (*digest)(struct hash_desc *desc, struct scatterlist *sg,
|
||||
unsigned int nsg, u8 *out);
|
||||
int (*setkey)(struct crypto_hash *tfm, const u8 *key,
|
||||
unsigned int keylen);
|
||||
unsigned int digestsize;
|
||||
};
|
||||
|
||||
struct compress_tfm {
|
||||
|
|
@ -215,8 +322,9 @@ struct compress_tfm {
|
|||
u8 *dst, unsigned int *dlen);
|
||||
};
|
||||
|
||||
#define crt_blkcipher crt_u.blkcipher
|
||||
#define crt_cipher crt_u.cipher
|
||||
#define crt_digest crt_u.digest
|
||||
#define crt_hash crt_u.hash
|
||||
#define crt_compress crt_u.compress
|
||||
|
||||
struct crypto_tfm {
|
||||
|
|
@ -224,30 +332,43 @@ struct crypto_tfm {
|
|||
u32 crt_flags;
|
||||
|
||||
union {
|
||||
struct blkcipher_tfm blkcipher;
|
||||
struct cipher_tfm cipher;
|
||||
struct digest_tfm digest;
|
||||
struct hash_tfm hash;
|
||||
struct compress_tfm compress;
|
||||
} crt_u;
|
||||
|
||||
struct crypto_alg *__crt_alg;
|
||||
|
||||
char __crt_ctx[] __attribute__ ((__aligned__));
|
||||
void *__crt_ctx[] CRYPTO_MINALIGN_ATTR;
|
||||
};
|
||||
|
||||
#define crypto_cipher crypto_tfm
|
||||
#define crypto_comp crypto_tfm
|
||||
|
||||
struct crypto_blkcipher {
|
||||
struct crypto_tfm base;
|
||||
};
|
||||
|
||||
struct crypto_hash {
|
||||
struct crypto_tfm base;
|
||||
};
|
||||
|
||||
enum {
|
||||
CRYPTOA_UNSPEC,
|
||||
CRYPTOA_ALG,
|
||||
};
|
||||
|
||||
struct crypto_attr_alg {
|
||||
char name[CRYPTO_MAX_ALG_NAME];
|
||||
};
|
||||
|
||||
/*
|
||||
* Transform user interface.
|
||||
*/
|
||||
|
||||
/*
|
||||
* crypto_alloc_tfm() will first attempt to locate an already loaded algorithm.
|
||||
* If that fails and the kernel supports dynamically loadable modules, it
|
||||
* will then attempt to load a module of the same name or alias. A refcount
|
||||
* is grabbed on the algorithm which is then associated with the new transform.
|
||||
*
|
||||
* crypto_free_tfm() frees up the transform and any associated resources,
|
||||
* then drops the refcount on the associated algorithm.
|
||||
*/
|
||||
struct crypto_tfm *crypto_alloc_tfm(const char *alg_name, u32 tfm_flags);
|
||||
struct crypto_tfm *crypto_alloc_base(const char *alg_name, u32 type, u32 mask);
|
||||
void crypto_free_tfm(struct crypto_tfm *tfm);
|
||||
|
||||
/*
|
||||
|
|
@ -258,6 +379,16 @@ static inline const char *crypto_tfm_alg_name(struct crypto_tfm *tfm)
|
|||
return tfm->__crt_alg->cra_name;
|
||||
}
|
||||
|
||||
static inline const char *crypto_tfm_alg_driver_name(struct crypto_tfm *tfm)
|
||||
{
|
||||
return tfm->__crt_alg->cra_driver_name;
|
||||
}
|
||||
|
||||
static inline int crypto_tfm_alg_priority(struct crypto_tfm *tfm)
|
||||
{
|
||||
return tfm->__crt_alg->cra_priority;
|
||||
}
|
||||
|
||||
static inline const char *crypto_tfm_alg_modname(struct crypto_tfm *tfm)
|
||||
{
|
||||
return module_name(tfm->__crt_alg->cra_module);
|
||||
|
|
@ -268,18 +399,23 @@ static inline u32 crypto_tfm_alg_type(struct crypto_tfm *tfm)
|
|||
return tfm->__crt_alg->cra_flags & CRYPTO_ALG_TYPE_MASK;
|
||||
}
|
||||
|
||||
static unsigned int crypto_tfm_alg_min_keysize(struct crypto_tfm *tfm)
|
||||
__deprecated;
|
||||
static inline unsigned int crypto_tfm_alg_min_keysize(struct crypto_tfm *tfm)
|
||||
{
|
||||
BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
|
||||
return tfm->__crt_alg->cra_cipher.cia_min_keysize;
|
||||
}
|
||||
|
||||
static unsigned int crypto_tfm_alg_max_keysize(struct crypto_tfm *tfm)
|
||||
__deprecated;
|
||||
static inline unsigned int crypto_tfm_alg_max_keysize(struct crypto_tfm *tfm)
|
||||
{
|
||||
BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
|
||||
return tfm->__crt_alg->cra_cipher.cia_max_keysize;
|
||||
}
|
||||
|
||||
static unsigned int crypto_tfm_alg_ivsize(struct crypto_tfm *tfm) __deprecated;
|
||||
static inline unsigned int crypto_tfm_alg_ivsize(struct crypto_tfm *tfm)
|
||||
{
|
||||
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)
|
|||
return tfm->__crt_alg->cra_alignmask;
|
||||
}
|
||||
|
||||
static inline u32 crypto_tfm_get_flags(struct crypto_tfm *tfm)
|
||||
{
|
||||
return tfm->crt_flags;
|
||||
}
|
||||
|
||||
static inline void crypto_tfm_set_flags(struct crypto_tfm *tfm, u32 flags)
|
||||
{
|
||||
tfm->crt_flags |= flags;
|
||||
}
|
||||
|
||||
static inline void crypto_tfm_clear_flags(struct crypto_tfm *tfm, u32 flags)
|
||||
{
|
||||
tfm->crt_flags &= ~flags;
|
||||
}
|
||||
|
||||
static inline void *crypto_tfm_ctx(struct crypto_tfm *tfm)
|
||||
{
|
||||
return tfm->__crt_ctx;
|
||||
|
|
@ -316,50 +467,374 @@ static inline unsigned int crypto_tfm_ctx_alignment(void)
|
|||
/*
|
||||
* API wrappers.
|
||||
*/
|
||||
static inline void crypto_digest_init(struct crypto_tfm *tfm)
|
||||
static inline struct crypto_blkcipher *__crypto_blkcipher_cast(
|
||||
struct crypto_tfm *tfm)
|
||||
{
|
||||
BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_DIGEST);
|
||||
tfm->crt_digest.dit_init(tfm);
|
||||
return (struct crypto_blkcipher *)tfm;
|
||||
}
|
||||
|
||||
static inline void crypto_digest_update(struct crypto_tfm *tfm,
|
||||
struct scatterlist *sg,
|
||||
unsigned int nsg)
|
||||
static inline struct crypto_blkcipher *crypto_blkcipher_cast(
|
||||
struct crypto_tfm *tfm)
|
||||
{
|
||||
BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_DIGEST);
|
||||
tfm->crt_digest.dit_update(tfm, sg, nsg);
|
||||
BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_BLKCIPHER);
|
||||
return __crypto_blkcipher_cast(tfm);
|
||||
}
|
||||
|
||||
static inline void crypto_digest_final(struct crypto_tfm *tfm, u8 *out)
|
||||
static inline struct crypto_blkcipher *crypto_alloc_blkcipher(
|
||||
const char *alg_name, u32 type, u32 mask)
|
||||
{
|
||||
BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_DIGEST);
|
||||
tfm->crt_digest.dit_final(tfm, out);
|
||||
type &= ~CRYPTO_ALG_TYPE_MASK;
|
||||
type |= CRYPTO_ALG_TYPE_BLKCIPHER;
|
||||
mask |= CRYPTO_ALG_TYPE_MASK;
|
||||
|
||||
return __crypto_blkcipher_cast(crypto_alloc_base(alg_name, type, mask));
|
||||
}
|
||||
|
||||
static inline void crypto_digest_digest(struct crypto_tfm *tfm,
|
||||
struct scatterlist *sg,
|
||||
unsigned int nsg, u8 *out)
|
||||
static inline struct crypto_tfm *crypto_blkcipher_tfm(
|
||||
struct crypto_blkcipher *tfm)
|
||||
{
|
||||
BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_DIGEST);
|
||||
tfm->crt_digest.dit_digest(tfm, sg, nsg, out);
|
||||
return &tfm->base;
|
||||
}
|
||||
|
||||
static inline void crypto_free_blkcipher(struct crypto_blkcipher *tfm)
|
||||
{
|
||||
crypto_free_tfm(crypto_blkcipher_tfm(tfm));
|
||||
}
|
||||
|
||||
static inline int crypto_has_blkcipher(const char *alg_name, u32 type, u32 mask)
|
||||
{
|
||||
type &= ~CRYPTO_ALG_TYPE_MASK;
|
||||
type |= CRYPTO_ALG_TYPE_BLKCIPHER;
|
||||
mask |= CRYPTO_ALG_TYPE_MASK;
|
||||
|
||||
return crypto_has_alg(alg_name, type, mask);
|
||||
}
|
||||
|
||||
static inline const char *crypto_blkcipher_name(struct crypto_blkcipher *tfm)
|
||||
{
|
||||
return crypto_tfm_alg_name(crypto_blkcipher_tfm(tfm));
|
||||
}
|
||||
|
||||
static inline struct blkcipher_tfm *crypto_blkcipher_crt(
|
||||
struct crypto_blkcipher *tfm)
|
||||
{
|
||||
return &crypto_blkcipher_tfm(tfm)->crt_blkcipher;
|
||||
}
|
||||
|
||||
static inline struct blkcipher_alg *crypto_blkcipher_alg(
|
||||
struct crypto_blkcipher *tfm)
|
||||
{
|
||||
return &crypto_blkcipher_tfm(tfm)->__crt_alg->cra_blkcipher;
|
||||
}
|
||||
|
||||
static inline unsigned int crypto_blkcipher_ivsize(struct crypto_blkcipher *tfm)
|
||||
{
|
||||
return crypto_blkcipher_alg(tfm)->ivsize;
|
||||
}
|
||||
|
||||
static inline unsigned int crypto_blkcipher_blocksize(
|
||||
struct crypto_blkcipher *tfm)
|
||||
{
|
||||
return crypto_tfm_alg_blocksize(crypto_blkcipher_tfm(tfm));
|
||||
}
|
||||
|
||||
static inline unsigned int crypto_blkcipher_alignmask(
|
||||
struct crypto_blkcipher *tfm)
|
||||
{
|
||||
return crypto_tfm_alg_alignmask(crypto_blkcipher_tfm(tfm));
|
||||
}
|
||||
|
||||
static inline u32 crypto_blkcipher_get_flags(struct crypto_blkcipher *tfm)
|
||||
{
|
||||
return crypto_tfm_get_flags(crypto_blkcipher_tfm(tfm));
|
||||
}
|
||||
|
||||
static inline void crypto_blkcipher_set_flags(struct crypto_blkcipher *tfm,
|
||||
u32 flags)
|
||||
{
|
||||
crypto_tfm_set_flags(crypto_blkcipher_tfm(tfm), flags);
|
||||
}
|
||||
|
||||
static inline void crypto_blkcipher_clear_flags(struct crypto_blkcipher *tfm,
|
||||
u32 flags)
|
||||
{
|
||||
crypto_tfm_clear_flags(crypto_blkcipher_tfm(tfm), flags);
|
||||
}
|
||||
|
||||
static inline int crypto_blkcipher_setkey(struct crypto_blkcipher *tfm,
|
||||
const u8 *key, unsigned int keylen)
|
||||
{
|
||||
return crypto_blkcipher_crt(tfm)->setkey(crypto_blkcipher_tfm(tfm),
|
||||
key, keylen);
|
||||
}
|
||||
|
||||
static inline int crypto_blkcipher_encrypt(struct blkcipher_desc *desc,
|
||||
struct scatterlist *dst,
|
||||
struct scatterlist *src,
|
||||
unsigned int nbytes)
|
||||
{
|
||||
desc->info = crypto_blkcipher_crt(desc->tfm)->iv;
|
||||
return crypto_blkcipher_crt(desc->tfm)->encrypt(desc, dst, src, nbytes);
|
||||
}
|
||||
|
||||
static inline int crypto_blkcipher_encrypt_iv(struct blkcipher_desc *desc,
|
||||
struct scatterlist *dst,
|
||||
struct scatterlist *src,
|
||||
unsigned int nbytes)
|
||||
{
|
||||
return crypto_blkcipher_crt(desc->tfm)->encrypt(desc, dst, src, nbytes);
|
||||
}
|
||||
|
||||
static inline int crypto_blkcipher_decrypt(struct blkcipher_desc *desc,
|
||||
struct scatterlist *dst,
|
||||
struct scatterlist *src,
|
||||
unsigned int nbytes)
|
||||
{
|
||||
desc->info = crypto_blkcipher_crt(desc->tfm)->iv;
|
||||
return crypto_blkcipher_crt(desc->tfm)->decrypt(desc, dst, src, nbytes);
|
||||
}
|
||||
|
||||
static inline int crypto_blkcipher_decrypt_iv(struct blkcipher_desc *desc,
|
||||
struct scatterlist *dst,
|
||||
struct scatterlist *src,
|
||||
unsigned int nbytes)
|
||||
{
|
||||
return crypto_blkcipher_crt(desc->tfm)->decrypt(desc, dst, src, nbytes);
|
||||
}
|
||||
|
||||
static inline void crypto_blkcipher_set_iv(struct crypto_blkcipher *tfm,
|
||||
const u8 *src, unsigned int len)
|
||||
{
|
||||
memcpy(crypto_blkcipher_crt(tfm)->iv, src, len);
|
||||
}
|
||||
|
||||
static inline void crypto_blkcipher_get_iv(struct crypto_blkcipher *tfm,
|
||||
u8 *dst, unsigned int len)
|
||||
{
|
||||
memcpy(dst, crypto_blkcipher_crt(tfm)->iv, len);
|
||||
}
|
||||
|
||||
static inline struct crypto_cipher *__crypto_cipher_cast(struct crypto_tfm *tfm)
|
||||
{
|
||||
return (struct crypto_cipher *)tfm;
|
||||
}
|
||||
|
||||
static inline struct crypto_cipher *crypto_cipher_cast(struct crypto_tfm *tfm)
|
||||
{
|
||||
BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
|
||||
return __crypto_cipher_cast(tfm);
|
||||
}
|
||||
|
||||
static inline struct crypto_cipher *crypto_alloc_cipher(const char *alg_name,
|
||||
u32 type, u32 mask)
|
||||
{
|
||||
type &= ~CRYPTO_ALG_TYPE_MASK;
|
||||
type |= CRYPTO_ALG_TYPE_CIPHER;
|
||||
mask |= CRYPTO_ALG_TYPE_MASK;
|
||||
|
||||
return __crypto_cipher_cast(crypto_alloc_base(alg_name, type, mask));
|
||||
}
|
||||
|
||||
static inline struct crypto_tfm *crypto_cipher_tfm(struct crypto_cipher *tfm)
|
||||
{
|
||||
return tfm;
|
||||
}
|
||||
|
||||
static inline void crypto_free_cipher(struct crypto_cipher *tfm)
|
||||
{
|
||||
crypto_free_tfm(crypto_cipher_tfm(tfm));
|
||||
}
|
||||
|
||||
static inline int crypto_has_cipher(const char *alg_name, u32 type, u32 mask)
|
||||
{
|
||||
type &= ~CRYPTO_ALG_TYPE_MASK;
|
||||
type |= CRYPTO_ALG_TYPE_CIPHER;
|
||||
mask |= CRYPTO_ALG_TYPE_MASK;
|
||||
|
||||
return crypto_has_alg(alg_name, type, mask);
|
||||
}
|
||||
|
||||
static inline struct cipher_tfm *crypto_cipher_crt(struct crypto_cipher *tfm)
|
||||
{
|
||||
return &crypto_cipher_tfm(tfm)->crt_cipher;
|
||||
}
|
||||
|
||||
static inline unsigned int crypto_cipher_blocksize(struct crypto_cipher *tfm)
|
||||
{
|
||||
return crypto_tfm_alg_blocksize(crypto_cipher_tfm(tfm));
|
||||
}
|
||||
|
||||
static inline unsigned int crypto_cipher_alignmask(struct crypto_cipher *tfm)
|
||||
{
|
||||
return crypto_tfm_alg_alignmask(crypto_cipher_tfm(tfm));
|
||||
}
|
||||
|
||||
static inline u32 crypto_cipher_get_flags(struct crypto_cipher *tfm)
|
||||
{
|
||||
return crypto_tfm_get_flags(crypto_cipher_tfm(tfm));
|
||||
}
|
||||
|
||||
static inline void crypto_cipher_set_flags(struct crypto_cipher *tfm,
|
||||
u32 flags)
|
||||
{
|
||||
crypto_tfm_set_flags(crypto_cipher_tfm(tfm), flags);
|
||||
}
|
||||
|
||||
static inline void crypto_cipher_clear_flags(struct crypto_cipher *tfm,
|
||||
u32 flags)
|
||||
{
|
||||
crypto_tfm_clear_flags(crypto_cipher_tfm(tfm), flags);
|
||||
}
|
||||
|
||||
static inline int crypto_cipher_setkey(struct crypto_cipher *tfm,
|
||||
const u8 *key, unsigned int keylen)
|
||||
{
|
||||
return crypto_cipher_crt(tfm)->cit_setkey(crypto_cipher_tfm(tfm),
|
||||
key, keylen);
|
||||
}
|
||||
|
||||
static inline void crypto_cipher_encrypt_one(struct crypto_cipher *tfm,
|
||||
u8 *dst, const u8 *src)
|
||||
{
|
||||
crypto_cipher_crt(tfm)->cit_encrypt_one(crypto_cipher_tfm(tfm),
|
||||
dst, src);
|
||||
}
|
||||
|
||||
static inline void crypto_cipher_decrypt_one(struct crypto_cipher *tfm,
|
||||
u8 *dst, const u8 *src)
|
||||
{
|
||||
crypto_cipher_crt(tfm)->cit_decrypt_one(crypto_cipher_tfm(tfm),
|
||||
dst, src);
|
||||
}
|
||||
|
||||
void crypto_digest_init(struct crypto_tfm *tfm) __deprecated_for_modules;
|
||||
void crypto_digest_update(struct crypto_tfm *tfm,
|
||||
struct scatterlist *sg, unsigned int nsg)
|
||||
__deprecated_for_modules;
|
||||
void crypto_digest_final(struct crypto_tfm *tfm, u8 *out)
|
||||
__deprecated_for_modules;
|
||||
void crypto_digest_digest(struct crypto_tfm *tfm,
|
||||
struct scatterlist *sg, unsigned int nsg, u8 *out)
|
||||
__deprecated_for_modules;
|
||||
|
||||
static inline struct crypto_hash *__crypto_hash_cast(struct crypto_tfm *tfm)
|
||||
{
|
||||
return (struct crypto_hash *)tfm;
|
||||
}
|
||||
|
||||
static inline struct crypto_hash *crypto_hash_cast(struct crypto_tfm *tfm)
|
||||
{
|
||||
BUG_ON((crypto_tfm_alg_type(tfm) ^ CRYPTO_ALG_TYPE_HASH) &
|
||||
CRYPTO_ALG_TYPE_HASH_MASK);
|
||||
return __crypto_hash_cast(tfm);
|
||||
}
|
||||
|
||||
static int crypto_digest_setkey(struct crypto_tfm *tfm, const u8 *key,
|
||||
unsigned int keylen) __deprecated;
|
||||
static inline int crypto_digest_setkey(struct crypto_tfm *tfm,
|
||||
const u8 *key, unsigned int keylen)
|
||||
{
|
||||
BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_DIGEST);
|
||||
if (tfm->crt_digest.dit_setkey == NULL)
|
||||
return -ENOSYS;
|
||||
return tfm->crt_digest.dit_setkey(tfm, key, keylen);
|
||||
return tfm->crt_hash.setkey(crypto_hash_cast(tfm), key, keylen);
|
||||
}
|
||||
|
||||
static inline int crypto_cipher_setkey(struct crypto_tfm *tfm,
|
||||
const u8 *key, unsigned int keylen)
|
||||
static inline struct crypto_hash *crypto_alloc_hash(const char *alg_name,
|
||||
u32 type, u32 mask)
|
||||
{
|
||||
BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
|
||||
return tfm->crt_cipher.cit_setkey(tfm, key, keylen);
|
||||
type &= ~CRYPTO_ALG_TYPE_MASK;
|
||||
type |= CRYPTO_ALG_TYPE_HASH;
|
||||
mask |= CRYPTO_ALG_TYPE_HASH_MASK;
|
||||
|
||||
return __crypto_hash_cast(crypto_alloc_base(alg_name, type, mask));
|
||||
}
|
||||
|
||||
static inline struct crypto_tfm *crypto_hash_tfm(struct crypto_hash *tfm)
|
||||
{
|
||||
return &tfm->base;
|
||||
}
|
||||
|
||||
static inline void crypto_free_hash(struct crypto_hash *tfm)
|
||||
{
|
||||
crypto_free_tfm(crypto_hash_tfm(tfm));
|
||||
}
|
||||
|
||||
static inline int crypto_has_hash(const char *alg_name, u32 type, u32 mask)
|
||||
{
|
||||
type &= ~CRYPTO_ALG_TYPE_MASK;
|
||||
type |= CRYPTO_ALG_TYPE_HASH;
|
||||
mask |= CRYPTO_ALG_TYPE_HASH_MASK;
|
||||
|
||||
return crypto_has_alg(alg_name, type, mask);
|
||||
}
|
||||
|
||||
static inline struct hash_tfm *crypto_hash_crt(struct crypto_hash *tfm)
|
||||
{
|
||||
return &crypto_hash_tfm(tfm)->crt_hash;
|
||||
}
|
||||
|
||||
static inline unsigned int crypto_hash_blocksize(struct crypto_hash *tfm)
|
||||
{
|
||||
return crypto_tfm_alg_blocksize(crypto_hash_tfm(tfm));
|
||||
}
|
||||
|
||||
static inline unsigned int crypto_hash_alignmask(struct crypto_hash *tfm)
|
||||
{
|
||||
return crypto_tfm_alg_alignmask(crypto_hash_tfm(tfm));
|
||||
}
|
||||
|
||||
static inline unsigned int crypto_hash_digestsize(struct crypto_hash *tfm)
|
||||
{
|
||||
return crypto_hash_crt(tfm)->digestsize;
|
||||
}
|
||||
|
||||
static inline u32 crypto_hash_get_flags(struct crypto_hash *tfm)
|
||||
{
|
||||
return crypto_tfm_get_flags(crypto_hash_tfm(tfm));
|
||||
}
|
||||
|
||||
static inline void crypto_hash_set_flags(struct crypto_hash *tfm, u32 flags)
|
||||
{
|
||||
crypto_tfm_set_flags(crypto_hash_tfm(tfm), flags);
|
||||
}
|
||||
|
||||
static inline void crypto_hash_clear_flags(struct crypto_hash *tfm, u32 flags)
|
||||
{
|
||||
crypto_tfm_clear_flags(crypto_hash_tfm(tfm), flags);
|
||||
}
|
||||
|
||||
static inline int crypto_hash_init(struct hash_desc *desc)
|
||||
{
|
||||
return crypto_hash_crt(desc->tfm)->init(desc);
|
||||
}
|
||||
|
||||
static inline int crypto_hash_update(struct hash_desc *desc,
|
||||
struct scatterlist *sg,
|
||||
unsigned int nbytes)
|
||||
{
|
||||
return crypto_hash_crt(desc->tfm)->update(desc, sg, nbytes);
|
||||
}
|
||||
|
||||
static inline int crypto_hash_final(struct hash_desc *desc, u8 *out)
|
||||
{
|
||||
return crypto_hash_crt(desc->tfm)->final(desc, out);
|
||||
}
|
||||
|
||||
static inline int crypto_hash_digest(struct hash_desc *desc,
|
||||
struct scatterlist *sg,
|
||||
unsigned int nbytes, u8 *out)
|
||||
{
|
||||
return crypto_hash_crt(desc->tfm)->digest(desc, sg, nbytes, out);
|
||||
}
|
||||
|
||||
static inline int crypto_hash_setkey(struct crypto_hash *hash,
|
||||
const u8 *key, unsigned int keylen)
|
||||
{
|
||||
return crypto_hash_crt(hash)->setkey(hash, key, keylen);
|
||||
}
|
||||
|
||||
static int crypto_cipher_encrypt(struct crypto_tfm *tfm,
|
||||
struct scatterlist *dst,
|
||||
struct scatterlist *src,
|
||||
unsigned int nbytes) __deprecated;
|
||||
static inline int crypto_cipher_encrypt(struct crypto_tfm *tfm,
|
||||
struct scatterlist *dst,
|
||||
struct scatterlist *src,
|
||||
|
|
@ -369,16 +844,23 @@ static inline int crypto_cipher_encrypt(struct crypto_tfm *tfm,
|
|||
return tfm->crt_cipher.cit_encrypt(tfm, dst, src, nbytes);
|
||||
}
|
||||
|
||||
static int crypto_cipher_encrypt_iv(struct crypto_tfm *tfm,
|
||||
struct scatterlist *dst,
|
||||
struct scatterlist *src,
|
||||
unsigned int nbytes, u8 *iv) __deprecated;
|
||||
static inline int crypto_cipher_encrypt_iv(struct crypto_tfm *tfm,
|
||||
struct scatterlist *dst,
|
||||
struct scatterlist *src,
|
||||
unsigned int nbytes, u8 *iv)
|
||||
{
|
||||
BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
|
||||
BUG_ON(tfm->crt_cipher.cit_mode == CRYPTO_TFM_MODE_ECB);
|
||||
return tfm->crt_cipher.cit_encrypt_iv(tfm, dst, src, nbytes, iv);
|
||||
}
|
||||
|
||||
static int crypto_cipher_decrypt(struct crypto_tfm *tfm,
|
||||
struct scatterlist *dst,
|
||||
struct scatterlist *src,
|
||||
unsigned int nbytes) __deprecated;
|
||||
static inline int crypto_cipher_decrypt(struct crypto_tfm *tfm,
|
||||
struct scatterlist *dst,
|
||||
struct scatterlist *src,
|
||||
|
|
@ -388,16 +870,21 @@ static inline int crypto_cipher_decrypt(struct crypto_tfm *tfm,
|
|||
return tfm->crt_cipher.cit_decrypt(tfm, dst, src, nbytes);
|
||||
}
|
||||
|
||||
static int crypto_cipher_decrypt_iv(struct crypto_tfm *tfm,
|
||||
struct scatterlist *dst,
|
||||
struct scatterlist *src,
|
||||
unsigned int nbytes, u8 *iv) __deprecated;
|
||||
static inline int crypto_cipher_decrypt_iv(struct crypto_tfm *tfm,
|
||||
struct scatterlist *dst,
|
||||
struct scatterlist *src,
|
||||
unsigned int nbytes, u8 *iv)
|
||||
{
|
||||
BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
|
||||
BUG_ON(tfm->crt_cipher.cit_mode == CRYPTO_TFM_MODE_ECB);
|
||||
return tfm->crt_cipher.cit_decrypt_iv(tfm, dst, src, nbytes, iv);
|
||||
}
|
||||
|
||||
static void crypto_cipher_set_iv(struct crypto_tfm *tfm,
|
||||
const u8 *src, unsigned int len) __deprecated;
|
||||
static inline void crypto_cipher_set_iv(struct crypto_tfm *tfm,
|
||||
const u8 *src, unsigned int len)
|
||||
{
|
||||
|
|
@ -405,6 +892,8 @@ static inline void crypto_cipher_set_iv(struct crypto_tfm *tfm,
|
|||
memcpy(tfm->crt_cipher.cit_iv, src, len);
|
||||
}
|
||||
|
||||
static void crypto_cipher_get_iv(struct crypto_tfm *tfm,
|
||||
u8 *dst, unsigned int len) __deprecated;
|
||||
static inline void crypto_cipher_get_iv(struct crypto_tfm *tfm,
|
||||
u8 *dst, unsigned int len)
|
||||
{
|
||||
|
|
@ -412,34 +901,70 @@ static inline void crypto_cipher_get_iv(struct crypto_tfm *tfm,
|
|||
memcpy(dst, tfm->crt_cipher.cit_iv, len);
|
||||
}
|
||||
|
||||
static inline int crypto_comp_compress(struct crypto_tfm *tfm,
|
||||
static inline struct crypto_comp *__crypto_comp_cast(struct crypto_tfm *tfm)
|
||||
{
|
||||
return (struct crypto_comp *)tfm;
|
||||
}
|
||||
|
||||
static inline struct crypto_comp *crypto_comp_cast(struct crypto_tfm *tfm)
|
||||
{
|
||||
BUG_ON((crypto_tfm_alg_type(tfm) ^ CRYPTO_ALG_TYPE_COMPRESS) &
|
||||
CRYPTO_ALG_TYPE_MASK);
|
||||
return __crypto_comp_cast(tfm);
|
||||
}
|
||||
|
||||
static inline struct crypto_comp *crypto_alloc_comp(const char *alg_name,
|
||||
u32 type, u32 mask)
|
||||
{
|
||||
type &= ~CRYPTO_ALG_TYPE_MASK;
|
||||
type |= CRYPTO_ALG_TYPE_COMPRESS;
|
||||
mask |= CRYPTO_ALG_TYPE_MASK;
|
||||
|
||||
return __crypto_comp_cast(crypto_alloc_base(alg_name, type, mask));
|
||||
}
|
||||
|
||||
static inline struct crypto_tfm *crypto_comp_tfm(struct crypto_comp *tfm)
|
||||
{
|
||||
return tfm;
|
||||
}
|
||||
|
||||
static inline void crypto_free_comp(struct crypto_comp *tfm)
|
||||
{
|
||||
crypto_free_tfm(crypto_comp_tfm(tfm));
|
||||
}
|
||||
|
||||
static inline int crypto_has_comp(const char *alg_name, u32 type, u32 mask)
|
||||
{
|
||||
type &= ~CRYPTO_ALG_TYPE_MASK;
|
||||
type |= CRYPTO_ALG_TYPE_COMPRESS;
|
||||
mask |= CRYPTO_ALG_TYPE_MASK;
|
||||
|
||||
return crypto_has_alg(alg_name, type, mask);
|
||||
}
|
||||
|
||||
static inline const char *crypto_comp_name(struct crypto_comp *tfm)
|
||||
{
|
||||
return crypto_tfm_alg_name(crypto_comp_tfm(tfm));
|
||||
}
|
||||
|
||||
static inline struct compress_tfm *crypto_comp_crt(struct crypto_comp *tfm)
|
||||
{
|
||||
return &crypto_comp_tfm(tfm)->crt_compress;
|
||||
}
|
||||
|
||||
static inline int crypto_comp_compress(struct crypto_comp *tfm,
|
||||
const u8 *src, unsigned int slen,
|
||||
u8 *dst, unsigned int *dlen)
|
||||
{
|
||||
BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_COMPRESS);
|
||||
return tfm->crt_compress.cot_compress(tfm, src, slen, dst, dlen);
|
||||
return crypto_comp_crt(tfm)->cot_compress(tfm, src, slen, dst, dlen);
|
||||
}
|
||||
|
||||
static inline int crypto_comp_decompress(struct crypto_tfm *tfm,
|
||||
static inline int crypto_comp_decompress(struct crypto_comp *tfm,
|
||||
const u8 *src, unsigned int slen,
|
||||
u8 *dst, unsigned int *dlen)
|
||||
{
|
||||
BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_COMPRESS);
|
||||
return tfm->crt_compress.cot_decompress(tfm, src, slen, dst, dlen);
|
||||
return crypto_comp_crt(tfm)->cot_decompress(tfm, src, slen, dst, dlen);
|
||||
}
|
||||
|
||||
/*
|
||||
* HMAC support.
|
||||
*/
|
||||
#ifdef CONFIG_CRYPTO_HMAC
|
||||
void crypto_hmac_init(struct crypto_tfm *tfm, u8 *key, unsigned int *keylen);
|
||||
void crypto_hmac_update(struct crypto_tfm *tfm,
|
||||
struct scatterlist *sg, unsigned int nsg);
|
||||
void crypto_hmac_final(struct crypto_tfm *tfm, u8 *key,
|
||||
unsigned int *keylen, u8 *out);
|
||||
void crypto_hmac(struct crypto_tfm *tfm, u8 *key, unsigned int *keylen,
|
||||
struct scatterlist *sg, unsigned int nsg, u8 *out);
|
||||
#endif /* CONFIG_CRYPTO_HMAC */
|
||||
|
||||
#endif /* _LINUX_CRYPTO_H */
|
||||
|
||||
|
|
|
|||
|
|
@ -221,6 +221,7 @@ static inline int dname_external(struct dentry *dentry)
|
|||
*/
|
||||
extern void d_instantiate(struct dentry *, struct inode *);
|
||||
extern struct dentry * d_instantiate_unique(struct dentry *, struct inode *);
|
||||
extern struct dentry * d_materialise_unique(struct dentry *, struct inode *);
|
||||
extern void d_delete(struct dentry *);
|
||||
|
||||
/* allocate/de-allocate */
|
||||
|
|
|
|||
|
|
@ -169,6 +169,12 @@ enum {
|
|||
DCCPO_MAX_CCID_SPECIFIC = 255,
|
||||
};
|
||||
|
||||
/* DCCP CCIDS */
|
||||
enum {
|
||||
DCCPC_CCID2 = 2,
|
||||
DCCPC_CCID3 = 3,
|
||||
};
|
||||
|
||||
/* DCCP features */
|
||||
enum {
|
||||
DCCPF_RESERVED = 0,
|
||||
|
|
@ -320,7 +326,7 @@ static inline unsigned int dccp_hdr_len(const struct sk_buff *skb)
|
|||
/* initial values for each feature */
|
||||
#define DCCPF_INITIAL_SEQUENCE_WINDOW 100
|
||||
#define DCCPF_INITIAL_ACK_RATIO 2
|
||||
#define DCCPF_INITIAL_CCID 2
|
||||
#define DCCPF_INITIAL_CCID DCCPC_CCID2
|
||||
#define DCCPF_INITIAL_SEND_ACK_VECTOR 1
|
||||
/* FIXME: for now we're default to 1 but it should really be 0 */
|
||||
#define DCCPF_INITIAL_SEND_NDP_COUNT 1
|
||||
|
|
@ -404,6 +410,7 @@ struct dccp_service_list {
|
|||
};
|
||||
|
||||
#define DCCP_SERVICE_INVALID_VALUE htonl((__u32)-1)
|
||||
#define DCCP_SERVICE_CODE_IS_ABSENT 0
|
||||
|
||||
static inline int dccp_list_has_service(const struct dccp_service_list *sl,
|
||||
const __be32 service)
|
||||
|
|
@ -438,6 +445,7 @@ struct dccp_ackvec;
|
|||
* @dccps_role - Role of this sock, one of %dccp_role
|
||||
* @dccps_ndp_count - number of Non Data Packets since last data packet
|
||||
* @dccps_hc_rx_ackvec - rx half connection ack vector
|
||||
* @dccps_xmit_timer - timer for when CCID is not ready to send
|
||||
*/
|
||||
struct dccp_sock {
|
||||
/* inet_connection_sock has to be the first member of dccp_sock */
|
||||
|
|
@ -470,6 +478,7 @@ struct dccp_sock {
|
|||
enum dccp_role dccps_role:2;
|
||||
__u8 dccps_hc_rx_insert_options:1;
|
||||
__u8 dccps_hc_tx_insert_options:1;
|
||||
struct timer_list dccps_xmit_timer;
|
||||
};
|
||||
|
||||
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)
|
|||
return (struct dccp_minisock *)&dccp_sk(sk)->dccps_minisock;
|
||||
}
|
||||
|
||||
static inline int dccp_service_not_initialized(const struct sock *sk)
|
||||
{
|
||||
return dccp_sk(sk)->dccps_service == DCCP_SERVICE_INVALID_VALUE;
|
||||
}
|
||||
|
||||
static inline const char *dccp_role(const struct sock *sk)
|
||||
{
|
||||
switch (dccp_sk(sk)->dccps_role) {
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
#include <linux/kobject.h>
|
||||
#include <linux/klist.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/pm.h>
|
||||
|
|
@ -51,14 +52,17 @@ struct bus_type {
|
|||
int (*probe)(struct device * dev);
|
||||
int (*remove)(struct device * dev);
|
||||
void (*shutdown)(struct device * dev);
|
||||
int (*suspend)(struct device * dev, pm_message_t state);
|
||||
int (*resume)(struct device * dev);
|
||||
|
||||
int (*suspend)(struct device * dev, pm_message_t state);
|
||||
int (*suspend_late)(struct device * dev, pm_message_t state);
|
||||
int (*resume_early)(struct device * dev);
|
||||
int (*resume)(struct device * dev);
|
||||
};
|
||||
|
||||
extern int bus_register(struct bus_type * bus);
|
||||
extern int __must_check bus_register(struct bus_type * bus);
|
||||
extern void bus_unregister(struct bus_type * bus);
|
||||
|
||||
extern void bus_rescan_devices(struct bus_type * bus);
|
||||
extern int __must_check bus_rescan_devices(struct bus_type * bus);
|
||||
|
||||
/* iterator helpers for buses */
|
||||
|
||||
|
|
@ -67,9 +71,9 @@ int bus_for_each_dev(struct bus_type * bus, struct device * start, void * data,
|
|||
struct device * bus_find_device(struct bus_type *bus, struct device *start,
|
||||
void *data, int (*match)(struct device *, void *));
|
||||
|
||||
int bus_for_each_drv(struct bus_type * bus, struct device_driver * start,
|
||||
void * data, int (*fn)(struct device_driver *, void *));
|
||||
|
||||
int __must_check bus_for_each_drv(struct bus_type *bus,
|
||||
struct device_driver *start, void *data,
|
||||
int (*fn)(struct device_driver *, void *));
|
||||
|
||||
/* driverfs interface for exporting bus attributes */
|
||||
|
||||
|
|
@ -82,7 +86,8 @@ struct bus_attribute {
|
|||
#define BUS_ATTR(_name,_mode,_show,_store) \
|
||||
struct bus_attribute bus_attr_##_name = __ATTR(_name,_mode,_show,_store)
|
||||
|
||||
extern int bus_create_file(struct bus_type *, struct bus_attribute *);
|
||||
extern int __must_check bus_create_file(struct bus_type *,
|
||||
struct bus_attribute *);
|
||||
extern void bus_remove_file(struct bus_type *, struct bus_attribute *);
|
||||
|
||||
struct device_driver {
|
||||
|
|
@ -101,16 +106,18 @@ struct device_driver {
|
|||
void (*shutdown) (struct device * dev);
|
||||
int (*suspend) (struct device * dev, pm_message_t state);
|
||||
int (*resume) (struct device * dev);
|
||||
|
||||
unsigned int multithread_probe:1;
|
||||
};
|
||||
|
||||
|
||||
extern int driver_register(struct device_driver * drv);
|
||||
extern int __must_check driver_register(struct device_driver * drv);
|
||||
extern void driver_unregister(struct device_driver * drv);
|
||||
|
||||
extern struct device_driver * get_driver(struct device_driver * drv);
|
||||
extern void put_driver(struct device_driver * drv);
|
||||
extern struct device_driver *driver_find(const char *name, struct bus_type *bus);
|
||||
|
||||
extern int driver_probe_done(void);
|
||||
|
||||
/* driverfs interface for exporting driver attributes */
|
||||
|
||||
|
|
@ -123,16 +130,17 @@ struct driver_attribute {
|
|||
#define DRIVER_ATTR(_name,_mode,_show,_store) \
|
||||
struct driver_attribute driver_attr_##_name = __ATTR(_name,_mode,_show,_store)
|
||||
|
||||
extern int driver_create_file(struct device_driver *, struct driver_attribute *);
|
||||
extern int __must_check driver_create_file(struct device_driver *,
|
||||
struct driver_attribute *);
|
||||
extern void driver_remove_file(struct device_driver *, struct driver_attribute *);
|
||||
|
||||
extern int driver_for_each_device(struct device_driver * drv, struct device * start,
|
||||
void * data, int (*fn)(struct device *, void *));
|
||||
extern int __must_check driver_for_each_device(struct device_driver * drv,
|
||||
struct device *start, void *data,
|
||||
int (*fn)(struct device *, void *));
|
||||
struct device * driver_find_device(struct device_driver *drv,
|
||||
struct device *start, void *data,
|
||||
int (*match)(struct device *, void *));
|
||||
|
||||
|
||||
/*
|
||||
* device classes
|
||||
*/
|
||||
|
|
@ -146,17 +154,26 @@ struct class {
|
|||
struct list_head interfaces;
|
||||
struct semaphore sem; /* locks both the children and interfaces lists */
|
||||
|
||||
struct kobject *virtual_dir;
|
||||
|
||||
struct class_attribute * class_attrs;
|
||||
struct class_device_attribute * class_dev_attrs;
|
||||
struct device_attribute * dev_attrs;
|
||||
|
||||
int (*uevent)(struct class_device *dev, char **envp,
|
||||
int num_envp, char *buffer, int buffer_size);
|
||||
int (*dev_uevent)(struct device *dev, char **envp, int num_envp,
|
||||
char *buffer, int buffer_size);
|
||||
|
||||
void (*release)(struct class_device *dev);
|
||||
void (*class_release)(struct class *class);
|
||||
void (*dev_release)(struct device *dev);
|
||||
|
||||
int (*suspend)(struct device *, pm_message_t state);
|
||||
int (*resume)(struct device *);
|
||||
};
|
||||
|
||||
extern int class_register(struct class *);
|
||||
extern int __must_check class_register(struct class *);
|
||||
extern void class_unregister(struct class *);
|
||||
|
||||
|
||||
|
|
@ -169,7 +186,8 @@ struct class_attribute {
|
|||
#define CLASS_ATTR(_name,_mode,_show,_store) \
|
||||
struct class_attribute class_attr_##_name = __ATTR(_name,_mode,_show,_store)
|
||||
|
||||
extern int class_create_file(struct class *, const struct class_attribute *);
|
||||
extern int __must_check class_create_file(struct class *,
|
||||
const struct class_attribute *);
|
||||
extern void class_remove_file(struct class *, const struct class_attribute *);
|
||||
|
||||
struct class_device_attribute {
|
||||
|
|
@ -182,7 +200,7 @@ struct class_device_attribute {
|
|||
struct class_device_attribute class_device_attr_##_name = \
|
||||
__ATTR(_name,_mode,_show,_store)
|
||||
|
||||
extern int class_device_create_file(struct class_device *,
|
||||
extern int __must_check class_device_create_file(struct class_device *,
|
||||
const struct class_device_attribute *);
|
||||
|
||||
/**
|
||||
|
|
@ -242,10 +260,10 @@ class_set_devdata (struct class_device *dev, void *data)
|
|||
}
|
||||
|
||||
|
||||
extern int class_device_register(struct class_device *);
|
||||
extern int __must_check class_device_register(struct class_device *);
|
||||
extern void class_device_unregister(struct class_device *);
|
||||
extern void class_device_initialize(struct class_device *);
|
||||
extern int class_device_add(struct class_device *);
|
||||
extern int __must_check class_device_add(struct class_device *);
|
||||
extern void class_device_del(struct class_device *);
|
||||
|
||||
extern int class_device_rename(struct class_device *, char *);
|
||||
|
|
@ -255,7 +273,7 @@ extern void class_device_put(struct class_device *);
|
|||
|
||||
extern void class_device_remove_file(struct class_device *,
|
||||
const struct class_device_attribute *);
|
||||
extern int class_device_create_bin_file(struct class_device *,
|
||||
extern int __must_check class_device_create_bin_file(struct class_device *,
|
||||
struct bin_attribute *);
|
||||
extern void class_device_remove_bin_file(struct class_device *,
|
||||
struct bin_attribute *);
|
||||
|
|
@ -266,22 +284,23 @@ struct class_interface {
|
|||
|
||||
int (*add) (struct class_device *, struct class_interface *);
|
||||
void (*remove) (struct class_device *, struct class_interface *);
|
||||
int (*add_dev) (struct device *, struct class_interface *);
|
||||
void (*remove_dev) (struct device *, struct class_interface *);
|
||||
};
|
||||
|
||||
extern int class_interface_register(struct class_interface *);
|
||||
extern int __must_check class_interface_register(struct class_interface *);
|
||||
extern void class_interface_unregister(struct class_interface *);
|
||||
|
||||
extern struct class *class_create(struct module *owner, char *name);
|
||||
extern struct class *class_create(struct module *owner, const char *name);
|
||||
extern void class_destroy(struct class *cls);
|
||||
extern struct class_device *class_device_create(struct class *cls,
|
||||
struct class_device *parent,
|
||||
dev_t devt,
|
||||
struct device *device,
|
||||
char *fmt, ...)
|
||||
const char *fmt, ...)
|
||||
__attribute__((format(printf,5,6)));
|
||||
extern void class_device_destroy(struct class *cls, dev_t devt);
|
||||
|
||||
|
||||
/* interface for exporting device attributes */
|
||||
struct device_attribute {
|
||||
struct attribute attr;
|
||||
|
|
@ -294,8 +313,13 @@ struct device_attribute {
|
|||
#define DEVICE_ATTR(_name,_mode,_show,_store) \
|
||||
struct device_attribute dev_attr_##_name = __ATTR(_name,_mode,_show,_store)
|
||||
|
||||
extern int device_create_file(struct device *device, struct device_attribute * entry);
|
||||
extern int __must_check device_create_file(struct device *device,
|
||||
struct device_attribute * entry);
|
||||
extern void device_remove_file(struct device * dev, struct device_attribute * attr);
|
||||
extern int __must_check device_create_bin_file(struct device *dev,
|
||||
struct bin_attribute *attr);
|
||||
extern void device_remove_bin_file(struct device *dev,
|
||||
struct bin_attribute *attr);
|
||||
struct device {
|
||||
struct klist klist_children;
|
||||
struct klist_node knode_parent; /* node in sibling list */
|
||||
|
|
@ -305,6 +329,7 @@ struct device {
|
|||
|
||||
struct kobject kobj;
|
||||
char bus_id[BUS_ID_SIZE]; /* position on parent bus */
|
||||
unsigned is_registered:1;
|
||||
struct device_attribute uevent_attr;
|
||||
struct device_attribute *devt_attr;
|
||||
|
||||
|
|
@ -338,6 +363,7 @@ struct device {
|
|||
struct list_head node;
|
||||
struct class *class; /* optional*/
|
||||
dev_t devt; /* dev_t, creates the sysfs "dev" */
|
||||
struct attribute_group **groups; /* optional groups */
|
||||
|
||||
void (*release)(struct device * dev);
|
||||
};
|
||||
|
|
@ -356,38 +382,41 @@ dev_set_drvdata (struct device *dev, void *data)
|
|||
|
||||
static inline int device_is_registered(struct device *dev)
|
||||
{
|
||||
return klist_node_attached(&dev->knode_bus);
|
||||
return dev->is_registered;
|
||||
}
|
||||
|
||||
/*
|
||||
* High level routines for use by the bus drivers
|
||||
*/
|
||||
extern int device_register(struct device * dev);
|
||||
extern int __must_check device_register(struct device * dev);
|
||||
extern void device_unregister(struct device * dev);
|
||||
extern void device_initialize(struct device * dev);
|
||||
extern int device_add(struct device * dev);
|
||||
extern int __must_check device_add(struct device * dev);
|
||||
extern void device_del(struct device * dev);
|
||||
extern int device_for_each_child(struct device *, void *,
|
||||
extern int __must_check device_for_each_child(struct device *, void *,
|
||||
int (*fn)(struct device *, void *));
|
||||
extern int device_rename(struct device *dev, char *new_name);
|
||||
|
||||
/*
|
||||
* Manual binding of a device to driver. See drivers/base/bus.c
|
||||
* for information on use.
|
||||
*/
|
||||
extern void device_bind_driver(struct device * dev);
|
||||
extern int __must_check device_bind_driver(struct device *dev);
|
||||
extern void device_release_driver(struct device * dev);
|
||||
extern int device_attach(struct device * dev);
|
||||
extern void driver_attach(struct device_driver * drv);
|
||||
extern void device_reprobe(struct device *dev);
|
||||
extern int __must_check device_attach(struct device * dev);
|
||||
extern int __must_check driver_attach(struct device_driver *drv);
|
||||
extern int __must_check device_reprobe(struct device *dev);
|
||||
|
||||
/*
|
||||
* Easy functions for dynamically creating devices on the fly
|
||||
*/
|
||||
extern struct device *device_create(struct class *cls, struct device *parent,
|
||||
dev_t devt, char *fmt, ...)
|
||||
dev_t devt, const char *fmt, ...)
|
||||
__attribute__((format(printf,4,5)));
|
||||
extern void device_destroy(struct class *cls, dev_t devt);
|
||||
|
||||
extern int virtual_device_parent(struct device *dev);
|
||||
|
||||
/*
|
||||
* Platform "fixup" functions - allow the platform to have their say
|
||||
* about devices and actions that the general device layer doesn't
|
||||
|
|
@ -412,7 +441,7 @@ extern void device_shutdown(void);
|
|||
|
||||
|
||||
/* drivers/base/firmware.c */
|
||||
extern int firmware_register(struct subsystem *);
|
||||
extern int __must_check firmware_register(struct subsystem *);
|
||||
extern void firmware_unregister(struct subsystem *);
|
||||
|
||||
/* debugging and troubleshooting/diagnostic helpers. */
|
||||
|
|
|
|||
|
|
@ -24,6 +24,13 @@ enum dma_data_direction {
|
|||
#define DMA_28BIT_MASK 0x000000000fffffffULL
|
||||
#define DMA_24BIT_MASK 0x0000000000ffffffULL
|
||||
|
||||
static inline int valid_dma_direction(int dma_direction)
|
||||
{
|
||||
return ((dma_direction == DMA_BIDIRECTIONAL) ||
|
||||
(dma_direction == DMA_TO_DEVICE) ||
|
||||
(dma_direction == DMA_FROM_DEVICE));
|
||||
}
|
||||
|
||||
#include <asm/dma-mapping.h>
|
||||
|
||||
/* Backwards compat, remove in 2.7.x */
|
||||
|
|
|
|||
|
|
@ -27,7 +27,8 @@ enum dmi_device_type {
|
|||
DMI_DEV_TYPE_ETHERNET,
|
||||
DMI_DEV_TYPE_TOKENRING,
|
||||
DMI_DEV_TYPE_SOUND,
|
||||
DMI_DEV_TYPE_IPMI = -1
|
||||
DMI_DEV_TYPE_IPMI = -1,
|
||||
DMI_DEV_TYPE_OEM_STRING = -2
|
||||
};
|
||||
|
||||
struct dmi_header {
|
||||
|
|
|
|||
|
|
@ -1,2 +1,9 @@
|
|||
header-y += ca.h frontend.h net.h osd.h version.h
|
||||
unifdef-y := audio.h dmx.h video.h
|
||||
header-y += ca.h
|
||||
header-y += frontend.h
|
||||
header-y += net.h
|
||||
header-y += osd.h
|
||||
header-y += version.h
|
||||
|
||||
unifdef-y += audio.h
|
||||
unifdef-y += dmx.h
|
||||
unifdef-y += video.h
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@
|
|||
#define EDD_CL_EQUALS 0x3d646465 /* "edd=" */
|
||||
#define EDD_CL_OFF 0x666f /* "of" for off */
|
||||
#define EDD_CL_SKIP 0x6b73 /* "sk" for skipmbr */
|
||||
#define EDD_CL_ON 0x6e6f /* "on" for on */
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
|
|
|
|||
|
|
@ -9,8 +9,7 @@
|
|||
#ifndef __EFS_FS_SB_H__
|
||||
#define __EFS_FS_SB_H__
|
||||
|
||||
/* statfs() magic number for EFS */
|
||||
#define EFS_SUPER_MAGIC 0x414A53
|
||||
#include <linux/magic.h>
|
||||
|
||||
/* EFS superblock magic numbers */
|
||||
#define EFS_MAGIC 0x072959
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
#include <linux/ioport.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
|
||||
#define EISA_SIG_LEN 8
|
||||
#define EISA_MAX_SLOTS 8
|
||||
|
||||
#define EISA_MAX_RESOURCES 4
|
||||
|
|
@ -27,12 +27,6 @@
|
|||
#define EISA_CONFIG_ENABLED 1
|
||||
#define EISA_CONFIG_FORCED 2
|
||||
|
||||
/* The EISA signature, in ASCII form, null terminated */
|
||||
struct eisa_device_id {
|
||||
char sig[EISA_SIG_LEN];
|
||||
unsigned long driver_data;
|
||||
};
|
||||
|
||||
/* There is not much we can say about an EISA device, apart from
|
||||
* signature, slot number, and base address. dma_mask is set by
|
||||
* default to parent device mask..*/
|
||||
|
|
|
|||
|
|
@ -1,12 +1,16 @@
|
|||
#ifndef _LINUX_ELEVATOR_H
|
||||
#define _LINUX_ELEVATOR_H
|
||||
|
||||
#include <linux/percpu.h>
|
||||
|
||||
#ifdef CONFIG_BLOCK
|
||||
|
||||
typedef int (elevator_merge_fn) (request_queue_t *, struct request **,
|
||||
struct bio *);
|
||||
|
||||
typedef void (elevator_merge_req_fn) (request_queue_t *, struct request *, struct request *);
|
||||
|
||||
typedef void (elevator_merged_fn) (request_queue_t *, struct request *);
|
||||
typedef void (elevator_merged_fn) (request_queue_t *, struct request *, int);
|
||||
|
||||
typedef int (elevator_dispatch_fn) (request_queue_t *, int);
|
||||
|
||||
|
|
@ -14,9 +18,9 @@ typedef void (elevator_add_req_fn) (request_queue_t *, struct request *);
|
|||
typedef int (elevator_queue_empty_fn) (request_queue_t *);
|
||||
typedef struct request *(elevator_request_list_fn) (request_queue_t *, struct request *);
|
||||
typedef void (elevator_completed_req_fn) (request_queue_t *, struct request *);
|
||||
typedef int (elevator_may_queue_fn) (request_queue_t *, int, struct bio *);
|
||||
typedef int (elevator_may_queue_fn) (request_queue_t *, int);
|
||||
|
||||
typedef int (elevator_set_req_fn) (request_queue_t *, struct request *, struct bio *, gfp_t);
|
||||
typedef int (elevator_set_req_fn) (request_queue_t *, struct request *, gfp_t);
|
||||
typedef void (elevator_put_req_fn) (request_queue_t *, struct request *);
|
||||
typedef void (elevator_activate_req_fn) (request_queue_t *, struct request *);
|
||||
typedef void (elevator_deactivate_req_fn) (request_queue_t *, struct request *);
|
||||
|
|
@ -82,19 +86,21 @@ struct elevator_queue
|
|||
struct kobject kobj;
|
||||
struct elevator_type *elevator_type;
|
||||
struct mutex sysfs_lock;
|
||||
struct hlist_head *hash;
|
||||
};
|
||||
|
||||
/*
|
||||
* block elevator interface
|
||||
*/
|
||||
extern void elv_dispatch_sort(request_queue_t *, struct request *);
|
||||
extern void elv_dispatch_add_tail(request_queue_t *, struct request *);
|
||||
extern void elv_add_request(request_queue_t *, struct request *, int, int);
|
||||
extern void __elv_add_request(request_queue_t *, struct request *, int, int);
|
||||
extern void elv_insert(request_queue_t *, struct request *, int);
|
||||
extern int elv_merge(request_queue_t *, struct request **, struct bio *);
|
||||
extern void elv_merge_requests(request_queue_t *, struct request *,
|
||||
struct request *);
|
||||
extern void elv_merged_request(request_queue_t *, struct request *);
|
||||
extern void elv_merged_request(request_queue_t *, struct request *, int);
|
||||
extern void elv_dequeue_request(request_queue_t *, struct request *);
|
||||
extern void elv_requeue_request(request_queue_t *, struct request *);
|
||||
extern int elv_queue_empty(request_queue_t *);
|
||||
|
|
@ -103,9 +109,9 @@ extern struct request *elv_former_request(request_queue_t *, struct request *);
|
|||
extern struct request *elv_latter_request(request_queue_t *, struct request *);
|
||||
extern int elv_register_queue(request_queue_t *q);
|
||||
extern void elv_unregister_queue(request_queue_t *q);
|
||||
extern int elv_may_queue(request_queue_t *, int, struct bio *);
|
||||
extern int elv_may_queue(request_queue_t *, int);
|
||||
extern void elv_completed_request(request_queue_t *, struct request *);
|
||||
extern int elv_set_request(request_queue_t *, struct request *, struct bio *, gfp_t);
|
||||
extern int elv_set_request(request_queue_t *, struct request *, gfp_t);
|
||||
extern void elv_put_request(request_queue_t *, struct request *);
|
||||
|
||||
/*
|
||||
|
|
@ -124,6 +130,19 @@ extern int elevator_init(request_queue_t *, char *);
|
|||
extern void elevator_exit(elevator_t *);
|
||||
extern int elv_rq_merge_ok(struct request *, struct bio *);
|
||||
|
||||
/*
|
||||
* Helper functions.
|
||||
*/
|
||||
extern struct request *elv_rb_former_request(request_queue_t *, struct request *);
|
||||
extern struct request *elv_rb_latter_request(request_queue_t *, struct request *);
|
||||
|
||||
/*
|
||||
* rb support functions.
|
||||
*/
|
||||
extern struct request *elv_rb_add(struct rb_root *, struct request *);
|
||||
extern void elv_rb_del(struct rb_root *, struct request *);
|
||||
extern struct request *elv_rb_find(struct rb_root *, sector_t);
|
||||
|
||||
/*
|
||||
* Return values from elevator merger
|
||||
*/
|
||||
|
|
@ -149,5 +168,42 @@ enum {
|
|||
};
|
||||
|
||||
#define rq_end_sector(rq) ((rq)->sector + (rq)->nr_sectors)
|
||||
#define rb_entry_rq(node) rb_entry((node), struct request, rb_node)
|
||||
|
||||
/*
|
||||
* Hack to reuse the donelist list_head as the fifo time holder while
|
||||
* the request is in the io scheduler. Saves an unsigned long in rq.
|
||||
*/
|
||||
#define rq_fifo_time(rq) ((unsigned long) (rq)->donelist.next)
|
||||
#define rq_set_fifo_time(rq,exp) ((rq)->donelist.next = (void *) (exp))
|
||||
#define rq_entry_fifo(ptr) list_entry((ptr), struct request, queuelist)
|
||||
#define rq_fifo_clear(rq) do { \
|
||||
list_del_init(&(rq)->queuelist); \
|
||||
INIT_LIST_HEAD(&(rq)->donelist); \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
* io context count accounting
|
||||
*/
|
||||
#define elv_ioc_count_mod(name, __val) \
|
||||
do { \
|
||||
preempt_disable(); \
|
||||
__get_cpu_var(name) += (__val); \
|
||||
preempt_enable(); \
|
||||
} while (0)
|
||||
|
||||
#define elv_ioc_count_inc(name) elv_ioc_count_mod(name, 1)
|
||||
#define elv_ioc_count_dec(name) elv_ioc_count_mod(name, -1)
|
||||
|
||||
#define elv_ioc_count_read(name) \
|
||||
({ \
|
||||
unsigned long __val = 0; \
|
||||
int __cpu; \
|
||||
smp_wmb(); \
|
||||
for_each_possible_cpu(__cpu) \
|
||||
__val += per_cpu(name, __cpu); \
|
||||
__val; \
|
||||
})
|
||||
|
||||
#endif /* CONFIG_BLOCK */
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
#define EM_M32R 88 /* Renesas M32R */
|
||||
#define EM_H8_300 46 /* Renesas H8/300,300H,H8S */
|
||||
#define EM_FRV 0x5441 /* Fujitsu FR-V */
|
||||
#define EM_AVR32 0x18ad /* Atmel AVR32 */
|
||||
|
||||
/*
|
||||
* This is an interim value that we will use until the committee comes
|
||||
|
|
|
|||
90
include/linux/elfnote.h
Normal file
90
include/linux/elfnote.h
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
#ifndef _LINUX_ELFNOTE_H
|
||||
#define _LINUX_ELFNOTE_H
|
||||
/*
|
||||
* Helper macros to generate ELF Note structures, which are put into a
|
||||
* PT_NOTE segment of the final vmlinux image. These are useful for
|
||||
* including name-value pairs of metadata into the kernel binary (or
|
||||
* modules?) for use by external programs.
|
||||
*
|
||||
* Each note has three parts: a name, a type and a desc. The name is
|
||||
* intended to distinguish the note's originator, so it would be a
|
||||
* company, project, subsystem, etc; it must be in a suitable form for
|
||||
* use in a section name. The type is an integer which is used to tag
|
||||
* the data, and is considered to be within the "name" namespace (so
|
||||
* "FooCo"'s type 42 is distinct from "BarProj"'s type 42). The
|
||||
* "desc" field is the actual data. There are no constraints on the
|
||||
* desc field's contents, though typically they're fairly small.
|
||||
*
|
||||
* All notes from a given NAME are put into a section named
|
||||
* .note.NAME. When the kernel image is finally linked, all the notes
|
||||
* are packed into a single .notes section, which is mapped into the
|
||||
* PT_NOTE segment. Because notes for a given name are grouped into
|
||||
* the same section, they'll all be adjacent the output file.
|
||||
*
|
||||
* This file defines macros for both C and assembler use. Their
|
||||
* syntax is slightly different, but they're semantically similar.
|
||||
*
|
||||
* See the ELF specification for more detail about ELF notes.
|
||||
*/
|
||||
|
||||
#ifdef __ASSEMBLER__
|
||||
/*
|
||||
* Generate a structure with the same shape as Elf{32,64}_Nhdr (which
|
||||
* turn out to be the same size and shape), followed by the name and
|
||||
* desc data with appropriate padding. The 'desctype' argument is the
|
||||
* assembler pseudo op defining the type of the data e.g. .asciz while
|
||||
* 'descdata' is the data itself e.g. "hello, world".
|
||||
*
|
||||
* e.g. ELFNOTE(XYZCo, 42, .asciz, "forty-two")
|
||||
* ELFNOTE(XYZCo, 12, .long, 0xdeadbeef)
|
||||
*/
|
||||
#define ELFNOTE(name, type, desctype, descdata) \
|
||||
.pushsection .note.name ; \
|
||||
.align 4 ; \
|
||||
.long 2f - 1f /* namesz */ ; \
|
||||
.long 4f - 3f /* descsz */ ; \
|
||||
.long type ; \
|
||||
1:.asciz "name" ; \
|
||||
2:.align 4 ; \
|
||||
3:desctype descdata ; \
|
||||
4:.align 4 ; \
|
||||
.popsection ;
|
||||
#else /* !__ASSEMBLER__ */
|
||||
#include <linux/elf.h>
|
||||
/*
|
||||
* Use an anonymous structure which matches the shape of
|
||||
* Elf{32,64}_Nhdr, but includes the name and desc data. The size and
|
||||
* type of name and desc depend on the macro arguments. "name" must
|
||||
* be a literal string, and "desc" must be passed by value. You may
|
||||
* only define one note per line, since __LINE__ is used to generate
|
||||
* unique symbols.
|
||||
*/
|
||||
#define _ELFNOTE_PASTE(a,b) a##b
|
||||
#define _ELFNOTE(size, name, unique, type, desc) \
|
||||
static const struct { \
|
||||
struct elf##size##_note _nhdr; \
|
||||
unsigned char _name[sizeof(name)] \
|
||||
__attribute__((aligned(sizeof(Elf##size##_Word)))); \
|
||||
typeof(desc) _desc \
|
||||
__attribute__((aligned(sizeof(Elf##size##_Word)))); \
|
||||
} _ELFNOTE_PASTE(_note_, unique) \
|
||||
__attribute_used__ \
|
||||
__attribute__((section(".note." name), \
|
||||
aligned(sizeof(Elf##size##_Word)), \
|
||||
unused)) = { \
|
||||
{ \
|
||||
sizeof(name), \
|
||||
sizeof(desc), \
|
||||
type, \
|
||||
}, \
|
||||
name, \
|
||||
desc \
|
||||
}
|
||||
#define ELFNOTE(size, name, type, desc) \
|
||||
_ELFNOTE(size, name, __LINE__, type, desc)
|
||||
|
||||
#define ELFNOTE32(name, type, desc) ELFNOTE(32, name, type, desc)
|
||||
#define ELFNOTE64(name, type, desc) ELFNOTE(64, name, type, desc)
|
||||
#endif /* __ASSEMBLER__ */
|
||||
|
||||
#endif /* _LINUX_ELFNOTE_H */
|
||||
|
|
@ -15,6 +15,8 @@
|
|||
*/
|
||||
#define MAX_ERRNO 4095
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO)
|
||||
|
||||
static inline void *ERR_PTR(long error)
|
||||
|
|
@ -32,4 +34,6 @@ static inline long IS_ERR(const void *ptr)
|
|||
return IS_ERR_VALUE((unsigned long)ptr);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* _LINUX_ERR_H */
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ struct sock_exterr_skb
|
|||
} header;
|
||||
struct sock_extended_err ee;
|
||||
u16 addr_offset;
|
||||
u16 port;
|
||||
__be16 port;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
#define _LINUX_EXT2_FS_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/magic.h>
|
||||
|
||||
/*
|
||||
* The second extended filesystem constants/structures
|
||||
|
|
@ -63,11 +64,6 @@
|
|||
/* First non-reserved inode for old ext2 filesystems */
|
||||
#define EXT2_GOOD_OLD_FIRST_INO 11
|
||||
|
||||
/*
|
||||
* The second extended file system magic number
|
||||
*/
|
||||
#define EXT2_SUPER_MAGIC 0xEF53
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/ext2_fs_sb.h>
|
||||
static inline struct ext2_sb_info *EXT2_SB(struct super_block *sb)
|
||||
|
|
@ -169,41 +165,49 @@ struct ext2_group_desc
|
|||
#define EXT2_N_BLOCKS (EXT2_TIND_BLOCK + 1)
|
||||
|
||||
/*
|
||||
* Inode flags
|
||||
* Inode flags (GETFLAGS/SETFLAGS)
|
||||
*/
|
||||
#define EXT2_SECRM_FL 0x00000001 /* Secure deletion */
|
||||
#define EXT2_UNRM_FL 0x00000002 /* Undelete */
|
||||
#define EXT2_COMPR_FL 0x00000004 /* Compress file */
|
||||
#define EXT2_SYNC_FL 0x00000008 /* Synchronous updates */
|
||||
#define EXT2_IMMUTABLE_FL 0x00000010 /* Immutable file */
|
||||
#define EXT2_APPEND_FL 0x00000020 /* writes to file may only append */
|
||||
#define EXT2_NODUMP_FL 0x00000040 /* do not dump file */
|
||||
#define EXT2_NOATIME_FL 0x00000080 /* do not update atime */
|
||||
#define EXT2_SECRM_FL FS_SECRM_FL /* Secure deletion */
|
||||
#define EXT2_UNRM_FL FS_UNRM_FL /* Undelete */
|
||||
#define EXT2_COMPR_FL FS_COMPR_FL /* Compress file */
|
||||
#define EXT2_SYNC_FL FS_SYNC_FL /* Synchronous updates */
|
||||
#define EXT2_IMMUTABLE_FL FS_IMMUTABLE_FL /* Immutable file */
|
||||
#define EXT2_APPEND_FL FS_APPEND_FL /* writes to file may only append */
|
||||
#define EXT2_NODUMP_FL FS_NODUMP_FL /* do not dump file */
|
||||
#define EXT2_NOATIME_FL FS_NOATIME_FL /* do not update atime */
|
||||
/* Reserved for compression usage... */
|
||||
#define EXT2_DIRTY_FL 0x00000100
|
||||
#define EXT2_COMPRBLK_FL 0x00000200 /* One or more compressed clusters */
|
||||
#define EXT2_NOCOMP_FL 0x00000400 /* Don't compress */
|
||||
#define EXT2_ECOMPR_FL 0x00000800 /* Compression error */
|
||||
#define EXT2_DIRTY_FL FS_DIRTY_FL
|
||||
#define EXT2_COMPRBLK_FL FS_COMPRBLK_FL /* One or more compressed clusters */
|
||||
#define EXT2_NOCOMP_FL FS_NOCOMP_FL /* Don't compress */
|
||||
#define EXT2_ECOMPR_FL FS_ECOMPR_FL /* Compression error */
|
||||
/* End compression flags --- maybe not all used */
|
||||
#define EXT2_BTREE_FL 0x00001000 /* btree format dir */
|
||||
#define EXT2_INDEX_FL 0x00001000 /* hash-indexed directory */
|
||||
#define EXT2_IMAGIC_FL 0x00002000 /* AFS directory */
|
||||
#define EXT2_JOURNAL_DATA_FL 0x00004000 /* Reserved for ext3 */
|
||||
#define EXT2_NOTAIL_FL 0x00008000 /* file tail should not be merged */
|
||||
#define EXT2_DIRSYNC_FL 0x00010000 /* dirsync behaviour (directories only) */
|
||||
#define EXT2_TOPDIR_FL 0x00020000 /* Top of directory hierarchies*/
|
||||
#define EXT2_RESERVED_FL 0x80000000 /* reserved for ext2 lib */
|
||||
#define EXT2_BTREE_FL FS_BTREE_FL /* btree format dir */
|
||||
#define EXT2_INDEX_FL FS_INDEX_FL /* hash-indexed directory */
|
||||
#define EXT2_IMAGIC_FL FS_IMAGIC_FL /* AFS directory */
|
||||
#define EXT2_JOURNAL_DATA_FL FS_JOURNAL_DATA_FL /* Reserved for ext3 */
|
||||
#define EXT2_NOTAIL_FL FS_NOTAIL_FL /* file tail should not be merged */
|
||||
#define EXT2_DIRSYNC_FL FS_DIRSYNC_FL /* dirsync behaviour (directories only) */
|
||||
#define EXT2_TOPDIR_FL FS_TOPDIR_FL /* Top of directory hierarchies*/
|
||||
#define EXT2_RESERVED_FL FS_RESERVED_FL /* reserved for ext2 lib */
|
||||
|
||||
#define EXT2_FL_USER_VISIBLE 0x0003DFFF /* User visible flags */
|
||||
#define EXT2_FL_USER_MODIFIABLE 0x000380FF /* User modifiable flags */
|
||||
#define EXT2_FL_USER_VISIBLE FS_FL_USER_VISIBLE /* User visible flags */
|
||||
#define EXT2_FL_USER_MODIFIABLE FS_FL_USER_MODIFIABLE /* User modifiable flags */
|
||||
|
||||
/*
|
||||
* ioctl commands
|
||||
*/
|
||||
#define EXT2_IOC_GETFLAGS _IOR('f', 1, long)
|
||||
#define EXT2_IOC_SETFLAGS _IOW('f', 2, long)
|
||||
#define EXT2_IOC_GETVERSION _IOR('v', 1, long)
|
||||
#define EXT2_IOC_SETVERSION _IOW('v', 2, long)
|
||||
#define EXT2_IOC_GETFLAGS FS_IOC_GETFLAGS
|
||||
#define EXT2_IOC_SETFLAGS FS_IOC_SETFLAGS
|
||||
#define EXT2_IOC_GETVERSION FS_IOC_GETVERSION
|
||||
#define EXT2_IOC_SETVERSION FS_IOC_SETVERSION
|
||||
|
||||
/*
|
||||
* ioctl commands in 32 bit emulation
|
||||
*/
|
||||
#define EXT2_IOC32_GETFLAGS FS_IOC32_GETFLAGS
|
||||
#define EXT2_IOC32_SETFLAGS FS_IOC32_SETFLAGS
|
||||
#define EXT2_IOC32_GETVERSION FS_IOC32_GETVERSION
|
||||
#define EXT2_IOC32_SETVERSION FS_IOC32_SETVERSION
|
||||
|
||||
/*
|
||||
* Structure of an inode on the disk
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
#define _LINUX_EXT3_FS_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/magic.h>
|
||||
|
||||
/*
|
||||
* The second extended filesystem constants/structures
|
||||
|
|
@ -66,11 +67,6 @@
|
|||
/* First non-reserved inode for old ext3 filesystems */
|
||||
#define EXT3_GOOD_OLD_FIRST_INO 11
|
||||
|
||||
/*
|
||||
* The second extended file system magic number
|
||||
*/
|
||||
#define EXT3_SUPER_MAGIC 0xEF53
|
||||
|
||||
/*
|
||||
* Maximal count of links to a file
|
||||
*/
|
||||
|
|
@ -220,20 +216,37 @@ struct ext3_new_group_data {
|
|||
/*
|
||||
* ioctl commands
|
||||
*/
|
||||
#define EXT3_IOC_GETFLAGS _IOR('f', 1, long)
|
||||
#define EXT3_IOC_SETFLAGS _IOW('f', 2, long)
|
||||
#define EXT3_IOC_GETFLAGS FS_IOC_GETFLAGS
|
||||
#define EXT3_IOC_SETFLAGS FS_IOC_SETFLAGS
|
||||
#define EXT3_IOC_GETVERSION _IOR('f', 3, long)
|
||||
#define EXT3_IOC_SETVERSION _IOW('f', 4, long)
|
||||
#define EXT3_IOC_GROUP_EXTEND _IOW('f', 7, unsigned long)
|
||||
#define EXT3_IOC_GROUP_ADD _IOW('f', 8,struct ext3_new_group_input)
|
||||
#define EXT3_IOC_GETVERSION_OLD _IOR('v', 1, long)
|
||||
#define EXT3_IOC_SETVERSION_OLD _IOW('v', 2, long)
|
||||
#define EXT3_IOC_GETVERSION_OLD FS_IOC_GETVERSION
|
||||
#define EXT3_IOC_SETVERSION_OLD FS_IOC_SETVERSION
|
||||
#ifdef CONFIG_JBD_DEBUG
|
||||
#define EXT3_IOC_WAIT_FOR_READONLY _IOR('f', 99, long)
|
||||
#endif
|
||||
#define EXT3_IOC_GETRSVSZ _IOR('f', 5, long)
|
||||
#define EXT3_IOC_SETRSVSZ _IOW('f', 6, long)
|
||||
|
||||
/*
|
||||
* ioctl commands in 32 bit emulation
|
||||
*/
|
||||
#define EXT3_IOC32_GETFLAGS FS_IOC32_GETFLAGS
|
||||
#define EXT3_IOC32_SETFLAGS FS_IOC32_SETFLAGS
|
||||
#define EXT3_IOC32_GETVERSION _IOR('f', 3, int)
|
||||
#define EXT3_IOC32_SETVERSION _IOW('f', 4, int)
|
||||
#define EXT3_IOC32_GETRSVSZ _IOR('f', 5, int)
|
||||
#define EXT3_IOC32_SETRSVSZ _IOW('f', 6, int)
|
||||
#define EXT3_IOC32_GROUP_EXTEND _IOW('f', 7, unsigned int)
|
||||
#ifdef CONFIG_JBD_DEBUG
|
||||
#define EXT3_IOC32_WAIT_FOR_READONLY _IOR('f', 99, int)
|
||||
#endif
|
||||
#define EXT3_IOC32_GETVERSION_OLD FS_IOC32_GETVERSION
|
||||
#define EXT3_IOC32_SETVERSION_OLD FS_IOC32_SETVERSION
|
||||
|
||||
|
||||
/*
|
||||
* Mount options
|
||||
*/
|
||||
|
|
@ -464,7 +477,7 @@ struct ext3_super_block {
|
|||
*/
|
||||
__u8 s_prealloc_blocks; /* Nr of blocks to try to preallocate*/
|
||||
__u8 s_prealloc_dir_blocks; /* Nr to preallocate for dirs */
|
||||
__u16 s_reserved_gdt_blocks; /* Per group desc for online growth */
|
||||
__le16 s_reserved_gdt_blocks; /* Per group desc for online growth */
|
||||
/*
|
||||
* Journaling support valid if EXT3_FEATURE_COMPAT_HAS_JOURNAL set.
|
||||
*/
|
||||
|
|
@ -477,7 +490,7 @@ struct ext3_super_block {
|
|||
__u8 s_reserved_char_pad;
|
||||
__u16 s_reserved_word_pad;
|
||||
__le32 s_default_mount_opts;
|
||||
__le32 s_first_meta_bg; /* First metablock block group */
|
||||
__le32 s_first_meta_bg; /* First metablock block group */
|
||||
__u32 s_reserved[190]; /* Padding to the end of the block */
|
||||
};
|
||||
|
||||
|
|
@ -816,6 +829,7 @@ extern void ext3_set_aops(struct inode *inode);
|
|||
/* ioctl.c */
|
||||
extern int ext3_ioctl (struct inode *, struct file *, unsigned int,
|
||||
unsigned long);
|
||||
extern long ext3_compat_ioctl (struct file *, unsigned int, unsigned long);
|
||||
|
||||
/* namei.c */
|
||||
extern int ext3_orphan_add(handle_t *, struct inode *);
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ struct ext3_reserve_window {
|
|||
};
|
||||
|
||||
struct ext3_reserve_window_node {
|
||||
struct rb_node rsv_node;
|
||||
struct rb_node rsv_node;
|
||||
__u32 rsv_goal_size;
|
||||
__u32 rsv_alloc_hit;
|
||||
struct ext3_reserve_window rsv_window;
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
/* Define the number of blocks we need to account to a transaction to
|
||||
* modify one block of data.
|
||||
*
|
||||
*
|
||||
* We may have to touch one inode, one bitmap buffer, up to three
|
||||
* indirection blocks, the group and superblock summaries, and the data
|
||||
* block to complete the transaction. */
|
||||
|
|
@ -88,16 +88,16 @@
|
|||
#endif
|
||||
|
||||
int
|
||||
ext3_mark_iloc_dirty(handle_t *handle,
|
||||
ext3_mark_iloc_dirty(handle_t *handle,
|
||||
struct inode *inode,
|
||||
struct ext3_iloc *iloc);
|
||||
|
||||
/*
|
||||
/*
|
||||
* On success, We end up with an outstanding reference count against
|
||||
* iloc->bh. This _must_ be cleaned up later.
|
||||
* iloc->bh. This _must_ be cleaned up later.
|
||||
*/
|
||||
|
||||
int ext3_reserve_inode_write(handle_t *handle, struct inode *inode,
|
||||
int ext3_reserve_inode_write(handle_t *handle, struct inode *inode,
|
||||
struct ext3_iloc *iloc);
|
||||
|
||||
int ext3_mark_inode_dirty(handle_t *handle, struct inode *inode);
|
||||
|
|
|
|||
65
include/linux/fib_rules.h
Normal file
65
include/linux/fib_rules.h
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
#ifndef __LINUX_FIB_RULES_H
|
||||
#define __LINUX_FIB_RULES_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/rtnetlink.h>
|
||||
|
||||
/* rule is permanent, and cannot be deleted */
|
||||
#define FIB_RULE_PERMANENT 1
|
||||
|
||||
struct fib_rule_hdr
|
||||
{
|
||||
__u8 family;
|
||||
__u8 dst_len;
|
||||
__u8 src_len;
|
||||
__u8 tos;
|
||||
|
||||
__u8 table;
|
||||
__u8 res1; /* reserved */
|
||||
__u8 res2; /* reserved */
|
||||
__u8 action;
|
||||
|
||||
__u32 flags;
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
FRA_UNSPEC,
|
||||
FRA_DST, /* destination address */
|
||||
FRA_SRC, /* source address */
|
||||
FRA_IFNAME, /* interface name */
|
||||
FRA_UNUSED1,
|
||||
FRA_UNUSED2,
|
||||
FRA_PRIORITY, /* priority/preference */
|
||||
FRA_UNUSED3,
|
||||
FRA_UNUSED4,
|
||||
FRA_UNUSED5,
|
||||
FRA_FWMARK, /* netfilter mark */
|
||||
FRA_FLOW, /* flow/class id */
|
||||
FRA_UNUSED6,
|
||||
FRA_UNUSED7,
|
||||
FRA_UNUSED8,
|
||||
FRA_TABLE, /* Extended table id */
|
||||
FRA_FWMASK, /* mask for netfilter mark */
|
||||
__FRA_MAX
|
||||
};
|
||||
|
||||
#define FRA_MAX (__FRA_MAX - 1)
|
||||
|
||||
enum
|
||||
{
|
||||
FR_ACT_UNSPEC,
|
||||
FR_ACT_TO_TBL, /* Pass to fixed table */
|
||||
FR_ACT_RES1,
|
||||
FR_ACT_RES2,
|
||||
FR_ACT_RES3,
|
||||
FR_ACT_RES4,
|
||||
FR_ACT_BLACKHOLE, /* Drop without notification */
|
||||
FR_ACT_UNREACHABLE, /* Drop with ENETUNREACH */
|
||||
FR_ACT_PROHIBIT, /* Drop with EACCES */
|
||||
__FR_ACT_MAX,
|
||||
};
|
||||
|
||||
#define FR_ACT_MAX (__FR_ACT_MAX - 1)
|
||||
|
||||
#endif
|
||||
|
|
@ -112,5 +112,6 @@ struct task_struct;
|
|||
|
||||
struct files_struct *get_files_struct(struct task_struct *);
|
||||
void FASTCALL(put_files_struct(struct files_struct *fs));
|
||||
void reset_files_struct(struct task_struct *, struct files_struct *);
|
||||
|
||||
#endif /* __LINUX_FILE_H */
|
||||
|
|
|
|||
|
|
@ -25,10 +25,10 @@
|
|||
|
||||
struct sock_filter /* Filter block */
|
||||
{
|
||||
__u16 code; /* Actual filter code */
|
||||
__u8 jt; /* Jump true */
|
||||
__u8 jf; /* Jump false */
|
||||
__u32 k; /* Generic multiuse field */
|
||||
__u16 code; /* Actual filter code */
|
||||
__u8 jt; /* Jump true */
|
||||
__u8 jf; /* Jump false */
|
||||
__u32 k; /* Generic multiuse field */
|
||||
};
|
||||
|
||||
struct sock_fprog /* Required for SO_ATTACH_FILTER. */
|
||||
|
|
@ -41,8 +41,9 @@ struct sock_fprog /* Required for SO_ATTACH_FILTER. */
|
|||
struct sk_filter
|
||||
{
|
||||
atomic_t refcnt;
|
||||
unsigned int len; /* Number of filter blocks */
|
||||
struct sock_filter insns[0];
|
||||
unsigned int len; /* Number of filter blocks */
|
||||
struct rcu_head rcu;
|
||||
struct sock_filter insns[0];
|
||||
};
|
||||
|
||||
static inline unsigned int sk_filter_len(struct sk_filter *fp)
|
||||
|
|
|
|||
|
|
@ -79,8 +79,8 @@ extern int dir_notify_enable;
|
|||
#define WRITE 1
|
||||
#define READA 2 /* read-ahead - don't block if no resources */
|
||||
#define SWRITE 3 /* for ll_rw_block() - wait for buffer lock */
|
||||
#define SPECIAL 4 /* For non-blockdevice requests in request queue */
|
||||
#define READ_SYNC (READ | (1 << BIO_RW_SYNC))
|
||||
#define READ_META (READ | (1 << BIO_RW_META))
|
||||
#define WRITE_SYNC (WRITE | (1 << BIO_RW_SYNC))
|
||||
#define WRITE_BARRIER ((1 << BIO_RW) | (1 << BIO_RW_BARRIER))
|
||||
|
||||
|
|
@ -92,9 +92,10 @@ extern int dir_notify_enable;
|
|||
#define FS_REQUIRES_DEV 1
|
||||
#define FS_BINARY_MOUNTDATA 2
|
||||
#define FS_REVAL_DOT 16384 /* Check the paths ".", ".." for staleness */
|
||||
#define FS_ODD_RENAME 32768 /* Temporary stuff; will go away as soon
|
||||
* as nfs_rename() will be cleaned up
|
||||
*/
|
||||
#define FS_RENAME_DOES_D_MOVE 32768 /* FS will handle d_move()
|
||||
* during rename() internally.
|
||||
*/
|
||||
|
||||
/*
|
||||
* These are the fs-independent mount-flags: up to 32 flags are supported
|
||||
*/
|
||||
|
|
@ -216,6 +217,45 @@ extern int dir_notify_enable;
|
|||
#define FIBMAP _IO(0x00,1) /* bmap access */
|
||||
#define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */
|
||||
|
||||
#define FS_IOC_GETFLAGS _IOR('f', 1, long)
|
||||
#define FS_IOC_SETFLAGS _IOW('f', 2, long)
|
||||
#define FS_IOC_GETVERSION _IOR('v', 1, long)
|
||||
#define FS_IOC_SETVERSION _IOW('v', 2, long)
|
||||
#define FS_IOC32_GETFLAGS _IOR('f', 1, int)
|
||||
#define FS_IOC32_SETFLAGS _IOW('f', 2, int)
|
||||
#define FS_IOC32_GETVERSION _IOR('v', 1, int)
|
||||
#define FS_IOC32_SETVERSION _IOW('v', 2, int)
|
||||
|
||||
/*
|
||||
* Inode flags (FS_IOC_GETFLAGS / FS_IOC_SETFLAGS)
|
||||
*/
|
||||
#define FS_SECRM_FL 0x00000001 /* Secure deletion */
|
||||
#define FS_UNRM_FL 0x00000002 /* Undelete */
|
||||
#define FS_COMPR_FL 0x00000004 /* Compress file */
|
||||
#define FS_SYNC_FL 0x00000008 /* Synchronous updates */
|
||||
#define FS_IMMUTABLE_FL 0x00000010 /* Immutable file */
|
||||
#define FS_APPEND_FL 0x00000020 /* writes to file may only append */
|
||||
#define FS_NODUMP_FL 0x00000040 /* do not dump file */
|
||||
#define FS_NOATIME_FL 0x00000080 /* do not update atime */
|
||||
/* Reserved for compression usage... */
|
||||
#define FS_DIRTY_FL 0x00000100
|
||||
#define FS_COMPRBLK_FL 0x00000200 /* One or more compressed clusters */
|
||||
#define FS_NOCOMP_FL 0x00000400 /* Don't compress */
|
||||
#define FS_ECOMPR_FL 0x00000800 /* Compression error */
|
||||
/* End compression flags --- maybe not all used */
|
||||
#define FS_BTREE_FL 0x00001000 /* btree format dir */
|
||||
#define FS_INDEX_FL 0x00001000 /* hash-indexed directory */
|
||||
#define FS_IMAGIC_FL 0x00002000 /* AFS directory */
|
||||
#define FS_JOURNAL_DATA_FL 0x00004000 /* Reserved for ext3 */
|
||||
#define FS_NOTAIL_FL 0x00008000 /* file tail should not be merged */
|
||||
#define FS_DIRSYNC_FL 0x00010000 /* dirsync behaviour (directories only) */
|
||||
#define FS_TOPDIR_FL 0x00020000 /* Top of directory hierarchies*/
|
||||
#define FS_RESERVED_FL 0x80000000 /* reserved for ext2 lib */
|
||||
|
||||
#define FS_FL_USER_VISIBLE 0x0003DFFF /* User visible flags */
|
||||
#define FS_FL_USER_MODIFIABLE 0x000380FF /* User modifiable flags */
|
||||
|
||||
|
||||
#define SYNC_FILE_RANGE_WAIT_BEFORE 1
|
||||
#define SYNC_FILE_RANGE_WRITE 2
|
||||
#define SYNC_FILE_RANGE_WAIT_AFTER 4
|
||||
|
|
@ -511,7 +551,6 @@ struct inode {
|
|||
struct timespec i_mtime;
|
||||
struct timespec i_ctime;
|
||||
unsigned int i_blkbits;
|
||||
unsigned long i_blksize;
|
||||
unsigned long i_version;
|
||||
blkcnt_t i_blocks;
|
||||
unsigned short i_bytes;
|
||||
|
|
@ -527,11 +566,12 @@ struct inode {
|
|||
#ifdef CONFIG_QUOTA
|
||||
struct dquot *i_dquot[MAXQUOTAS];
|
||||
#endif
|
||||
/* These three should probably be a union */
|
||||
struct list_head i_devices;
|
||||
struct pipe_inode_info *i_pipe;
|
||||
struct block_device *i_bdev;
|
||||
struct cdev *i_cdev;
|
||||
union {
|
||||
struct pipe_inode_info *i_pipe;
|
||||
struct block_device *i_bdev;
|
||||
struct cdev *i_cdev;
|
||||
};
|
||||
int i_cindex;
|
||||
|
||||
__u32 i_generation;
|
||||
|
|
@ -552,10 +592,10 @@ struct inode {
|
|||
unsigned int i_flags;
|
||||
|
||||
atomic_t i_writecount;
|
||||
#ifdef CONFIG_SECURITY
|
||||
void *i_security;
|
||||
union {
|
||||
void *generic_ip;
|
||||
} u;
|
||||
#endif
|
||||
void *i_private; /* fs or device private pointer */
|
||||
#ifdef __NEED_I_SIZE_ORDERED
|
||||
seqcount_t i_size_seqcount;
|
||||
#endif
|
||||
|
|
@ -646,7 +686,6 @@ struct fown_struct {
|
|||
rwlock_t lock; /* protects pid, uid, euid fields */
|
||||
int pid; /* pid or -pgrp where SIGIO should be sent */
|
||||
uid_t uid, euid; /* uid/euid of process setting the owner */
|
||||
void *security;
|
||||
int signum; /* posix.1b rt signal to be delivered on IO */
|
||||
};
|
||||
|
||||
|
|
@ -689,8 +728,9 @@ struct file {
|
|||
struct file_ra_state f_ra;
|
||||
|
||||
unsigned long f_version;
|
||||
#ifdef CONFIG_SECURITY
|
||||
void *f_security;
|
||||
|
||||
#endif
|
||||
/* needed for tty driver, and maybe others */
|
||||
void *private_data;
|
||||
|
||||
|
|
@ -878,7 +918,9 @@ struct super_block {
|
|||
int s_syncing;
|
||||
int s_need_sync_fs;
|
||||
atomic_t s_active;
|
||||
#ifdef CONFIG_SECURITY
|
||||
void *s_security;
|
||||
#endif
|
||||
struct xattr_handler **s_xattr;
|
||||
|
||||
struct list_head s_inodes; /* all inodes */
|
||||
|
|
@ -1055,9 +1097,9 @@ struct file_operations {
|
|||
struct module *owner;
|
||||
loff_t (*llseek) (struct file *, loff_t, int);
|
||||
ssize_t (*read) (struct file *, char __user *, size_t, loff_t *);
|
||||
ssize_t (*aio_read) (struct kiocb *, char __user *, size_t, loff_t);
|
||||
ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *);
|
||||
ssize_t (*aio_write) (struct kiocb *, const char __user *, size_t, loff_t);
|
||||
ssize_t (*aio_read) (struct kiocb *, const struct iovec *, unsigned long, loff_t);
|
||||
ssize_t (*aio_write) (struct kiocb *, const struct iovec *, unsigned long, loff_t);
|
||||
int (*readdir) (struct file *, void *, filldir_t);
|
||||
unsigned int (*poll) (struct file *, struct poll_table_struct *);
|
||||
int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned long);
|
||||
|
|
@ -1071,8 +1113,6 @@ struct file_operations {
|
|||
int (*aio_fsync) (struct kiocb *, int datasync);
|
||||
int (*fasync) (int, struct file *, int);
|
||||
int (*lock) (struct file *, int, struct file_lock *);
|
||||
ssize_t (*readv) (struct file *, const struct iovec *, unsigned long, loff_t *);
|
||||
ssize_t (*writev) (struct file *, const struct iovec *, unsigned long, loff_t *);
|
||||
ssize_t (*sendfile) (struct file *, loff_t *, size_t, read_actor_t, void *);
|
||||
ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int);
|
||||
unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
|
||||
|
|
@ -1110,6 +1150,11 @@ struct inode_operations {
|
|||
|
||||
struct seq_file;
|
||||
|
||||
ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector,
|
||||
unsigned long nr_segs, unsigned long fast_segs,
|
||||
struct iovec *fast_pointer,
|
||||
struct iovec **ret_pointer);
|
||||
|
||||
extern ssize_t vfs_read(struct file *, char __user *, size_t, loff_t *);
|
||||
extern ssize_t vfs_write(struct file *, const char __user *, size_t, loff_t *);
|
||||
extern ssize_t vfs_readv(struct file *, const struct iovec __user *,
|
||||
|
|
@ -1144,9 +1189,10 @@ struct super_operations {
|
|||
|
||||
int (*show_options)(struct seq_file *, struct vfsmount *);
|
||||
int (*show_stats)(struct seq_file *, struct vfsmount *);
|
||||
|
||||
#ifdef CONFIG_QUOTA
|
||||
ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t);
|
||||
ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t);
|
||||
#endif
|
||||
};
|
||||
|
||||
/* Inode state bits. Protected by inode_lock. */
|
||||
|
|
@ -1173,15 +1219,30 @@ static inline void mark_inode_dirty_sync(struct inode *inode)
|
|||
__mark_inode_dirty(inode, I_DIRTY_SYNC);
|
||||
}
|
||||
|
||||
static inline void inode_inc_link_count(struct inode *inode)
|
||||
static inline void inc_nlink(struct inode *inode)
|
||||
{
|
||||
inode->i_nlink++;
|
||||
}
|
||||
|
||||
static inline void inode_inc_link_count(struct inode *inode)
|
||||
{
|
||||
inc_nlink(inode);
|
||||
mark_inode_dirty(inode);
|
||||
}
|
||||
|
||||
static inline void drop_nlink(struct inode *inode)
|
||||
{
|
||||
inode->i_nlink--;
|
||||
}
|
||||
|
||||
static inline void clear_nlink(struct inode *inode)
|
||||
{
|
||||
inode->i_nlink = 0;
|
||||
}
|
||||
|
||||
static inline void inode_dec_link_count(struct inode *inode)
|
||||
{
|
||||
inode->i_nlink--;
|
||||
drop_nlink(inode);
|
||||
mark_inode_dirty(inode);
|
||||
}
|
||||
|
||||
|
|
@ -1439,6 +1500,7 @@ extern void __init vfs_caches_init(unsigned long);
|
|||
extern void putname(const char *name);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BLOCK
|
||||
extern int register_blkdev(unsigned int, const char *);
|
||||
extern int unregister_blkdev(unsigned int, const char *);
|
||||
extern struct block_device *bdget(dev_t);
|
||||
|
|
@ -1447,11 +1509,15 @@ extern void bd_forget(struct inode *inode);
|
|||
extern void bdput(struct block_device *);
|
||||
extern struct block_device *open_by_devnum(dev_t, unsigned);
|
||||
extern struct block_device *open_partition_by_devnum(dev_t, unsigned);
|
||||
extern const struct file_operations def_blk_fops;
|
||||
extern const struct address_space_operations def_blk_aops;
|
||||
#else
|
||||
static inline void bd_forget(struct inode *inode) {}
|
||||
#endif
|
||||
extern const struct file_operations def_blk_fops;
|
||||
extern const struct file_operations def_chr_fops;
|
||||
extern const struct file_operations bad_sock_fops;
|
||||
extern const struct file_operations def_fifo_fops;
|
||||
#ifdef CONFIG_BLOCK
|
||||
extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long);
|
||||
extern int blkdev_ioctl(struct inode *, struct file *, unsigned, unsigned long);
|
||||
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 *);
|
|||
#define bd_claim_by_disk(bdev, holder, disk) bd_claim(bdev, holder)
|
||||
#define bd_release_from_disk(bdev, disk) bd_release(bdev)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* fs/char_dev.c */
|
||||
#define CHRDEV_MAJOR_HASH_SIZE 255
|
||||
|
|
@ -1480,14 +1547,19 @@ extern int chrdev_open(struct inode *, struct file *);
|
|||
extern void chrdev_show(struct seq_file *,off_t);
|
||||
|
||||
/* fs/block_dev.c */
|
||||
#define BLKDEV_MAJOR_HASH_SIZE 255
|
||||
#define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */
|
||||
|
||||
#ifdef CONFIG_BLOCK
|
||||
#define BLKDEV_MAJOR_HASH_SIZE 255
|
||||
extern const char *__bdevname(dev_t, char *buffer);
|
||||
extern const char *bdevname(struct block_device *bdev, char *buffer);
|
||||
extern struct block_device *lookup_bdev(const char *);
|
||||
extern struct block_device *open_bdev_excl(const char *, int, void *);
|
||||
extern void close_bdev_excl(struct block_device *);
|
||||
extern void blkdev_show(struct seq_file *,off_t);
|
||||
#else
|
||||
#define BLKDEV_MAJOR_HASH_SIZE 0
|
||||
#endif
|
||||
|
||||
extern void init_special_inode(struct inode *, umode_t, dev_t);
|
||||
|
||||
|
|
@ -1501,6 +1573,7 @@ extern const struct file_operations rdwr_fifo_fops;
|
|||
|
||||
extern int fs_may_remount_ro(struct super_block *);
|
||||
|
||||
#ifdef CONFIG_BLOCK
|
||||
/*
|
||||
* return READ, READA, or WRITE
|
||||
*/
|
||||
|
|
@ -1512,9 +1585,10 @@ extern int fs_may_remount_ro(struct super_block *);
|
|||
#define bio_data_dir(bio) ((bio)->bi_rw & 1)
|
||||
|
||||
extern int check_disk_change(struct block_device *);
|
||||
extern int invalidate_inodes(struct super_block *);
|
||||
extern int __invalidate_device(struct block_device *);
|
||||
extern int invalidate_partition(struct gendisk *, int);
|
||||
#endif
|
||||
extern int invalidate_inodes(struct super_block *);
|
||||
unsigned long invalidate_mapping_pages(struct address_space *mapping,
|
||||
pgoff_t start, pgoff_t end);
|
||||
unsigned long invalidate_inode_pages(struct address_space *mapping);
|
||||
|
|
@ -1542,11 +1616,14 @@ extern int __filemap_fdatawrite_range(struct address_space *mapping,
|
|||
extern long do_fsync(struct file *file, int datasync);
|
||||
extern void sync_supers(void);
|
||||
extern void sync_filesystems(int wait);
|
||||
extern void __fsync_super(struct super_block *sb);
|
||||
extern void emergency_sync(void);
|
||||
extern void emergency_remount(void);
|
||||
extern int do_remount_sb(struct super_block *sb, int flags,
|
||||
void *data, int force);
|
||||
#ifdef CONFIG_BLOCK
|
||||
extern sector_t bmap(struct inode *, sector_t);
|
||||
#endif
|
||||
extern int notify_change(struct dentry *, struct iattr *);
|
||||
extern int permission(struct inode *, int, struct nameidata *);
|
||||
extern int generic_permission(struct inode *, int,
|
||||
|
|
@ -1564,6 +1641,9 @@ static inline void allow_write_access(struct file *file)
|
|||
atomic_inc(&file->f_dentry->d_inode->i_writecount);
|
||||
}
|
||||
extern int do_pipe(int *);
|
||||
extern struct file *create_read_pipe(struct file *f);
|
||||
extern struct file *create_write_pipe(void);
|
||||
extern void free_write_pipe(struct file *);
|
||||
|
||||
extern int open_namei(int dfd, const char *, int, int, struct nameidata *);
|
||||
extern int may_open(struct nameidata *, int, int);
|
||||
|
|
@ -1629,9 +1709,11 @@ static inline void insert_inode_hash(struct inode *inode) {
|
|||
extern struct file * get_empty_filp(void);
|
||||
extern void file_move(struct file *f, struct list_head *list);
|
||||
extern void file_kill(struct file *f);
|
||||
#ifdef CONFIG_BLOCK
|
||||
struct bio;
|
||||
extern void submit_bio(int, struct bio *);
|
||||
extern int bdev_read_only(struct block_device *);
|
||||
#endif
|
||||
extern int set_blocksize(struct block_device *, int);
|
||||
extern int sb_set_blocksize(struct super_block *, int);
|
||||
extern int sb_min_blocksize(struct super_block *, int);
|
||||
|
|
@ -1640,22 +1722,17 @@ extern int generic_file_mmap(struct file *, struct vm_area_struct *);
|
|||
extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *);
|
||||
extern int file_read_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size);
|
||||
extern int file_send_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size);
|
||||
extern ssize_t generic_file_read(struct file *, char __user *, size_t, loff_t *);
|
||||
int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk);
|
||||
extern ssize_t generic_file_write(struct file *, const char __user *, size_t, loff_t *);
|
||||
extern ssize_t generic_file_aio_read(struct kiocb *, char __user *, size_t, loff_t);
|
||||
extern ssize_t __generic_file_aio_read(struct kiocb *, const struct iovec *, unsigned long, loff_t *);
|
||||
extern ssize_t generic_file_aio_write(struct kiocb *, const char __user *, size_t, loff_t);
|
||||
extern ssize_t generic_file_aio_read(struct kiocb *, const struct iovec *, unsigned long, loff_t);
|
||||
extern ssize_t generic_file_aio_write(struct kiocb *, const struct iovec *, unsigned long, loff_t);
|
||||
extern ssize_t generic_file_aio_write_nolock(struct kiocb *, const struct iovec *,
|
||||
unsigned long, loff_t *);
|
||||
unsigned long, loff_t);
|
||||
extern ssize_t generic_file_direct_write(struct kiocb *, const struct iovec *,
|
||||
unsigned long *, loff_t, loff_t *, size_t, size_t);
|
||||
extern ssize_t generic_file_buffered_write(struct kiocb *, const struct iovec *,
|
||||
unsigned long, loff_t, loff_t *, size_t, ssize_t);
|
||||
extern ssize_t do_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos);
|
||||
extern ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos);
|
||||
ssize_t generic_file_write_nolock(struct file *file, const struct iovec *iov,
|
||||
unsigned long nr_segs, loff_t *ppos);
|
||||
extern ssize_t generic_file_sendfile(struct file *, loff_t *, size_t, read_actor_t, void *);
|
||||
extern void do_generic_mapping_read(struct address_space *mapping,
|
||||
struct file_ra_state *, struct file *,
|
||||
|
|
@ -1673,10 +1750,6 @@ extern long do_splice_direct(struct file *in, loff_t *ppos, struct file *out,
|
|||
|
||||
extern void
|
||||
file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping);
|
||||
extern ssize_t generic_file_readv(struct file *filp, const struct iovec *iov,
|
||||
unsigned long nr_segs, loff_t *ppos);
|
||||
ssize_t generic_file_writev(struct file *filp, const struct iovec *iov,
|
||||
unsigned long nr_segs, loff_t *ppos);
|
||||
extern loff_t no_llseek(struct file *file, loff_t offset, int origin);
|
||||
extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin);
|
||||
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,
|
|||
actor);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BLOCK
|
||||
ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
|
||||
struct block_device *bdev, const struct iovec *iov, loff_t offset,
|
||||
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,
|
|||
return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset,
|
||||
nr_segs, get_block, end_io, DIO_OWN_LOCKING);
|
||||
}
|
||||
#endif
|
||||
|
||||
extern const struct file_operations generic_ro_fops;
|
||||
|
||||
|
|
|
|||
36
include/linux/generic_acl.h
Normal file
36
include/linux/generic_acl.h
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* fs/generic_acl.c
|
||||
*
|
||||
* (C) 2005 Andreas Gruenbacher <agruen@suse.de>
|
||||
*
|
||||
* This file is released under the GPL.
|
||||
*/
|
||||
|
||||
#ifndef GENERIC_ACL_H
|
||||
#define GENERIC_ACL_H
|
||||
|
||||
#include <linux/posix_acl.h>
|
||||
#include <linux/posix_acl_xattr.h>
|
||||
|
||||
/**
|
||||
* struct generic_acl_operations - filesystem operations
|
||||
*
|
||||
* Filesystems must make these operations available to the generic
|
||||
* operations.
|
||||
*/
|
||||
struct generic_acl_operations {
|
||||
struct posix_acl *(*getacl)(struct inode *, int);
|
||||
void (*setacl)(struct inode *, int, struct posix_acl *);
|
||||
};
|
||||
|
||||
size_t generic_acl_list(struct inode *, struct generic_acl_operations *, int,
|
||||
char *, size_t);
|
||||
int generic_acl_get(struct inode *, struct generic_acl_operations *, int,
|
||||
void *, size_t);
|
||||
int generic_acl_set(struct inode *, struct generic_acl_operations *, int,
|
||||
const void *, size_t);
|
||||
int generic_acl_init(struct inode *, struct inode *,
|
||||
struct generic_acl_operations *);
|
||||
int generic_acl_chmod(struct inode *, struct generic_acl_operations *);
|
||||
|
||||
#endif
|
||||
|
|
@ -16,6 +16,8 @@ struct genlmsghdr {
|
|||
|
||||
#define GENL_HDRLEN NLMSG_ALIGN(sizeof(struct genlmsghdr))
|
||||
|
||||
#define GENL_ADMIN_PERM 0x01
|
||||
|
||||
/*
|
||||
* List of reserved static generic netlink identifiers:
|
||||
*/
|
||||
|
|
@ -43,9 +45,25 @@ enum {
|
|||
CTRL_ATTR_UNSPEC,
|
||||
CTRL_ATTR_FAMILY_ID,
|
||||
CTRL_ATTR_FAMILY_NAME,
|
||||
CTRL_ATTR_VERSION,
|
||||
CTRL_ATTR_HDRSIZE,
|
||||
CTRL_ATTR_MAXATTR,
|
||||
CTRL_ATTR_OPS,
|
||||
__CTRL_ATTR_MAX,
|
||||
};
|
||||
|
||||
#define CTRL_ATTR_MAX (__CTRL_ATTR_MAX - 1)
|
||||
|
||||
enum {
|
||||
CTRL_ATTR_OP_UNSPEC,
|
||||
CTRL_ATTR_OP_ID,
|
||||
CTRL_ATTR_OP_FLAGS,
|
||||
CTRL_ATTR_OP_POLICY,
|
||||
CTRL_ATTR_OP_DOIT,
|
||||
CTRL_ATTR_OP_DUMPIT,
|
||||
__CTRL_ATTR_OP_MAX,
|
||||
};
|
||||
|
||||
#define CTRL_ATTR_OP_MAX (__CTRL_ATTR_OP_MAX - 1)
|
||||
|
||||
#endif /* __LINUX_GENERIC_NETLINK_H */
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@
|
|||
|
||||
#include <linux/types.h>
|
||||
|
||||
#ifdef CONFIG_BLOCK
|
||||
|
||||
enum {
|
||||
/* These three have identical behaviour; use the second one if DOS FDISK gets
|
||||
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)
|
|||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
18
include/linux/getcpu.h
Normal file
18
include/linux/getcpu.h
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#ifndef _LINUX_GETCPU_H
|
||||
#define _LINUX_GETCPU_H 1
|
||||
|
||||
/* Cache for getcpu() to speed it up. Results might be a short time
|
||||
out of date, but will be faster.
|
||||
|
||||
User programs should not refer to the contents of this structure.
|
||||
I repeat they should not refer to it. If they do they will break
|
||||
in future kernels.
|
||||
|
||||
It is only a private cache for vgetcpu(). It will change in future kernels.
|
||||
The user program must store this information per thread (__thread)
|
||||
If you want 100% accurate information pass NULL instead. */
|
||||
struct getcpu_cache {
|
||||
unsigned long blob[128 / sizeof(long)];
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -9,17 +9,16 @@ struct vm_area_struct;
|
|||
|
||||
/*
|
||||
* GFP bitmasks..
|
||||
*
|
||||
* Zone modifiers (see linux/mmzone.h - low three bits)
|
||||
*
|
||||
* Do not put any conditional on these. If necessary modify the definitions
|
||||
* without the underscores and use the consistently. The definitions here may
|
||||
* be used in bit comparisons.
|
||||
*/
|
||||
/* Zone modifiers in GFP_ZONEMASK (see linux/mmzone.h - low three bits) */
|
||||
#define __GFP_DMA ((__force gfp_t)0x01u)
|
||||
#define __GFP_HIGHMEM ((__force gfp_t)0x02u)
|
||||
#ifdef CONFIG_DMA_IS_DMA32
|
||||
#define __GFP_DMA32 ((__force gfp_t)0x01) /* ZONE_DMA is ZONE_DMA32 */
|
||||
#elif BITS_PER_LONG < 64
|
||||
#define __GFP_DMA32 ((__force gfp_t)0x00) /* ZONE_NORMAL is ZONE_DMA32 */
|
||||
#else
|
||||
#define __GFP_DMA32 ((__force gfp_t)0x04) /* Has own ZONE_DMA32 */
|
||||
#endif
|
||||
#define __GFP_DMA32 ((__force gfp_t)0x04u)
|
||||
|
||||
/*
|
||||
* Action modifiers - doesn't change the zoning
|
||||
|
|
@ -46,6 +45,7 @@ struct vm_area_struct;
|
|||
#define __GFP_ZERO ((__force gfp_t)0x8000u)/* Return zeroed page on success */
|
||||
#define __GFP_NOMEMALLOC ((__force gfp_t)0x10000u) /* Don't use emergency reserves */
|
||||
#define __GFP_HARDWALL ((__force gfp_t)0x20000u) /* Enforce hardwall cpuset memory allocs */
|
||||
#define __GFP_THISNODE ((__force gfp_t)0x40000u)/* No fallback, no policies */
|
||||
|
||||
#define __GFP_BITS_SHIFT 20 /* Room for 20 __GFP_FOO bits */
|
||||
#define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1))
|
||||
|
|
@ -54,7 +54,7 @@ struct vm_area_struct;
|
|||
#define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| \
|
||||
__GFP_COLD|__GFP_NOWARN|__GFP_REPEAT| \
|
||||
__GFP_NOFAIL|__GFP_NORETRY|__GFP_NO_GROW|__GFP_COMP| \
|
||||
__GFP_NOMEMALLOC|__GFP_HARDWALL)
|
||||
__GFP_NOMEMALLOC|__GFP_HARDWALL|__GFP_THISNODE)
|
||||
|
||||
/* This equals 0, but use constants in case they ever change */
|
||||
#define GFP_NOWAIT (GFP_ATOMIC & ~__GFP_HIGH)
|
||||
|
|
@ -67,6 +67,13 @@ struct vm_area_struct;
|
|||
#define GFP_HIGHUSER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL | \
|
||||
__GFP_HIGHMEM)
|
||||
|
||||
#ifdef CONFIG_NUMA
|
||||
#define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY)
|
||||
#else
|
||||
#define GFP_THISNODE 0
|
||||
#endif
|
||||
|
||||
|
||||
/* Flag - indicates that the buffer will be suitable for DMA. Ignored on some
|
||||
platforms, used as appropriate on others */
|
||||
|
||||
|
|
@ -76,11 +83,19 @@ struct vm_area_struct;
|
|||
#define GFP_DMA32 __GFP_DMA32
|
||||
|
||||
|
||||
static inline int gfp_zone(gfp_t gfp)
|
||||
static inline enum zone_type gfp_zone(gfp_t flags)
|
||||
{
|
||||
int zone = GFP_ZONEMASK & (__force int) gfp;
|
||||
BUG_ON(zone >= GFP_ZONETYPES);
|
||||
return zone;
|
||||
if (flags & __GFP_DMA)
|
||||
return ZONE_DMA;
|
||||
#ifdef CONFIG_ZONE_DMA32
|
||||
if (flags & __GFP_DMA32)
|
||||
return ZONE_DMA32;
|
||||
#endif
|
||||
#ifdef CONFIG_HIGHMEM
|
||||
if (flags & __GFP_HIGHMEM)
|
||||
return ZONE_HIGHMEM;
|
||||
#endif
|
||||
return ZONE_NORMAL;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -11,95 +11,46 @@
|
|||
#ifndef __HDLC_H
|
||||
#define __HDLC_H
|
||||
|
||||
#define GENERIC_HDLC_VERSION 4 /* For synchronization with sethdlc utility */
|
||||
|
||||
#define CLOCK_DEFAULT 0 /* Default setting */
|
||||
#define CLOCK_EXT 1 /* External TX and RX clock - DTE */
|
||||
#define CLOCK_INT 2 /* Internal TX and RX clock - DCE */
|
||||
#define CLOCK_TXINT 3 /* Internal TX and external RX clock */
|
||||
#define CLOCK_TXFROMRX 4 /* TX clock derived from external RX clock */
|
||||
|
||||
|
||||
#define ENCODING_DEFAULT 0 /* Default setting */
|
||||
#define ENCODING_NRZ 1
|
||||
#define ENCODING_NRZI 2
|
||||
#define ENCODING_FM_MARK 3
|
||||
#define ENCODING_FM_SPACE 4
|
||||
#define ENCODING_MANCHESTER 5
|
||||
|
||||
|
||||
#define PARITY_DEFAULT 0 /* Default setting */
|
||||
#define PARITY_NONE 1 /* No parity */
|
||||
#define PARITY_CRC16_PR0 2 /* CRC16, initial value 0x0000 */
|
||||
#define PARITY_CRC16_PR1 3 /* CRC16, initial value 0xFFFF */
|
||||
#define PARITY_CRC16_PR0_CCITT 4 /* CRC16, initial 0x0000, ITU-T version */
|
||||
#define PARITY_CRC16_PR1_CCITT 5 /* CRC16, initial 0xFFFF, ITU-T version */
|
||||
#define PARITY_CRC32_PR0_CCITT 6 /* CRC32, initial value 0x00000000 */
|
||||
#define PARITY_CRC32_PR1_CCITT 7 /* CRC32, initial value 0xFFFFFFFF */
|
||||
|
||||
#define LMI_DEFAULT 0 /* Default setting */
|
||||
#define LMI_NONE 1 /* No LMI, all PVCs are static */
|
||||
#define LMI_ANSI 2 /* ANSI Annex D */
|
||||
#define LMI_CCITT 3 /* ITU-T Annex A */
|
||||
#define LMI_CISCO 4 /* The "original" LMI, aka Gang of Four */
|
||||
|
||||
#define HDLC_MAX_MTU 1500 /* Ethernet 1500 bytes */
|
||||
#if 0
|
||||
#define HDLC_MAX_MRU (HDLC_MAX_MTU + 10 + 14 + 4) /* for ETH+VLAN over FR */
|
||||
#else
|
||||
#define HDLC_MAX_MRU 1600 /* as required for FR network */
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <linux/skbuff.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <net/syncppp.h>
|
||||
#include <linux/hdlc/ioctl.h>
|
||||
|
||||
|
||||
typedef struct { /* Used in Cisco and PPP mode */
|
||||
u8 address;
|
||||
u8 control;
|
||||
u16 protocol;
|
||||
}__attribute__ ((packed)) hdlc_header;
|
||||
|
||||
|
||||
|
||||
typedef struct {
|
||||
u32 type; /* code */
|
||||
u32 par1;
|
||||
u32 par2;
|
||||
u16 rel; /* reliability */
|
||||
u32 time;
|
||||
}__attribute__ ((packed)) cisco_packet;
|
||||
#define CISCO_PACKET_LEN 18
|
||||
#define CISCO_BIG_PACKET_LEN 20
|
||||
|
||||
|
||||
|
||||
typedef struct pvc_device_struct {
|
||||
struct net_device *master;
|
||||
struct net_device *main;
|
||||
struct net_device *ether; /* bridged Ethernet interface */
|
||||
struct pvc_device_struct *next; /* Sorted in ascending DLCI order */
|
||||
int dlci;
|
||||
int open_count;
|
||||
|
||||
struct {
|
||||
unsigned int new: 1;
|
||||
unsigned int active: 1;
|
||||
unsigned int exist: 1;
|
||||
unsigned int deleted: 1;
|
||||
unsigned int fecn: 1;
|
||||
unsigned int becn: 1;
|
||||
unsigned int bandwidth; /* Cisco LMI reporting only */
|
||||
}state;
|
||||
}pvc_device;
|
||||
|
||||
|
||||
|
||||
typedef struct hdlc_device_struct {
|
||||
/* To be initialized by hardware driver */
|
||||
/* Used by all network devices here, pointed to by netdev_priv(dev) */
|
||||
struct hdlc_device_desc {
|
||||
int (*netif_rx)(struct sk_buff *skb);
|
||||
struct net_device_stats stats;
|
||||
};
|
||||
|
||||
/* This structure is a private property of HDLC protocols.
|
||||
Hardware drivers have no interest here */
|
||||
|
||||
struct hdlc_proto {
|
||||
int (*open)(struct net_device *dev);
|
||||
void (*close)(struct net_device *dev);
|
||||
void (*start)(struct net_device *dev); /* if open & DCD */
|
||||
void (*stop)(struct net_device *dev); /* if open & !DCD */
|
||||
void (*detach)(struct net_device *dev);
|
||||
int (*ioctl)(struct net_device *dev, struct ifreq *ifr);
|
||||
unsigned short (*type_trans)(struct sk_buff *skb,
|
||||
struct net_device *dev);
|
||||
struct module *module;
|
||||
struct hdlc_proto *next; /* next protocol in the list */
|
||||
};
|
||||
|
||||
|
||||
typedef struct hdlc_device {
|
||||
/* used by HDLC layer to take control over HDLC device from hw driver*/
|
||||
int (*attach)(struct net_device *dev,
|
||||
unsigned short encoding, unsigned short parity);
|
||||
|
|
@ -107,82 +58,18 @@ typedef struct hdlc_device_struct {
|
|||
/* hardware driver must handle this instead of dev->hard_start_xmit */
|
||||
int (*xmit)(struct sk_buff *skb, struct net_device *dev);
|
||||
|
||||
|
||||
/* Things below are for HDLC layer internal use only */
|
||||
struct {
|
||||
int (*open)(struct net_device *dev);
|
||||
void (*close)(struct net_device *dev);
|
||||
|
||||
/* if open & DCD */
|
||||
void (*start)(struct net_device *dev);
|
||||
/* if open & !DCD */
|
||||
void (*stop)(struct net_device *dev);
|
||||
|
||||
void (*detach)(struct hdlc_device_struct *hdlc);
|
||||
int (*netif_rx)(struct sk_buff *skb);
|
||||
unsigned short (*type_trans)(struct sk_buff *skb,
|
||||
struct net_device *dev);
|
||||
int id; /* IF_PROTO_HDLC/CISCO/FR/etc. */
|
||||
}proto;
|
||||
|
||||
const struct hdlc_proto *proto;
|
||||
int carrier;
|
||||
int open;
|
||||
spinlock_t state_lock;
|
||||
|
||||
union {
|
||||
struct {
|
||||
fr_proto settings;
|
||||
pvc_device *first_pvc;
|
||||
int dce_pvc_count;
|
||||
|
||||
struct timer_list timer;
|
||||
unsigned long last_poll;
|
||||
int reliable;
|
||||
int dce_changed;
|
||||
int request;
|
||||
int fullrep_sent;
|
||||
u32 last_errors; /* last errors bit list */
|
||||
u8 n391cnt;
|
||||
u8 txseq; /* TX sequence number */
|
||||
u8 rxseq; /* RX sequence number */
|
||||
}fr;
|
||||
|
||||
struct {
|
||||
cisco_proto settings;
|
||||
|
||||
struct timer_list timer;
|
||||
unsigned long last_poll;
|
||||
int up;
|
||||
int request_sent;
|
||||
u32 txseq; /* TX sequence number */
|
||||
u32 rxseq; /* RX sequence number */
|
||||
}cisco;
|
||||
|
||||
struct {
|
||||
raw_hdlc_proto settings;
|
||||
}raw_hdlc;
|
||||
|
||||
struct {
|
||||
struct ppp_device pppdev;
|
||||
struct ppp_device *syncppp_ptr;
|
||||
int (*old_change_mtu)(struct net_device *dev,
|
||||
int new_mtu);
|
||||
}ppp;
|
||||
}state;
|
||||
void *state;
|
||||
void *priv;
|
||||
}hdlc_device;
|
||||
|
||||
|
||||
|
||||
int hdlc_raw_ioctl(struct net_device *dev, struct ifreq *ifr);
|
||||
int hdlc_raw_eth_ioctl(struct net_device *dev, struct ifreq *ifr);
|
||||
int hdlc_cisco_ioctl(struct net_device *dev, struct ifreq *ifr);
|
||||
int hdlc_ppp_ioctl(struct net_device *dev, struct ifreq *ifr);
|
||||
int hdlc_fr_ioctl(struct net_device *dev, struct ifreq *ifr);
|
||||
int hdlc_x25_ioctl(struct net_device *dev, struct ifreq *ifr);
|
||||
|
||||
|
||||
/* Exported from hdlc.o */
|
||||
/* Exported from hdlc module */
|
||||
|
||||
/* Called by hardware driver when a user requests HDLC service */
|
||||
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);
|
|||
#define register_hdlc_device(dev) register_netdev(dev)
|
||||
void unregister_hdlc_device(struct net_device *dev);
|
||||
|
||||
|
||||
void register_hdlc_protocol(struct hdlc_proto *proto);
|
||||
void unregister_hdlc_protocol(struct hdlc_proto *proto);
|
||||
|
||||
struct net_device *alloc_hdlcdev(void *priv);
|
||||
|
||||
static __inline__ hdlc_device* dev_to_hdlc(struct net_device *dev)
|
||||
|
||||
static __inline__ struct hdlc_device_desc* dev_to_desc(struct net_device *dev)
|
||||
{
|
||||
return netdev_priv(dev);
|
||||
}
|
||||
|
||||
|
||||
static __inline__ pvc_device* dev_to_pvc(struct net_device *dev)
|
||||
static __inline__ hdlc_device* dev_to_hdlc(struct net_device *dev)
|
||||
{
|
||||
return (pvc_device*)dev->priv;
|
||||
return netdev_priv(dev) + sizeof(struct hdlc_device_desc);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -225,18 +116,14 @@ int hdlc_open(struct net_device *dev);
|
|||
/* Must be called by hardware driver when HDLC device is being closed */
|
||||
void hdlc_close(struct net_device *dev);
|
||||
|
||||
int attach_hdlc_protocol(struct net_device *dev, struct hdlc_proto *proto,
|
||||
int (*rx)(struct sk_buff *skb), size_t size);
|
||||
/* May be used by hardware driver to gain control over HDLC device */
|
||||
static __inline__ void hdlc_proto_detach(hdlc_device *hdlc)
|
||||
{
|
||||
if (hdlc->proto.detach)
|
||||
hdlc->proto.detach(hdlc);
|
||||
hdlc->proto.detach = NULL;
|
||||
}
|
||||
|
||||
void detach_hdlc_protocol(struct net_device *dev);
|
||||
|
||||
static __inline__ struct net_device_stats *hdlc_stats(struct net_device *dev)
|
||||
{
|
||||
return &dev_to_hdlc(dev)->stats;
|
||||
return &dev_to_desc(dev)->stats;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -248,8 +135,8 @@ static __inline__ __be16 hdlc_type_trans(struct sk_buff *skb,
|
|||
skb->mac.raw = skb->data;
|
||||
skb->dev = dev;
|
||||
|
||||
if (hdlc->proto.type_trans)
|
||||
return hdlc->proto.type_trans(skb, dev);
|
||||
if (hdlc->proto->type_trans)
|
||||
return hdlc->proto->type_trans(skb, dev);
|
||||
else
|
||||
return htons(ETH_P_HDLC);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,39 @@
|
|||
#ifndef __HDLC_IOCTL_H__
|
||||
#define __HDLC_IOCTL_H__
|
||||
|
||||
|
||||
#define GENERIC_HDLC_VERSION 4 /* For synchronization with sethdlc utility */
|
||||
|
||||
#define CLOCK_DEFAULT 0 /* Default setting */
|
||||
#define CLOCK_EXT 1 /* External TX and RX clock - DTE */
|
||||
#define CLOCK_INT 2 /* Internal TX and RX clock - DCE */
|
||||
#define CLOCK_TXINT 3 /* Internal TX and external RX clock */
|
||||
#define CLOCK_TXFROMRX 4 /* TX clock derived from external RX clock */
|
||||
|
||||
|
||||
#define ENCODING_DEFAULT 0 /* Default setting */
|
||||
#define ENCODING_NRZ 1
|
||||
#define ENCODING_NRZI 2
|
||||
#define ENCODING_FM_MARK 3
|
||||
#define ENCODING_FM_SPACE 4
|
||||
#define ENCODING_MANCHESTER 5
|
||||
|
||||
|
||||
#define PARITY_DEFAULT 0 /* Default setting */
|
||||
#define PARITY_NONE 1 /* No parity */
|
||||
#define PARITY_CRC16_PR0 2 /* CRC16, initial value 0x0000 */
|
||||
#define PARITY_CRC16_PR1 3 /* CRC16, initial value 0xFFFF */
|
||||
#define PARITY_CRC16_PR0_CCITT 4 /* CRC16, initial 0x0000, ITU-T version */
|
||||
#define PARITY_CRC16_PR1_CCITT 5 /* CRC16, initial 0xFFFF, ITU-T version */
|
||||
#define PARITY_CRC32_PR0_CCITT 6 /* CRC32, initial value 0x00000000 */
|
||||
#define PARITY_CRC32_PR1_CCITT 7 /* CRC32, initial value 0xFFFFFFFF */
|
||||
|
||||
#define LMI_DEFAULT 0 /* Default setting */
|
||||
#define LMI_NONE 1 /* No LMI, all PVCs are static */
|
||||
#define LMI_ANSI 2 /* ANSI Annex D */
|
||||
#define LMI_CCITT 3 /* ITU-T Annex A */
|
||||
#define LMI_CISCO 4 /* The "original" LMI, aka Gang of Four */
|
||||
|
||||
typedef struct {
|
||||
unsigned int clock_rate; /* bits per second */
|
||||
unsigned int clock_type; /* internal, external, TX-internal etc. */
|
||||
|
|
|
|||
|
|
@ -24,11 +24,15 @@ static inline void flush_kernel_dcache_page(struct page *page)
|
|||
|
||||
/* declarations for linux/mm/highmem.c */
|
||||
unsigned int nr_free_highpages(void);
|
||||
extern unsigned long totalhigh_pages;
|
||||
|
||||
#else /* CONFIG_HIGHMEM */
|
||||
|
||||
static inline unsigned int nr_free_highpages(void) { return 0; }
|
||||
|
||||
#define totalhigh_pages 0
|
||||
|
||||
#ifndef ARCH_HAS_KMAP
|
||||
static inline void *kmap(struct page *page)
|
||||
{
|
||||
might_sleep();
|
||||
|
|
@ -41,6 +45,7 @@ static inline void *kmap(struct page *page)
|
|||
#define kunmap_atomic(addr, idx) do { } while (0)
|
||||
#define kmap_atomic_pfn(pfn, idx) page_address(pfn_to_page(pfn))
|
||||
#define kmap_atomic_to_page(ptr) virt_to_page(ptr)
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_HIGHMEM */
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +0,0 @@
|
|||
#ifndef _LINUX_HPFS_FS_H
|
||||
#define _LINUX_HPFS_FS_H
|
||||
|
||||
/* HPFS magic number (word 0 of block 16) */
|
||||
|
||||
#define HPFS_SUPER_MAGIC 0xf995e849
|
||||
|
||||
#endif
|
||||
|
|
@ -138,6 +138,7 @@ extern long hrtimer_nanosleep(struct timespec *rqtp,
|
|||
struct timespec __user *rmtp,
|
||||
const enum hrtimer_mode mode,
|
||||
const clockid_t clockid);
|
||||
extern long hrtimer_nanosleep_restart(struct restart_block *restart_block);
|
||||
|
||||
extern void hrtimer_init_sleeper(struct hrtimer_sleeper *sl,
|
||||
struct task_struct *tsk);
|
||||
|
|
|
|||
|
|
@ -40,7 +40,6 @@ struct i2c_algo_bit_data {
|
|||
/* local settings */
|
||||
int udelay; /* half-clock-cycle time in microsecs */
|
||||
/* i.e. clock is (500 / udelay) KHz */
|
||||
int mdelay; /* in millisecs, unused */
|
||||
int timeout; /* in jiffies */
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@ struct i2c_algo_pcf_data {
|
|||
|
||||
/* local settings */
|
||||
int udelay;
|
||||
int mdelay;
|
||||
int timeout;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,33 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2001,2002,2003 Broadcom Corporation
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef I2C_ALGO_SIBYTE_H
|
||||
#define I2C_ALGO_SIBYTE_H 1
|
||||
|
||||
#include <linux/i2c.h>
|
||||
|
||||
struct i2c_algo_sibyte_data {
|
||||
void *data; /* private data */
|
||||
int bus; /* which bus */
|
||||
void *reg_base; /* CSR base */
|
||||
};
|
||||
|
||||
int i2c_sibyte_add_bus(struct i2c_adapter *, int speed);
|
||||
int i2c_sibyte_del_bus(struct i2c_adapter *);
|
||||
|
||||
#endif /* I2C_ALGO_SIBYTE_H */
|
||||
|
|
@ -193,6 +193,7 @@
|
|||
#define I2C_HW_B_RADEON 0x01001e /* radeon framebuffer driver */
|
||||
#define I2C_HW_B_EM28XX 0x01001f /* em28xx video capture cards */
|
||||
#define I2C_HW_B_CX2341X 0x010020 /* Conexant CX2341X MPEG encoder cards */
|
||||
#define I2C_HW_B_INTELFB 0x010021 /* intel framebuffer driver */
|
||||
|
||||
/* --- PCF 8584 based algorithms */
|
||||
#define I2C_HW_P_LP 0x020000 /* Parallel port interface */
|
||||
|
|
|
|||
|
|
@ -64,14 +64,6 @@ extern int i2c_master_recv(struct i2c_client *,char* ,int);
|
|||
*/
|
||||
extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num);
|
||||
|
||||
/*
|
||||
* Some adapter types (i.e. PCF 8584 based ones) may support slave behaviuor.
|
||||
* This is not tested/implemented yet and will change in the future.
|
||||
*/
|
||||
extern int i2c_slave_send(struct i2c_client *,char*,int);
|
||||
extern int i2c_slave_recv(struct i2c_client *,char*,int);
|
||||
|
||||
|
||||
|
||||
/* This is the very generalized SMBus access routine. You probably do not
|
||||
want to use this, though; one of the functions below may be much easier,
|
||||
|
|
@ -201,10 +193,6 @@ struct i2c_algorithm {
|
|||
unsigned short flags, char read_write,
|
||||
u8 command, int size, union i2c_smbus_data * data);
|
||||
|
||||
/* --- these optional/future use for some adapter types.*/
|
||||
int (*slave_send)(struct i2c_adapter *,char*,int);
|
||||
int (*slave_recv)(struct i2c_adapter *,char*,int);
|
||||
|
||||
/* --- ioctl like call to set div. parameters. */
|
||||
int (*algo_control)(struct i2c_adapter *, unsigned int, unsigned long);
|
||||
|
||||
|
|
@ -220,7 +208,7 @@ struct i2c_adapter {
|
|||
struct module *owner;
|
||||
unsigned int id;
|
||||
unsigned int class;
|
||||
struct i2c_algorithm *algo;/* the algorithm to access the bus */
|
||||
const struct i2c_algorithm *algo; /* the algorithm to access the bus */
|
||||
void *algo_data;
|
||||
|
||||
/* --- administration stuff. */
|
||||
|
|
|
|||
|
|
@ -68,16 +68,16 @@
|
|||
struct icmphdr {
|
||||
__u8 type;
|
||||
__u8 code;
|
||||
__u16 checksum;
|
||||
__be16 checksum;
|
||||
union {
|
||||
struct {
|
||||
__u16 id;
|
||||
__u16 sequence;
|
||||
__be16 id;
|
||||
__be16 sequence;
|
||||
} echo;
|
||||
__u32 gateway;
|
||||
__be32 gateway;
|
||||
struct {
|
||||
__u16 __unused;
|
||||
__u16 mtu;
|
||||
__be16 __unused;
|
||||
__be16 mtu;
|
||||
} frag;
|
||||
} un;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -59,6 +59,8 @@
|
|||
#define IFF_SLAVE_INACTIVE 0x4 /* bonding slave not the curr. active */
|
||||
#define IFF_MASTER_8023AD 0x8 /* bonding master, 802.3ad. */
|
||||
#define IFF_MASTER_ALB 0x10 /* bonding master, balance-alb. */
|
||||
#define IFF_BONDING 0x20 /* bonding master or slave */
|
||||
#define IFF_SLAVE_NEEDARP 0x40 /* need ARPs for validation */
|
||||
|
||||
#define IF_GET_IFACE 0x0001 /* for querying only */
|
||||
#define IF_GET_PROTO 0x0002
|
||||
|
|
@ -212,5 +214,4 @@ struct ifconf
|
|||
#define ifc_buf ifc_ifcu.ifcu_buf /* buffer address */
|
||||
#define ifc_req ifc_ifcu.ifcu_req /* array of structures */
|
||||
|
||||
|
||||
#endif /* _LINUX_IF_H */
|
||||
|
|
|
|||
55
include/linux/if_addr.h
Normal file
55
include/linux/if_addr.h
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
#ifndef __LINUX_IF_ADDR_H
|
||||
#define __LINUX_IF_ADDR_H
|
||||
|
||||
#include <linux/netlink.h>
|
||||
|
||||
struct ifaddrmsg
|
||||
{
|
||||
__u8 ifa_family;
|
||||
__u8 ifa_prefixlen; /* The prefix length */
|
||||
__u8 ifa_flags; /* Flags */
|
||||
__u8 ifa_scope; /* Address scope */
|
||||
__u32 ifa_index; /* Link index */
|
||||
};
|
||||
|
||||
/*
|
||||
* Important comment:
|
||||
* IFA_ADDRESS is prefix address, rather than local interface address.
|
||||
* It makes no difference for normally configured broadcast interfaces,
|
||||
* but for point-to-point IFA_ADDRESS is DESTINATION address,
|
||||
* local address is supplied in IFA_LOCAL attribute.
|
||||
*/
|
||||
enum
|
||||
{
|
||||
IFA_UNSPEC,
|
||||
IFA_ADDRESS,
|
||||
IFA_LOCAL,
|
||||
IFA_LABEL,
|
||||
IFA_BROADCAST,
|
||||
IFA_ANYCAST,
|
||||
IFA_CACHEINFO,
|
||||
IFA_MULTICAST,
|
||||
__IFA_MAX,
|
||||
};
|
||||
|
||||
#define IFA_MAX (__IFA_MAX - 1)
|
||||
|
||||
/* ifa_flags */
|
||||
#define IFA_F_SECONDARY 0x01
|
||||
#define IFA_F_TEMPORARY IFA_F_SECONDARY
|
||||
|
||||
#define IFA_F_NODAD 0x02
|
||||
#define IFA_F_HOMEADDRESS 0x10
|
||||
#define IFA_F_DEPRECATED 0x20
|
||||
#define IFA_F_TENTATIVE 0x40
|
||||
#define IFA_F_PERMANENT 0x80
|
||||
|
||||
struct ifa_cacheinfo
|
||||
{
|
||||
__u32 ifa_prefered;
|
||||
__u32 ifa_valid;
|
||||
__u32 cstamp; /* created timestamp, hundredths of seconds */
|
||||
__u32 tstamp; /* updated timestamp, hundredths of seconds */
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -130,11 +130,11 @@ struct arpreq_old {
|
|||
|
||||
struct arphdr
|
||||
{
|
||||
unsigned short ar_hrd; /* format of hardware address */
|
||||
unsigned short ar_pro; /* format of protocol address */
|
||||
__be16 ar_hrd; /* format of hardware address */
|
||||
__be16 ar_pro; /* format of protocol address */
|
||||
unsigned char ar_hln; /* length of hardware address */
|
||||
unsigned char ar_pln; /* length of protocol address */
|
||||
unsigned short ar_op; /* ARP opcode (command) */
|
||||
__be16 ar_op; /* ARP opcode (command) */
|
||||
|
||||
#if 0
|
||||
/*
|
||||
|
|
|
|||
136
include/linux/if_link.h
Normal file
136
include/linux/if_link.h
Normal file
|
|
@ -0,0 +1,136 @@
|
|||
#ifndef _LINUX_IF_LINK_H
|
||||
#define _LINUX_IF_LINK_H
|
||||
|
||||
#include <linux/netlink.h>
|
||||
|
||||
/* The struct should be in sync with struct net_device_stats */
|
||||
struct rtnl_link_stats
|
||||
{
|
||||
__u32 rx_packets; /* total packets received */
|
||||
__u32 tx_packets; /* total packets transmitted */
|
||||
__u32 rx_bytes; /* total bytes received */
|
||||
__u32 tx_bytes; /* total bytes transmitted */
|
||||
__u32 rx_errors; /* bad packets received */
|
||||
__u32 tx_errors; /* packet transmit problems */
|
||||
__u32 rx_dropped; /* no space in linux buffers */
|
||||
__u32 tx_dropped; /* no space available in linux */
|
||||
__u32 multicast; /* multicast packets received */
|
||||
__u32 collisions;
|
||||
|
||||
/* detailed rx_errors: */
|
||||
__u32 rx_length_errors;
|
||||
__u32 rx_over_errors; /* receiver ring buff overflow */
|
||||
__u32 rx_crc_errors; /* recved pkt with crc error */
|
||||
__u32 rx_frame_errors; /* recv'd frame alignment error */
|
||||
__u32 rx_fifo_errors; /* recv'r fifo overrun */
|
||||
__u32 rx_missed_errors; /* receiver missed packet */
|
||||
|
||||
/* detailed tx_errors */
|
||||
__u32 tx_aborted_errors;
|
||||
__u32 tx_carrier_errors;
|
||||
__u32 tx_fifo_errors;
|
||||
__u32 tx_heartbeat_errors;
|
||||
__u32 tx_window_errors;
|
||||
|
||||
/* for cslip etc */
|
||||
__u32 rx_compressed;
|
||||
__u32 tx_compressed;
|
||||
};
|
||||
|
||||
/* The struct should be in sync with struct ifmap */
|
||||
struct rtnl_link_ifmap
|
||||
{
|
||||
__u64 mem_start;
|
||||
__u64 mem_end;
|
||||
__u64 base_addr;
|
||||
__u16 irq;
|
||||
__u8 dma;
|
||||
__u8 port;
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
IFLA_UNSPEC,
|
||||
IFLA_ADDRESS,
|
||||
IFLA_BROADCAST,
|
||||
IFLA_IFNAME,
|
||||
IFLA_MTU,
|
||||
IFLA_LINK,
|
||||
IFLA_QDISC,
|
||||
IFLA_STATS,
|
||||
IFLA_COST,
|
||||
#define IFLA_COST IFLA_COST
|
||||
IFLA_PRIORITY,
|
||||
#define IFLA_PRIORITY IFLA_PRIORITY
|
||||
IFLA_MASTER,
|
||||
#define IFLA_MASTER IFLA_MASTER
|
||||
IFLA_WIRELESS, /* Wireless Extension event - see wireless.h */
|
||||
#define IFLA_WIRELESS IFLA_WIRELESS
|
||||
IFLA_PROTINFO, /* Protocol specific information for a link */
|
||||
#define IFLA_PROTINFO IFLA_PROTINFO
|
||||
IFLA_TXQLEN,
|
||||
#define IFLA_TXQLEN IFLA_TXQLEN
|
||||
IFLA_MAP,
|
||||
#define IFLA_MAP IFLA_MAP
|
||||
IFLA_WEIGHT,
|
||||
#define IFLA_WEIGHT IFLA_WEIGHT
|
||||
IFLA_OPERSTATE,
|
||||
IFLA_LINKMODE,
|
||||
__IFLA_MAX
|
||||
};
|
||||
|
||||
|
||||
#define IFLA_MAX (__IFLA_MAX - 1)
|
||||
|
||||
/* ifi_flags.
|
||||
|
||||
IFF_* flags.
|
||||
|
||||
The only change is:
|
||||
IFF_LOOPBACK, IFF_BROADCAST and IFF_POINTOPOINT are
|
||||
more not changeable by user. They describe link media
|
||||
characteristics and set by device driver.
|
||||
|
||||
Comments:
|
||||
- Combination IFF_BROADCAST|IFF_POINTOPOINT is invalid
|
||||
- If neither of these three flags are set;
|
||||
the interface is NBMA.
|
||||
|
||||
- IFF_MULTICAST does not mean anything special:
|
||||
multicasts can be used on all not-NBMA links.
|
||||
IFF_MULTICAST means that this media uses special encapsulation
|
||||
for multicast frames. Apparently, all IFF_POINTOPOINT and
|
||||
IFF_BROADCAST devices are able to use multicasts too.
|
||||
*/
|
||||
|
||||
/* IFLA_LINK.
|
||||
For usual devices it is equal ifi_index.
|
||||
If it is a "virtual interface" (f.e. tunnel), ifi_link
|
||||
can point to real physical interface (f.e. for bandwidth calculations),
|
||||
or maybe 0, what means, that real media is unknown (usual
|
||||
for IPIP tunnels, when route to endpoint is allowed to change)
|
||||
*/
|
||||
|
||||
/* Subtype attributes for IFLA_PROTINFO */
|
||||
enum
|
||||
{
|
||||
IFLA_INET6_UNSPEC,
|
||||
IFLA_INET6_FLAGS, /* link flags */
|
||||
IFLA_INET6_CONF, /* sysctl parameters */
|
||||
IFLA_INET6_STATS, /* statistics */
|
||||
IFLA_INET6_MCAST, /* MC things. What of them? */
|
||||
IFLA_INET6_CACHEINFO, /* time values and max reasm size */
|
||||
__IFLA_INET6_MAX
|
||||
};
|
||||
|
||||
#define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1)
|
||||
|
||||
struct ifla_cacheinfo
|
||||
{
|
||||
__u32 max_reasm_len;
|
||||
__u32 tstamp; /* ipv6InterfaceTable updated timestamp */
|
||||
__u32 reachable_time;
|
||||
__u32 retrans_time;
|
||||
};
|
||||
|
||||
#endif /* _LINUX_IF_LINK_H */
|
||||
|
|
@ -30,8 +30,8 @@ struct igmphdr
|
|||
{
|
||||
__u8 type;
|
||||
__u8 code; /* For newer IGMP */
|
||||
__u16 csum;
|
||||
__u32 group;
|
||||
__be16 csum;
|
||||
__be32 group;
|
||||
};
|
||||
|
||||
/* V3 group record types [grec_type] */
|
||||
|
|
@ -45,25 +45,25 @@ struct igmphdr
|
|||
struct igmpv3_grec {
|
||||
__u8 grec_type;
|
||||
__u8 grec_auxwords;
|
||||
__u16 grec_nsrcs;
|
||||
__u32 grec_mca;
|
||||
__u32 grec_src[0];
|
||||
__be16 grec_nsrcs;
|
||||
__be32 grec_mca;
|
||||
__be32 grec_src[0];
|
||||
};
|
||||
|
||||
struct igmpv3_report {
|
||||
__u8 type;
|
||||
__u8 resv1;
|
||||
__u16 csum;
|
||||
__u16 resv2;
|
||||
__u16 ngrec;
|
||||
__be16 csum;
|
||||
__be16 resv2;
|
||||
__be16 ngrec;
|
||||
struct igmpv3_grec grec[0];
|
||||
};
|
||||
|
||||
struct igmpv3_query {
|
||||
__u8 type;
|
||||
__u8 code;
|
||||
__u16 csum;
|
||||
__u32 group;
|
||||
__be16 csum;
|
||||
__be32 group;
|
||||
#if defined(__LITTLE_ENDIAN_BITFIELD)
|
||||
__u8 qrv:3,
|
||||
suppress:1,
|
||||
|
|
@ -76,8 +76,8 @@ struct igmpv3_query {
|
|||
#error "Please fix <asm/byteorder.h>"
|
||||
#endif
|
||||
__u8 qqic;
|
||||
__u16 nsrcs;
|
||||
__u32 srcs[0];
|
||||
__be16 nsrcs;
|
||||
__be32 srcs[0];
|
||||
};
|
||||
|
||||
#define IGMP_HOST_MEMBERSHIP_QUERY 0x11 /* From RFC1112 */
|
||||
|
|
@ -136,11 +136,11 @@ struct ip_sf_socklist
|
|||
{
|
||||
unsigned int sl_max;
|
||||
unsigned int sl_count;
|
||||
__u32 sl_addr[0];
|
||||
__be32 sl_addr[0];
|
||||
};
|
||||
|
||||
#define IP_SFLSIZE(count) (sizeof(struct ip_sf_socklist) + \
|
||||
(count) * sizeof(__u32))
|
||||
(count) * sizeof(__be32))
|
||||
|
||||
#define IP_SFBLOCK 10 /* allocate this many at once */
|
||||
|
||||
|
|
@ -159,7 +159,7 @@ struct ip_mc_socklist
|
|||
struct ip_sf_list
|
||||
{
|
||||
struct ip_sf_list *sf_next;
|
||||
__u32 sf_inaddr;
|
||||
__be32 sf_inaddr;
|
||||
unsigned long sf_count[2]; /* include/exclude counts */
|
||||
unsigned char sf_gsresp; /* include in g & s response? */
|
||||
unsigned char sf_oldin; /* change state */
|
||||
|
|
@ -197,7 +197,7 @@ struct ip_mc_list
|
|||
#define IGMPV3_QQIC(value) IGMPV3_EXP(0x80, 4, 3, value)
|
||||
#define IGMPV3_MRC(value) IGMPV3_EXP(0x80, 4, 3, value)
|
||||
|
||||
extern int ip_check_mc(struct in_device *dev, u32 mc_addr, u32 src_addr, u16 proto);
|
||||
extern int ip_check_mc(struct in_device *dev, __be32 mc_addr, __be32 src_addr, u16 proto);
|
||||
extern int igmp_rcv(struct sk_buff *);
|
||||
extern int ip_mc_join_group(struct sock *sk, struct ip_mreqn *imr);
|
||||
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,
|
|||
struct ip_msfilter __user *optval, int __user *optlen);
|
||||
extern int ip_mc_gsfget(struct sock *sk, struct group_filter *gsf,
|
||||
struct group_filter __user *optval, int __user *optlen);
|
||||
extern int ip_mc_sf_allow(struct sock *sk, u32 local, u32 rmt, int dif);
|
||||
extern int ip_mc_sf_allow(struct sock *sk, __be32 local, __be32 rmt, int dif);
|
||||
extern void ip_mr_init(void);
|
||||
extern void ip_mc_init_dev(struct in_device *);
|
||||
extern void ip_mc_destroy_dev(struct in_device *);
|
||||
extern void ip_mc_up(struct in_device *);
|
||||
extern void ip_mc_down(struct in_device *);
|
||||
extern void ip_mc_dec_group(struct in_device *in_dev, u32 addr);
|
||||
extern void ip_mc_inc_group(struct in_device *in_dev, u32 addr);
|
||||
extern void ip_mc_dec_group(struct in_device *in_dev, __be32 addr);
|
||||
extern void ip_mc_inc_group(struct in_device *in_dev, __be32 addr);
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ enum {
|
|||
|
||||
/* Internet address. */
|
||||
struct in_addr {
|
||||
__u32 s_addr;
|
||||
__be32 s_addr;
|
||||
};
|
||||
|
||||
#define IP_TOS 1
|
||||
|
|
@ -123,17 +123,17 @@ struct ip_mreqn
|
|||
};
|
||||
|
||||
struct ip_mreq_source {
|
||||
__u32 imr_multiaddr;
|
||||
__u32 imr_interface;
|
||||
__u32 imr_sourceaddr;
|
||||
__be32 imr_multiaddr;
|
||||
__be32 imr_interface;
|
||||
__be32 imr_sourceaddr;
|
||||
};
|
||||
|
||||
struct ip_msfilter {
|
||||
__u32 imsf_multiaddr;
|
||||
__u32 imsf_interface;
|
||||
__be32 imsf_multiaddr;
|
||||
__be32 imsf_interface;
|
||||
__u32 imsf_fmode;
|
||||
__u32 imsf_numsrc;
|
||||
__u32 imsf_slist[1];
|
||||
__be32 imsf_slist[1];
|
||||
};
|
||||
|
||||
#define IP_MSFILTER_SIZE(numsrc) \
|
||||
|
|
@ -177,7 +177,7 @@ struct in_pktinfo
|
|||
#define __SOCK_SIZE__ 16 /* sizeof(struct sockaddr) */
|
||||
struct sockaddr_in {
|
||||
sa_family_t sin_family; /* Address family */
|
||||
unsigned short int sin_port; /* Port number */
|
||||
__be16 sin_port; /* Port number */
|
||||
struct in_addr sin_addr; /* Internet address */
|
||||
|
||||
/* Pad to size of `struct sockaddr'. */
|
||||
|
|
|
|||
|
|
@ -32,8 +32,8 @@ struct in6_addr
|
|||
union
|
||||
{
|
||||
__u8 u6_addr8[16];
|
||||
__u16 u6_addr16[8];
|
||||
__u32 u6_addr32[4];
|
||||
__be16 u6_addr16[8];
|
||||
__be32 u6_addr32[4];
|
||||
} in6_u;
|
||||
#define s6_addr in6_u.u6_addr8
|
||||
#define s6_addr16 in6_u.u6_addr16
|
||||
|
|
@ -53,7 +53,7 @@ extern const struct in6_addr in6addr_loopback;
|
|||
|
||||
struct sockaddr_in6 {
|
||||
unsigned short int sin6_family; /* AF_INET6 */
|
||||
__u16 sin6_port; /* Transport layer port # */
|
||||
__be16 sin6_port; /* Transport layer port # */
|
||||
__u32 sin6_flowinfo; /* IPv6 flow information */
|
||||
struct in6_addr sin6_addr; /* IPv6 address */
|
||||
__u32 sin6_scope_id; /* scope id (new in RFC2553) */
|
||||
|
|
@ -134,6 +134,7 @@ struct in6_flowlabel_req
|
|||
#define IPPROTO_ICMPV6 58 /* ICMPv6 */
|
||||
#define IPPROTO_NONE 59 /* IPv6 no next header */
|
||||
#define IPPROTO_DSTOPTS 60 /* IPv6 destination options */
|
||||
#define IPPROTO_MH 135 /* IPv6 mobility header */
|
||||
|
||||
/*
|
||||
* IPv6 TLV options.
|
||||
|
|
@ -142,6 +143,7 @@ struct in6_flowlabel_req
|
|||
#define IPV6_TLV_PADN 1
|
||||
#define IPV6_TLV_ROUTERALERT 5
|
||||
#define IPV6_TLV_JUMBO 194
|
||||
#define IPV6_TLV_HAO 201 /* home address option */
|
||||
|
||||
/*
|
||||
* IPV6 socket options
|
||||
|
|
|
|||
|
|
@ -46,5 +46,7 @@
|
|||
#include <linux/types.h>
|
||||
|
||||
extern __be32 in_aton(const char *str);
|
||||
extern int in4_pton(const char *src, int srclen, u8 *dst, char delim, const char **end);
|
||||
extern int in6_pton(const char *src, int srclen, u8 *dst, char delim, const char **end);
|
||||
#endif
|
||||
#endif /* _LINUX_INET_H */
|
||||
|
|
|
|||
|
|
@ -9,10 +9,10 @@
|
|||
|
||||
/* Socket identity */
|
||||
struct inet_diag_sockid {
|
||||
__u16 idiag_sport;
|
||||
__u16 idiag_dport;
|
||||
__u32 idiag_src[4];
|
||||
__u32 idiag_dst[4];
|
||||
__be16 idiag_sport;
|
||||
__be16 idiag_dport;
|
||||
__be32 idiag_src[4];
|
||||
__be32 idiag_dst[4];
|
||||
__u32 idiag_if;
|
||||
__u32 idiag_cookie[2];
|
||||
#define INET_DIAG_NOCOOKIE (~0U)
|
||||
|
|
@ -67,7 +67,7 @@ struct inet_diag_hostcond {
|
|||
__u8 family;
|
||||
__u8 prefix_len;
|
||||
int port;
|
||||
__u32 addr[0];
|
||||
__be32 addr[0];
|
||||
};
|
||||
|
||||
/* Base info structure. It contains socket identity (addrs/ports/cookie)
|
||||
|
|
|
|||
|
|
@ -90,11 +90,11 @@ struct in_ifaddr
|
|||
struct in_ifaddr *ifa_next;
|
||||
struct in_device *ifa_dev;
|
||||
struct rcu_head rcu_head;
|
||||
u32 ifa_local;
|
||||
u32 ifa_address;
|
||||
u32 ifa_mask;
|
||||
u32 ifa_broadcast;
|
||||
u32 ifa_anycast;
|
||||
__be32 ifa_local;
|
||||
__be32 ifa_address;
|
||||
__be32 ifa_mask;
|
||||
__be32 ifa_broadcast;
|
||||
__be32 ifa_anycast;
|
||||
unsigned char ifa_scope;
|
||||
unsigned char ifa_flags;
|
||||
unsigned char ifa_prefixlen;
|
||||
|
|
@ -104,18 +104,18 @@ struct in_ifaddr
|
|||
extern int register_inetaddr_notifier(struct notifier_block *nb);
|
||||
extern int unregister_inetaddr_notifier(struct notifier_block *nb);
|
||||
|
||||
extern struct net_device *ip_dev_find(u32 addr);
|
||||
extern int inet_addr_onlink(struct in_device *in_dev, u32 a, u32 b);
|
||||
extern struct net_device *ip_dev_find(__be32 addr);
|
||||
extern int inet_addr_onlink(struct in_device *in_dev, __be32 a, __be32 b);
|
||||
extern int devinet_ioctl(unsigned int cmd, void __user *);
|
||||
extern void devinet_init(void);
|
||||
extern struct in_device *inetdev_init(struct net_device *dev);
|
||||
extern struct in_device *inetdev_by_index(int);
|
||||
extern u32 inet_select_addr(const struct net_device *dev, u32 dst, int scope);
|
||||
extern u32 inet_confirm_addr(const struct net_device *dev, u32 dst, u32 local, int scope);
|
||||
extern struct in_ifaddr *inet_ifa_byprefix(struct in_device *in_dev, u32 prefix, u32 mask);
|
||||
extern __be32 inet_select_addr(const struct net_device *dev, __be32 dst, int scope);
|
||||
extern __be32 inet_confirm_addr(const struct net_device *dev, __be32 dst, __be32 local, int scope);
|
||||
extern struct in_ifaddr *inet_ifa_byprefix(struct in_device *in_dev, __be32 prefix, __be32 mask);
|
||||
extern void inet_forward_change(void);
|
||||
|
||||
static __inline__ int inet_ifa_match(u32 addr, struct in_ifaddr *ifa)
|
||||
static __inline__ int inet_ifa_match(__be32 addr, struct in_ifaddr *ifa)
|
||||
{
|
||||
return !((addr^ifa->ifa_address)&ifa->ifa_mask);
|
||||
}
|
||||
|
|
@ -183,7 +183,7 @@ static inline void in_dev_put(struct in_device *idev)
|
|||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
static __inline__ __u32 inet_make_mask(int logmask)
|
||||
static __inline__ __be32 inet_make_mask(int logmask)
|
||||
{
|
||||
if (logmask)
|
||||
return htonl(~((1<<(32-logmask))-1));
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ extern initcall_t __security_initcall_start[], __security_initcall_end[];
|
|||
|
||||
/* Defined in init/main.c */
|
||||
extern char saved_command_line[];
|
||||
extern unsigned int reset_devices;
|
||||
|
||||
/* used by init/main.c */
|
||||
extern void setup_arch(char **);
|
||||
|
|
|
|||
|
|
@ -123,6 +123,14 @@ static inline void disable_irq_nosync_lockdep(unsigned int irq)
|
|||
#endif
|
||||
}
|
||||
|
||||
static inline void disable_irq_nosync_lockdep_irqsave(unsigned int irq, unsigned long *flags)
|
||||
{
|
||||
disable_irq_nosync(irq);
|
||||
#ifdef CONFIG_LOCKDEP
|
||||
local_irq_save(*flags);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void disable_irq_lockdep(unsigned int irq)
|
||||
{
|
||||
disable_irq(irq);
|
||||
|
|
@ -139,6 +147,14 @@ static inline void enable_irq_lockdep(unsigned int irq)
|
|||
enable_irq(irq);
|
||||
}
|
||||
|
||||
static inline void enable_irq_lockdep_irqrestore(unsigned int irq, unsigned long *flags)
|
||||
{
|
||||
#ifdef CONFIG_LOCKDEP
|
||||
local_irq_restore(*flags);
|
||||
#endif
|
||||
enable_irq(irq);
|
||||
}
|
||||
|
||||
/* IRQ wakeup (PM) control: */
|
||||
extern int set_irq_wake(unsigned int irq, unsigned int on);
|
||||
|
||||
|
|
|
|||
|
|
@ -19,8 +19,12 @@
|
|||
#define _LINUX_IO_H
|
||||
|
||||
#include <asm/io.h>
|
||||
#include <asm/page.h>
|
||||
|
||||
void __iowrite32_copy(void __iomem *to, const void *from, size_t count);
|
||||
void __iowrite64_copy(void __iomem *to, const void *from, size_t count);
|
||||
|
||||
int ioremap_page_range(unsigned long addr, unsigned long end,
|
||||
unsigned long phys_addr, pgprot_t prot);
|
||||
|
||||
#endif /* _LINUX_IO_H */
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@
|
|||
#define IPOPT_SEC (2 |IPOPT_CONTROL|IPOPT_COPY)
|
||||
#define IPOPT_LSRR (3 |IPOPT_CONTROL|IPOPT_COPY)
|
||||
#define IPOPT_TIMESTAMP (4 |IPOPT_MEASUREMENT)
|
||||
#define IPOPT_CIPSO (6 |IPOPT_CONTROL|IPOPT_COPY)
|
||||
#define IPOPT_RR (7 |IPOPT_CONTROL)
|
||||
#define IPOPT_SID (8 |IPOPT_CONTROL|IPOPT_COPY)
|
||||
#define IPOPT_SSRR (9 |IPOPT_CONTROL|IPOPT_COPY)
|
||||
|
|
@ -95,7 +96,7 @@ struct iphdr {
|
|||
__be16 frag_off;
|
||||
__u8 ttl;
|
||||
__u8 protocol;
|
||||
__u16 check;
|
||||
__be16 check;
|
||||
__be32 saddr;
|
||||
__be32 daddr;
|
||||
/*The options start here. */
|
||||
|
|
@ -104,22 +105,22 @@ struct iphdr {
|
|||
struct ip_auth_hdr {
|
||||
__u8 nexthdr;
|
||||
__u8 hdrlen; /* This one is measured in 32 bit units! */
|
||||
__u16 reserved;
|
||||
__u32 spi;
|
||||
__u32 seq_no; /* Sequence number */
|
||||
__be16 reserved;
|
||||
__be32 spi;
|
||||
__be32 seq_no; /* Sequence number */
|
||||
__u8 auth_data[0]; /* Variable len but >=4. Mind the 64 bit alignment! */
|
||||
};
|
||||
|
||||
struct ip_esp_hdr {
|
||||
__u32 spi;
|
||||
__u32 seq_no; /* Sequence number */
|
||||
__be32 spi;
|
||||
__be32 seq_no; /* Sequence number */
|
||||
__u8 enc_data[0]; /* Variable len but >=8. Mind the 64 bit alignment! */
|
||||
};
|
||||
|
||||
struct ip_comp_hdr {
|
||||
__u8 nexthdr;
|
||||
__u8 flags;
|
||||
__u16 cpi;
|
||||
__be16 cpi;
|
||||
};
|
||||
|
||||
#endif /* _LINUX_IP_H */
|
||||
|
|
|
|||
|
|
@ -148,6 +148,13 @@ struct ipmi_lan_addr
|
|||
#define IPMI_BMC_CHANNEL 0xf
|
||||
#define IPMI_NUM_CHANNELS 0x10
|
||||
|
||||
/*
|
||||
* Used to signify an "all channel" bitmask. This is more than the
|
||||
* actual number of channels because this is used in userland and
|
||||
* will cover us if the number of channels is extended.
|
||||
*/
|
||||
#define IPMI_CHAN_ALL (~0)
|
||||
|
||||
|
||||
/*
|
||||
* A raw IPMI message without any addressing. This covers both
|
||||
|
|
@ -350,18 +357,21 @@ int ipmi_request_supply_msgs(ipmi_user_t user,
|
|||
|
||||
/*
|
||||
* When commands come in to the SMS, the user can register to receive
|
||||
* them. Only one user can be listening on a specific netfn/cmd pair
|
||||
* them. Only one user can be listening on a specific netfn/cmd/chan tuple
|
||||
* at a time, you will get an EBUSY error if the command is already
|
||||
* registered. If a command is received that does not have a user
|
||||
* registered, the driver will automatically return the proper
|
||||
* error.
|
||||
* error. Channels are specified as a bitfield, use IPMI_CHAN_ALL to
|
||||
* mean all channels.
|
||||
*/
|
||||
int ipmi_register_for_cmd(ipmi_user_t user,
|
||||
unsigned char netfn,
|
||||
unsigned char cmd);
|
||||
unsigned char cmd,
|
||||
unsigned int chans);
|
||||
int ipmi_unregister_for_cmd(ipmi_user_t user,
|
||||
unsigned char netfn,
|
||||
unsigned char cmd);
|
||||
unsigned char cmd,
|
||||
unsigned int chans);
|
||||
|
||||
/*
|
||||
* Allow run-to-completion mode to be set for the interface of
|
||||
|
|
@ -571,6 +581,36 @@ struct ipmi_cmdspec
|
|||
#define IPMICTL_UNREGISTER_FOR_CMD _IOR(IPMI_IOC_MAGIC, 15, \
|
||||
struct ipmi_cmdspec)
|
||||
|
||||
/*
|
||||
* Register to get commands from other entities on specific channels.
|
||||
* This way, you can only listen on specific channels, or have messages
|
||||
* from some channels go to one place and other channels to someplace
|
||||
* else. The chans field is a bitmask, (1 << channel) for each channel.
|
||||
* It may be IPMI_CHAN_ALL for all channels.
|
||||
*/
|
||||
struct ipmi_cmdspec_chans
|
||||
{
|
||||
unsigned int netfn;
|
||||
unsigned int cmd;
|
||||
unsigned int chans;
|
||||
};
|
||||
|
||||
/*
|
||||
* Register to receive a specific command on specific channels. error values:
|
||||
* - EFAULT - an address supplied was invalid.
|
||||
* - EBUSY - One of the netfn/cmd/chans supplied was already in use.
|
||||
* - ENOMEM - could not allocate memory for the entry.
|
||||
*/
|
||||
#define IPMICTL_REGISTER_FOR_CMD_CHANS _IOR(IPMI_IOC_MAGIC, 28, \
|
||||
struct ipmi_cmdspec_chans)
|
||||
/*
|
||||
* Unregister some netfn/cmd/chans. error values:
|
||||
* - EFAULT - an address supplied was invalid.
|
||||
* - ENOENT - None of the netfn/cmd/chans were found registered for this user.
|
||||
*/
|
||||
#define IPMICTL_UNREGISTER_FOR_CMD_CHANS _IOR(IPMI_IOC_MAGIC, 29, \
|
||||
struct ipmi_cmdspec_chans)
|
||||
|
||||
/*
|
||||
* Set whether this interface receives events. Note that the first
|
||||
* user registered for events will get all pending events for the
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ struct in6_ifreq {
|
|||
|
||||
#define IPV6_SRCRT_STRICT 0x01 /* this hop must be a neighbor */
|
||||
#define IPV6_SRCRT_TYPE_0 0 /* IPv6 type 0 Routing Header */
|
||||
#define IPV6_SRCRT_TYPE_2 2 /* IPv6 type 2 Routing Header */
|
||||
|
||||
/*
|
||||
* routing header
|
||||
|
|
@ -73,25 +74,47 @@ struct rt0_hdr {
|
|||
#define rt0_type rt_hdr.type
|
||||
};
|
||||
|
||||
/*
|
||||
* routing header type 2
|
||||
*/
|
||||
|
||||
struct rt2_hdr {
|
||||
struct ipv6_rt_hdr rt_hdr;
|
||||
__u32 reserved;
|
||||
struct in6_addr addr;
|
||||
|
||||
#define rt2_type rt_hdr.type
|
||||
};
|
||||
|
||||
/*
|
||||
* home address option in destination options header
|
||||
*/
|
||||
|
||||
struct ipv6_destopt_hao {
|
||||
__u8 type;
|
||||
__u8 length;
|
||||
struct in6_addr addr;
|
||||
} __attribute__ ((__packed__));
|
||||
|
||||
struct ipv6_auth_hdr {
|
||||
__u8 nexthdr;
|
||||
__u8 hdrlen; /* This one is measured in 32 bit units! */
|
||||
__u16 reserved;
|
||||
__u32 spi;
|
||||
__u32 seq_no; /* Sequence number */
|
||||
__be16 reserved;
|
||||
__be32 spi;
|
||||
__be32 seq_no; /* Sequence number */
|
||||
__u8 auth_data[0]; /* Length variable but >=4. Mind the 64 bit alignment! */
|
||||
};
|
||||
|
||||
struct ipv6_esp_hdr {
|
||||
__u32 spi;
|
||||
__u32 seq_no; /* Sequence number */
|
||||
__be32 spi;
|
||||
__be32 seq_no; /* Sequence number */
|
||||
__u8 enc_data[0]; /* Length variable but >=8. Mind the 64 bit alignment! */
|
||||
};
|
||||
|
||||
struct ipv6_comp_hdr {
|
||||
__u8 nexthdr;
|
||||
__u8 flags;
|
||||
__u16 cpi;
|
||||
__be16 cpi;
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
@ -113,7 +136,7 @@ struct ipv6hdr {
|
|||
#endif
|
||||
__u8 flow_lbl[3];
|
||||
|
||||
__u16 payload_len;
|
||||
__be16 payload_len;
|
||||
__u8 nexthdr;
|
||||
__u8 hop_limit;
|
||||
|
||||
|
|
@ -153,6 +176,7 @@ struct ipv6_devconf {
|
|||
__s32 accept_ra_rt_info_max_plen;
|
||||
#endif
|
||||
#endif
|
||||
__s32 proxy_ndp;
|
||||
void *sysctl;
|
||||
};
|
||||
|
||||
|
|
@ -180,6 +204,7 @@ enum {
|
|||
DEVCONF_ACCEPT_RA_RTR_PREF,
|
||||
DEVCONF_RTR_PROBE_INTERVAL,
|
||||
DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN,
|
||||
DEVCONF_PROXY_NDP,
|
||||
DEVCONF_MAX
|
||||
};
|
||||
|
||||
|
|
@ -206,6 +231,9 @@ struct inet6_skb_parm {
|
|||
__u16 lastopt;
|
||||
__u32 nhoff;
|
||||
__u16 flags;
|
||||
#ifdef CONFIG_IPV6_MIP6
|
||||
__u16 dsthao;
|
||||
#endif
|
||||
|
||||
#define IP6SKB_XFRM_TRANSFORMED 1
|
||||
};
|
||||
|
|
@ -242,6 +270,9 @@ struct ipv6_pinfo {
|
|||
struct in6_addr rcv_saddr;
|
||||
struct in6_addr daddr;
|
||||
struct in6_addr *daddr_cache;
|
||||
#ifdef CONFIG_IPV6_SUBTREES
|
||||
struct in6_addr *saddr_cache;
|
||||
#endif
|
||||
|
||||
__u32 flow_label;
|
||||
__u32 frag_size;
|
||||
|
|
@ -430,7 +461,7 @@ static inline struct raw6_sock *raw6_sk(const struct sock *sk)
|
|||
|
||||
#define INET6_MATCH(__sk, __hash, __saddr, __daddr, __ports, __dif)\
|
||||
(((__sk)->sk_hash == (__hash)) && \
|
||||
((*((__u32 *)&(inet_sk(__sk)->dport))) == (__ports)) && \
|
||||
((*((__portpair *)&(inet_sk(__sk)->dport))) == (__ports)) && \
|
||||
((__sk)->sk_family == AF_INET6) && \
|
||||
ipv6_addr_equal(&inet6_sk(__sk)->daddr, (__saddr)) && \
|
||||
ipv6_addr_equal(&inet6_sk(__sk)->rcv_saddr, (__daddr)) && \
|
||||
|
|
|
|||
|
|
@ -320,7 +320,9 @@ handle_irq_name(void fastcall (*handle)(unsigned int, struct irq_desc *,
|
|||
* Monolithic do_IRQ implementation.
|
||||
* (is an explicit fastcall, because i386 4KSTACKS calls it from assembly)
|
||||
*/
|
||||
#ifndef CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ
|
||||
extern fastcall unsigned int __do_IRQ(unsigned int irq, struct pt_regs *regs);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* 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)
|
|||
{
|
||||
struct irq_desc *desc = irq_desc + irq;
|
||||
|
||||
#ifdef CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ
|
||||
desc->handle_irq(irq, desc, regs);
|
||||
#else
|
||||
if (likely(desc->handle_irq))
|
||||
desc->handle_irq(irq, desc, regs);
|
||||
else
|
||||
__do_IRQ(irq, regs);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Handling of unhandled and spurious interrupts: */
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@
|
|||
#define _ISOFS_FS_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/magic.h>
|
||||
|
||||
/*
|
||||
* The isofs filesystem constants/structures
|
||||
*/
|
||||
|
|
@ -160,6 +162,4 @@ struct iso_directory_record {
|
|||
#define ISOFS_BUFFER_SIZE(INODE) ((INODE)->i_sb->s_blocksize)
|
||||
#define ISOFS_BUFFER_BITS(INODE) ((INODE)->i_sb->s_blocksize_bits)
|
||||
|
||||
#define ISOFS_SUPER_MAGIC 0x9660
|
||||
|
||||
#endif
|
||||
#endif /* _ISOFS_FS_H */
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* linux/include/linux/jbd.h
|
||||
*
|
||||
*
|
||||
* Written by Stephen C. Tweedie <sct@redhat.com>
|
||||
*
|
||||
* Copyright 1998-2000 Red Hat, Inc --- All Rights Reserved
|
||||
|
|
@ -64,7 +64,7 @@ extern int journal_enable_debug;
|
|||
if ((n) <= journal_enable_debug) { \
|
||||
printk (KERN_DEBUG "(%s, %d): %s: ", \
|
||||
__FILE__, __LINE__, __FUNCTION__); \
|
||||
printk (f, ## a); \
|
||||
printk (f, ## a); \
|
||||
} \
|
||||
} while (0)
|
||||
#else
|
||||
|
|
@ -97,8 +97,8 @@ extern void jbd_slab_free(void *ptr, size_t size);
|
|||
* number of outstanding buffers possible at any time. When the
|
||||
* operation completes, any buffer credits not used are credited back to
|
||||
* the transaction, so that at all times we know how many buffers the
|
||||
* outstanding updates on a transaction might possibly touch.
|
||||
*
|
||||
* outstanding updates on a transaction might possibly touch.
|
||||
*
|
||||
* This is an opaque datatype.
|
||||
**/
|
||||
typedef struct handle_s handle_t; /* Atomic operation type */
|
||||
|
|
@ -108,7 +108,7 @@ typedef struct handle_s handle_t; /* Atomic operation type */
|
|||
* typedef journal_t - The journal_t maintains all of the journaling state information for a single filesystem.
|
||||
*
|
||||
* journal_t is linked to from the fs superblock structure.
|
||||
*
|
||||
*
|
||||
* We use the journal_t to keep track of all outstanding transaction
|
||||
* activity on the filesystem, and to manage the state of the log
|
||||
* writing process.
|
||||
|
|
@ -128,7 +128,7 @@ typedef struct journal_s journal_t; /* Journal control structure */
|
|||
* On-disk structures
|
||||
*/
|
||||
|
||||
/*
|
||||
/*
|
||||
* Descriptor block types:
|
||||
*/
|
||||
|
||||
|
|
@ -149,8 +149,8 @@ typedef struct journal_header_s
|
|||
} journal_header_t;
|
||||
|
||||
|
||||
/*
|
||||
* The block tag: used to describe a single buffer in the journal
|
||||
/*
|
||||
* The block tag: used to describe a single buffer in the journal
|
||||
*/
|
||||
typedef struct journal_block_tag_s
|
||||
{
|
||||
|
|
@ -158,9 +158,9 @@ typedef struct journal_block_tag_s
|
|||
__be32 t_flags; /* See below */
|
||||
} journal_block_tag_t;
|
||||
|
||||
/*
|
||||
/*
|
||||
* The revoke descriptor: used on disk to describe a series of blocks to
|
||||
* be revoked from the log
|
||||
* be revoked from the log
|
||||
*/
|
||||
typedef struct journal_revoke_header_s
|
||||
{
|
||||
|
|
@ -201,9 +201,9 @@ typedef struct journal_superblock_s
|
|||
|
||||
/* 0x0024 */
|
||||
/* Remaining fields are only valid in a version-2 superblock */
|
||||
__be32 s_feature_compat; /* compatible feature set */
|
||||
__be32 s_feature_incompat; /* incompatible feature set */
|
||||
__be32 s_feature_ro_compat; /* readonly-compatible feature set */
|
||||
__be32 s_feature_compat; /* compatible feature set */
|
||||
__be32 s_feature_incompat; /* incompatible feature set */
|
||||
__be32 s_feature_ro_compat; /* readonly-compatible feature set */
|
||||
/* 0x0030 */
|
||||
__u8 s_uuid[16]; /* 128-bit uuid for journal */
|
||||
|
||||
|
|
@ -374,10 +374,10 @@ struct jbd_revoke_table_s;
|
|||
**/
|
||||
|
||||
/* Docbook can't yet cope with the bit fields, but will leave the documentation
|
||||
* in so it can be fixed later.
|
||||
* in so it can be fixed later.
|
||||
*/
|
||||
|
||||
struct handle_s
|
||||
struct handle_s
|
||||
{
|
||||
/* Which compound transaction is this update a part of? */
|
||||
transaction_t *h_transaction;
|
||||
|
|
@ -435,7 +435,7 @@ struct handle_s
|
|||
*
|
||||
*/
|
||||
|
||||
struct transaction_s
|
||||
struct transaction_s
|
||||
{
|
||||
/* Pointer to the journal for this transaction. [no locking] */
|
||||
journal_t *t_journal;
|
||||
|
|
@ -455,7 +455,7 @@ struct transaction_s
|
|||
T_RUNDOWN,
|
||||
T_FLUSH,
|
||||
T_COMMIT,
|
||||
T_FINISHED
|
||||
T_FINISHED
|
||||
} t_state;
|
||||
|
||||
/*
|
||||
|
|
@ -569,7 +569,7 @@ struct transaction_s
|
|||
* journal_t.
|
||||
* @j_flags: General journaling state flags
|
||||
* @j_errno: Is there an outstanding uncleared error on the journal (from a
|
||||
* prior abort)?
|
||||
* prior abort)?
|
||||
* @j_sb_buffer: First part of superblock buffer
|
||||
* @j_superblock: Second part of superblock buffer
|
||||
* @j_format_version: Version of the superblock format
|
||||
|
|
@ -583,7 +583,7 @@ struct transaction_s
|
|||
* @j_wait_transaction_locked: Wait queue for waiting for a locked transaction
|
||||
* to start committing, or for a barrier lock to be released
|
||||
* @j_wait_logspace: Wait queue for waiting for checkpointing to complete
|
||||
* @j_wait_done_commit: Wait queue for waiting for commit to complete
|
||||
* @j_wait_done_commit: Wait queue for waiting for commit to complete
|
||||
* @j_wait_checkpoint: Wait queue to trigger checkpointing
|
||||
* @j_wait_commit: Wait queue to trigger commit
|
||||
* @j_wait_updates: Wait queue to wait for updates to complete
|
||||
|
|
@ -592,7 +592,7 @@ struct transaction_s
|
|||
* @j_tail: Journal tail - identifies the oldest still-used block in the
|
||||
* journal.
|
||||
* @j_free: Journal free - how many free blocks are there in the journal?
|
||||
* @j_first: The block number of the first usable block
|
||||
* @j_first: The block number of the first usable block
|
||||
* @j_last: The block number one beyond the last usable block
|
||||
* @j_dev: Device where we store the journal
|
||||
* @j_blocksize: blocksize for the location where we store the journal.
|
||||
|
|
@ -604,12 +604,12 @@ struct transaction_s
|
|||
* @j_list_lock: Protects the buffer lists and internal buffer state.
|
||||
* @j_inode: Optional inode where we store the journal. If present, all journal
|
||||
* block numbers are mapped into this inode via bmap().
|
||||
* @j_tail_sequence: Sequence number of the oldest transaction in the log
|
||||
* @j_tail_sequence: Sequence number of the oldest transaction in the log
|
||||
* @j_transaction_sequence: Sequence number of the next transaction to grant
|
||||
* @j_commit_sequence: Sequence number of the most recently committed
|
||||
* transaction
|
||||
* @j_commit_request: Sequence number of the most recent transaction wanting
|
||||
* commit
|
||||
* commit
|
||||
* @j_uuid: Uuid of client object.
|
||||
* @j_task: Pointer to the current commit thread for this journal
|
||||
* @j_max_transaction_buffers: Maximum number of metadata buffers to allow in a
|
||||
|
|
@ -699,7 +699,7 @@ struct journal_s
|
|||
wait_queue_head_t j_wait_updates;
|
||||
|
||||
/* Semaphore for locking against concurrent checkpoints */
|
||||
struct mutex j_checkpoint_mutex;
|
||||
struct mutex j_checkpoint_mutex;
|
||||
|
||||
/*
|
||||
* Journal head: identifies the first unused block in the journal.
|
||||
|
|
@ -732,7 +732,7 @@ struct journal_s
|
|||
*/
|
||||
struct block_device *j_dev;
|
||||
int j_blocksize;
|
||||
unsigned int j_blk_offset;
|
||||
unsigned long j_blk_offset;
|
||||
|
||||
/*
|
||||
* Device which holds the client fs. For internal journal this will be
|
||||
|
|
@ -823,8 +823,8 @@ struct journal_s
|
|||
void *j_private;
|
||||
};
|
||||
|
||||
/*
|
||||
* Journal flag definitions
|
||||
/*
|
||||
* Journal flag definitions
|
||||
*/
|
||||
#define JFS_UNMOUNT 0x001 /* Journal thread is being destroyed */
|
||||
#define JFS_ABORT 0x002 /* Journaling has been aborted for errors. */
|
||||
|
|
@ -833,7 +833,7 @@ struct journal_s
|
|||
#define JFS_LOADED 0x010 /* The journal superblock has been loaded */
|
||||
#define JFS_BARRIER 0x020 /* Use IDE barriers */
|
||||
|
||||
/*
|
||||
/*
|
||||
* Function declarations for the journaling transaction and buffer
|
||||
* management
|
||||
*/
|
||||
|
|
@ -862,11 +862,11 @@ int __journal_remove_checkpoint(struct journal_head *);
|
|||
void __journal_insert_checkpoint(struct journal_head *, transaction_t *);
|
||||
|
||||
/* Buffer IO */
|
||||
extern int
|
||||
extern int
|
||||
journal_write_metadata_buffer(transaction_t *transaction,
|
||||
struct journal_head *jh_in,
|
||||
struct journal_head **jh_out,
|
||||
int blocknr);
|
||||
unsigned long blocknr);
|
||||
|
||||
/* Transaction locking */
|
||||
extern void __wait_on_journal (journal_t *);
|
||||
|
|
@ -890,7 +890,7 @@ static inline handle_t *journal_current_handle(void)
|
|||
/* The journaling code user interface:
|
||||
*
|
||||
* Create and destroy handles
|
||||
* Register buffer modifications against the current transaction.
|
||||
* Register buffer modifications against the current transaction.
|
||||
*/
|
||||
|
||||
extern handle_t *journal_start(journal_t *, int nblocks);
|
||||
|
|
@ -917,11 +917,11 @@ extern journal_t * journal_init_dev(struct block_device *bdev,
|
|||
int start, int len, int bsize);
|
||||
extern journal_t * journal_init_inode (struct inode *);
|
||||
extern int journal_update_format (journal_t *);
|
||||
extern int journal_check_used_features
|
||||
extern int journal_check_used_features
|
||||
(journal_t *, unsigned long, unsigned long, unsigned long);
|
||||
extern int journal_check_available_features
|
||||
extern int journal_check_available_features
|
||||
(journal_t *, unsigned long, unsigned long, unsigned long);
|
||||
extern int journal_set_features
|
||||
extern int journal_set_features
|
||||
(journal_t *, unsigned long, unsigned long, unsigned long);
|
||||
extern int journal_create (journal_t *);
|
||||
extern int journal_load (journal_t *journal);
|
||||
|
|
@ -977,7 +977,6 @@ extern void journal_write_revoke_records(journal_t *, transaction_t *);
|
|||
extern int journal_set_revoke(journal_t *, unsigned long, tid_t);
|
||||
extern int journal_test_revoke(journal_t *, unsigned long, tid_t);
|
||||
extern void journal_clear_revoke(journal_t *);
|
||||
extern void journal_brelse_array(struct buffer_head *b[], int n);
|
||||
extern void journal_switch_revoke_table(journal_t *journal);
|
||||
|
||||
/*
|
||||
|
|
@ -1015,7 +1014,7 @@ do { \
|
|||
* bit, when set, indicates that we have had a fatal error somewhere,
|
||||
* either inside the journaling layer or indicated to us by the client
|
||||
* (eg. ext3), and that we and should not commit any further
|
||||
* transactions.
|
||||
* transactions.
|
||||
*/
|
||||
|
||||
static inline int is_journal_aborted(journal_t *journal)
|
||||
|
|
@ -1082,7 +1081,7 @@ static inline int jbd_space_needed(journal_t *journal)
|
|||
#define BJ_Reserved 7 /* Buffer is reserved for access by journal */
|
||||
#define BJ_Locked 8 /* Locked for I/O during commit */
|
||||
#define BJ_Types 9
|
||||
|
||||
|
||||
extern int jbd_blocks_per_page(struct inode *inode);
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
|
|
|||
|
|
@ -15,12 +15,12 @@
|
|||
#ifndef __LINUX_JFFS2_H__
|
||||
#define __LINUX_JFFS2_H__
|
||||
|
||||
#include <linux/magic.h>
|
||||
|
||||
/* You must include something which defines the C99 uintXX_t types.
|
||||
We don't do it from here because this file is used in too many
|
||||
different environments. */
|
||||
|
||||
#define JFFS2_SUPER_MAGIC 0x72b6
|
||||
|
||||
/* Values we may expect to find in the 'magic' field */
|
||||
#define JFFS2_OLD_MAGIC_BITMASK 0x1984
|
||||
#define JFFS2_MAGIC_BITMASK 0x1985
|
||||
|
|
|
|||
|
|
@ -115,6 +115,21 @@ static inline u64 get_jiffies_64(void)
|
|||
((long)(a) - (long)(b) >= 0))
|
||||
#define time_before_eq(a,b) time_after_eq(b,a)
|
||||
|
||||
/* Same as above, but does so with platform independent 64bit types.
|
||||
* These must be used when utilizing jiffies_64 (i.e. return value of
|
||||
* get_jiffies_64() */
|
||||
#define time_after64(a,b) \
|
||||
(typecheck(__u64, a) && \
|
||||
typecheck(__u64, b) && \
|
||||
((__s64)(b) - (__s64)(a) < 0))
|
||||
#define time_before64(a,b) time_after64(b,a)
|
||||
|
||||
#define time_after_eq64(a,b) \
|
||||
(typecheck(__u64, a) && \
|
||||
typecheck(__u64, b) && \
|
||||
((__s64)(a) - (__s64)(b) >= 0))
|
||||
#define time_before_eq64(a,b) time_after_eq64(b,a)
|
||||
|
||||
/*
|
||||
* Have the 32 bit jiffies value wrap 5 minutes after boot
|
||||
* so jiffies wrap bugs show up earlier.
|
||||
|
|
|
|||
|
|
@ -31,8 +31,9 @@ extern const char linux_banner[];
|
|||
#define STACK_MAGIC 0xdeadbeef
|
||||
|
||||
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
|
||||
#define ALIGN(x,a) (((x)+(a)-1)&~((a)-1))
|
||||
#define ALIGN(x,a) (((x)+(a)-1UL)&~((a)-1UL))
|
||||
#define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f))
|
||||
#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
|
||||
#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
|
||||
|
||||
#define KERN_EMERG "<0>" /* system is unusable */
|
||||
|
|
@ -186,6 +187,7 @@ extern void bust_spinlocks(int yes);
|
|||
extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in progress */
|
||||
extern int panic_timeout;
|
||||
extern int panic_on_oops;
|
||||
extern int panic_on_unrecovered_nmi;
|
||||
extern int tainted;
|
||||
extern const char *print_tainted(void);
|
||||
extern void add_taint(unsigned);
|
||||
|
|
@ -348,4 +350,11 @@ struct sysinfo {
|
|||
/* Trap pasters of __FUNCTION__ at compile-time */
|
||||
#define __FUNCTION__ (__func__)
|
||||
|
||||
/* This helps us to avoid #ifdef CONFIG_NUMA */
|
||||
#ifdef CONFIG_NUMA
|
||||
#define NUMA_BUILD 1
|
||||
#else
|
||||
#define NUMA_BUILD 0
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -47,4 +47,8 @@ call_usermodehelper(char *path, char **argv, char **envp, int wait)
|
|||
|
||||
extern void usermodehelper_init(void);
|
||||
|
||||
struct file;
|
||||
extern int call_usermodehelper_pipe(char *path, char *argv[], char *envp[],
|
||||
struct file **filp);
|
||||
|
||||
#endif /* __LINUX_KMOD_H__ */
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
#include <linux/types.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/sysfs.h>
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/rwsem.h>
|
||||
#include <linux/kref.h>
|
||||
|
|
@ -71,12 +72,12 @@ static inline const char * kobject_name(const struct kobject * kobj)
|
|||
extern void kobject_init(struct kobject *);
|
||||
extern void kobject_cleanup(struct kobject *);
|
||||
|
||||
extern int kobject_add(struct kobject *);
|
||||
extern int __must_check kobject_add(struct kobject *);
|
||||
extern void kobject_del(struct kobject *);
|
||||
|
||||
extern int kobject_rename(struct kobject *, const char *new_name);
|
||||
extern int __must_check kobject_rename(struct kobject *, const char *new_name);
|
||||
|
||||
extern int kobject_register(struct kobject *);
|
||||
extern int __must_check kobject_register(struct kobject *);
|
||||
extern void kobject_unregister(struct kobject *);
|
||||
|
||||
extern struct kobject * kobject_get(struct kobject *);
|
||||
|
|
@ -128,8 +129,8 @@ struct kset {
|
|||
|
||||
|
||||
extern void kset_init(struct kset * k);
|
||||
extern int kset_add(struct kset * k);
|
||||
extern int kset_register(struct kset * k);
|
||||
extern int __must_check kset_add(struct kset * k);
|
||||
extern int __must_check kset_register(struct kset * k);
|
||||
extern void kset_unregister(struct kset * k);
|
||||
|
||||
static inline struct kset * to_kset(struct kobject * kobj)
|
||||
|
|
@ -239,7 +240,7 @@ extern struct subsystem hypervisor_subsys;
|
|||
(obj)->subsys.kset.kobj.kset = &(_subsys).kset
|
||||
|
||||
extern void subsystem_init(struct subsystem *);
|
||||
extern int subsystem_register(struct subsystem *);
|
||||
extern int __must_check subsystem_register(struct subsystem *);
|
||||
extern void subsystem_unregister(struct subsystem *);
|
||||
|
||||
static inline struct subsystem * subsys_get(struct subsystem * s)
|
||||
|
|
@ -258,7 +259,8 @@ struct subsys_attribute {
|
|||
ssize_t (*store)(struct subsystem *, const char *, size_t);
|
||||
};
|
||||
|
||||
extern int subsys_create_file(struct subsystem * , struct subsys_attribute *);
|
||||
extern int __must_check subsys_create_file(struct subsystem * ,
|
||||
struct subsys_attribute *);
|
||||
|
||||
#if defined(CONFIG_HOTPLUG)
|
||||
void kobject_uevent(struct kobject *kobj, enum kobject_action action);
|
||||
|
|
|
|||
25
include/linux/latency.h
Normal file
25
include/linux/latency.h
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* latency.h: Explicit system-wide latency-expectation infrastructure
|
||||
*
|
||||
* (C) Copyright 2006 Intel Corporation
|
||||
* Author: Arjan van de Ven <arjan@linux.intel.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE_GUARD_LATENCY_H_
|
||||
#define _INCLUDE_GUARD_LATENCY_H_
|
||||
|
||||
#include <linux/notifier.h>
|
||||
|
||||
void set_acceptable_latency(char *identifier, int usecs);
|
||||
void modify_acceptable_latency(char *identifier, int usecs);
|
||||
void remove_acceptable_latency(char *identifier);
|
||||
void synchronize_acceptable_latency(void);
|
||||
int system_latency_constraint(void);
|
||||
|
||||
int register_latency_notifier(struct notifier_block * nb);
|
||||
int unregister_latency_notifier(struct notifier_block * nb);
|
||||
|
||||
#define INFINITE_LATENCY 1000000
|
||||
|
||||
#endif
|
||||
|
|
@ -12,6 +12,9 @@
|
|||
#ifndef __LINUX_LEDS_H_INCLUDED
|
||||
#define __LINUX_LEDS_H_INCLUDED
|
||||
|
||||
#include <linux/list.h>
|
||||
#include <linux/spinlock.h>
|
||||
|
||||
struct device;
|
||||
struct class_device;
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -36,6 +36,16 @@
|
|||
#include <linux/workqueue.h>
|
||||
#include <scsi/scsi_host.h>
|
||||
|
||||
/*
|
||||
* Define if arch has non-standard setup. This is a _PCI_ standard
|
||||
* not a legacy or ISA standard.
|
||||
*/
|
||||
#ifdef CONFIG_ATA_NONSTANDARD
|
||||
#include <asm/libata-portmap.h>
|
||||
#else
|
||||
#include <asm-generic/libata-portmap.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* compile-time options: to be removed as soon as all the drivers are
|
||||
* converted to the new debugging mechanism
|
||||
|
|
@ -44,7 +54,7 @@
|
|||
#undef ATA_VERBOSE_DEBUG /* yet more debugging output */
|
||||
#undef ATA_IRQ_TRAP /* define to ack screaming irqs */
|
||||
#undef ATA_NDEBUG /* define to disable quick runtime checks */
|
||||
#undef ATA_ENABLE_PATA /* define to enable PATA support in some
|
||||
#define ATA_ENABLE_PATA /* define to enable PATA support in some
|
||||
* low-level drivers */
|
||||
|
||||
|
||||
|
|
@ -112,8 +122,6 @@ enum {
|
|||
/* tag ATA_MAX_QUEUE - 1 is reserved for internal commands */
|
||||
ATA_MAX_QUEUE = 32,
|
||||
ATA_TAG_INTERNAL = ATA_MAX_QUEUE - 1,
|
||||
ATA_MAX_SECTORS = 200, /* FIXME */
|
||||
ATA_MAX_SECTORS_LBA48 = 65535,
|
||||
ATA_MAX_BUS = 2,
|
||||
ATA_DEF_BUSY_WAIT = 10000,
|
||||
ATA_SHORT_PAUSE = (HZ >> 6) + 1,
|
||||
|
|
@ -197,8 +205,8 @@ enum {
|
|||
ATA_QCFLAG_EH_SCHEDULED = (1 << 18), /* EH scheduled (obsolete) */
|
||||
|
||||
/* host set flags */
|
||||
ATA_HOST_SIMPLEX = (1 << 0), /* Host is simplex, one DMA channel per host_set only */
|
||||
|
||||
ATA_HOST_SIMPLEX = (1 << 0), /* Host is simplex, one DMA channel per host only */
|
||||
|
||||
/* various lengths of time */
|
||||
ATA_TMOUT_BOOT = 30 * HZ, /* heuristic */
|
||||
ATA_TMOUT_BOOT_QUICK = 7 * HZ, /* heuristic */
|
||||
|
|
@ -225,8 +233,8 @@ enum {
|
|||
/* encoding various smaller bitmaps into a single
|
||||
* unsigned int bitmap
|
||||
*/
|
||||
ATA_BITS_PIO = 5,
|
||||
ATA_BITS_MWDMA = 3,
|
||||
ATA_BITS_PIO = 7,
|
||||
ATA_BITS_MWDMA = 5,
|
||||
ATA_BITS_UDMA = 8,
|
||||
|
||||
ATA_SHIFT_PIO = 0,
|
||||
|
|
@ -289,6 +297,11 @@ enum {
|
|||
* most devices.
|
||||
*/
|
||||
ATA_SPINUP_WAIT = 8000,
|
||||
|
||||
/* Horkage types. May be set by libata or controller on drives
|
||||
(some horkage may be drive/controller pair dependant */
|
||||
|
||||
ATA_HORKAGE_DIAGNOSTIC = (1 << 0), /* Failed boot diag */
|
||||
};
|
||||
|
||||
enum hsm_task_states {
|
||||
|
|
@ -350,23 +363,32 @@ struct ata_probe_ent {
|
|||
struct scsi_host_template *sht;
|
||||
struct ata_ioports port[ATA_MAX_PORTS];
|
||||
unsigned int n_ports;
|
||||
unsigned int hard_port_no;
|
||||
unsigned int dummy_port_mask;
|
||||
unsigned int pio_mask;
|
||||
unsigned int mwdma_mask;
|
||||
unsigned int udma_mask;
|
||||
unsigned int legacy_mode;
|
||||
unsigned long irq;
|
||||
unsigned long irq2;
|
||||
unsigned int irq_flags;
|
||||
unsigned long host_flags;
|
||||
unsigned long host_set_flags;
|
||||
unsigned long port_flags;
|
||||
unsigned long _host_flags;
|
||||
void __iomem *mmio_base;
|
||||
void *private_data;
|
||||
|
||||
/* port_info for the secondary port. Together with irq2, it's
|
||||
* used to implement non-uniform secondary port. Currently,
|
||||
* the only user is ata_piix combined mode. This workaround
|
||||
* will be removed together with ata_probe_ent when init model
|
||||
* is updated.
|
||||
*/
|
||||
const struct ata_port_info *pinfo2;
|
||||
};
|
||||
|
||||
struct ata_host_set {
|
||||
struct ata_host {
|
||||
spinlock_t lock;
|
||||
struct device *dev;
|
||||
unsigned long irq;
|
||||
unsigned long irq2;
|
||||
void __iomem *mmio_base;
|
||||
unsigned int n_ports;
|
||||
void *private_data;
|
||||
|
|
@ -374,7 +396,6 @@ struct ata_host_set {
|
|||
unsigned long flags;
|
||||
int simplex_claimed; /* Keep seperate in case we
|
||||
ever need to do this locked */
|
||||
struct ata_host_set *next; /* for legacy mode */
|
||||
struct ata_port *ports[0];
|
||||
};
|
||||
|
||||
|
|
@ -420,7 +441,7 @@ struct ata_queued_cmd {
|
|||
void *private_data;
|
||||
};
|
||||
|
||||
struct ata_host_stats {
|
||||
struct ata_port_stats {
|
||||
unsigned long unhandled_irq;
|
||||
unsigned long idle_irq;
|
||||
unsigned long rw_reqbuf;
|
||||
|
|
@ -468,6 +489,7 @@ struct ata_device {
|
|||
|
||||
/* error history */
|
||||
struct ata_ering ering;
|
||||
unsigned int horkage; /* List of broken features */
|
||||
};
|
||||
|
||||
/* Offset into struct ata_device. Fields above it are maintained
|
||||
|
|
@ -498,14 +520,13 @@ struct ata_eh_context {
|
|||
};
|
||||
|
||||
struct ata_port {
|
||||
struct Scsi_Host *host; /* our co-allocated scsi host */
|
||||
struct Scsi_Host *scsi_host; /* our co-allocated scsi host */
|
||||
const struct ata_port_operations *ops;
|
||||
spinlock_t *lock;
|
||||
unsigned long flags; /* ATA_FLAG_xxx */
|
||||
unsigned int pflags; /* ATA_PFLAG_xxx */
|
||||
unsigned int id; /* unique id req'd by scsi midlyr */
|
||||
unsigned int port_no; /* unique port #; from zero */
|
||||
unsigned int hard_port_no; /* hardware port #; from zero */
|
||||
|
||||
struct ata_prd *prd; /* our SG list */
|
||||
dma_addr_t prd_dma; /* and its DMA mapping */
|
||||
|
|
@ -524,7 +545,7 @@ struct ata_port {
|
|||
unsigned int hw_sata_spd_limit;
|
||||
unsigned int sata_spd_limit; /* SATA PHY speed limit */
|
||||
|
||||
/* record runtime error info, protected by host_set lock */
|
||||
/* record runtime error info, protected by host lock */
|
||||
struct ata_eh_info eh_info;
|
||||
/* EH context owned by EH */
|
||||
struct ata_eh_context eh_context;
|
||||
|
|
@ -538,8 +559,8 @@ struct ata_port {
|
|||
unsigned int active_tag;
|
||||
u32 sactive;
|
||||
|
||||
struct ata_host_stats stats;
|
||||
struct ata_host_set *host_set;
|
||||
struct ata_port_stats stats;
|
||||
struct ata_host *host;
|
||||
struct device *dev;
|
||||
|
||||
struct work_struct port_task;
|
||||
|
|
@ -615,7 +636,7 @@ struct ata_port_operations {
|
|||
int (*port_start) (struct ata_port *ap);
|
||||
void (*port_stop) (struct ata_port *ap);
|
||||
|
||||
void (*host_stop) (struct ata_host_set *host_set);
|
||||
void (*host_stop) (struct ata_host *host);
|
||||
|
||||
void (*bmdma_stop) (struct ata_queued_cmd *qc);
|
||||
u8 (*bmdma_status) (struct ata_port *ap);
|
||||
|
|
@ -623,7 +644,7 @@ struct ata_port_operations {
|
|||
|
||||
struct ata_port_info {
|
||||
struct scsi_host_template *sht;
|
||||
unsigned long host_flags;
|
||||
unsigned long flags;
|
||||
unsigned long pio_mask;
|
||||
unsigned long mwdma_mask;
|
||||
unsigned long udma_mask;
|
||||
|
|
@ -649,6 +670,8 @@ extern const unsigned long sata_deb_timing_normal[];
|
|||
extern const unsigned long sata_deb_timing_hotplug[];
|
||||
extern const unsigned long sata_deb_timing_long[];
|
||||
|
||||
extern const struct ata_port_operations ata_dummy_port_ops;
|
||||
|
||||
static inline const unsigned long *
|
||||
sata_ehc_deb_timing(struct ata_eh_context *ehc)
|
||||
{
|
||||
|
|
@ -658,6 +681,11 @@ sata_ehc_deb_timing(struct ata_eh_context *ehc)
|
|||
return sata_deb_timing_normal;
|
||||
}
|
||||
|
||||
static inline int ata_port_is_dummy(struct ata_port *ap)
|
||||
{
|
||||
return ap->ops == &ata_dummy_port_ops;
|
||||
}
|
||||
|
||||
extern void ata_port_probe(struct ata_port *);
|
||||
extern void __sata_phy_reset(struct ata_port *ap);
|
||||
extern void sata_phy_reset(struct ata_port *ap);
|
||||
|
|
@ -676,19 +704,30 @@ extern void ata_std_ports(struct ata_ioports *ioaddr);
|
|||
extern int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_info,
|
||||
unsigned int n_ports);
|
||||
extern void ata_pci_remove_one (struct pci_dev *pdev);
|
||||
extern void ata_pci_device_do_suspend(struct pci_dev *pdev, pm_message_t state);
|
||||
extern void ata_pci_device_do_suspend(struct pci_dev *pdev, pm_message_t mesg);
|
||||
extern void ata_pci_device_do_resume(struct pci_dev *pdev);
|
||||
extern int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t state);
|
||||
extern int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg);
|
||||
extern int ata_pci_device_resume(struct pci_dev *pdev);
|
||||
extern int ata_pci_clear_simplex(struct pci_dev *pdev);
|
||||
#endif /* CONFIG_PCI */
|
||||
extern int ata_device_add(const struct ata_probe_ent *ent);
|
||||
extern void ata_port_detach(struct ata_port *ap);
|
||||
extern void ata_host_set_remove(struct ata_host_set *host_set);
|
||||
extern void ata_host_init(struct ata_host *, struct device *,
|
||||
unsigned long, const struct ata_port_operations *);
|
||||
extern void ata_host_remove(struct ata_host *host);
|
||||
extern int ata_scsi_detect(struct scsi_host_template *sht);
|
||||
extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg);
|
||||
extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *));
|
||||
extern int ata_scsi_release(struct Scsi_Host *host);
|
||||
extern void ata_sas_port_destroy(struct ata_port *);
|
||||
extern struct ata_port *ata_sas_port_alloc(struct ata_host *,
|
||||
struct ata_port_info *, struct Scsi_Host *);
|
||||
extern int ata_sas_port_init(struct ata_port *);
|
||||
extern int ata_sas_port_start(struct ata_port *ap);
|
||||
extern void ata_sas_port_stop(struct ata_port *ap);
|
||||
extern int ata_sas_slave_configure(struct scsi_device *, struct ata_port *);
|
||||
extern int ata_sas_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *),
|
||||
struct ata_port *ap);
|
||||
extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc);
|
||||
extern int sata_scr_valid(struct ata_port *ap);
|
||||
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);
|
|||
extern int ata_port_online(struct ata_port *ap);
|
||||
extern int ata_port_offline(struct ata_port *ap);
|
||||
extern int ata_scsi_device_resume(struct scsi_device *);
|
||||
extern int ata_scsi_device_suspend(struct scsi_device *, pm_message_t state);
|
||||
extern int ata_host_set_suspend(struct ata_host_set *host_set,
|
||||
pm_message_t mesg);
|
||||
extern void ata_host_set_resume(struct ata_host_set *host_set);
|
||||
extern int ata_scsi_device_suspend(struct scsi_device *, pm_message_t mesg);
|
||||
extern int ata_host_suspend(struct ata_host *host, pm_message_t mesg);
|
||||
extern void ata_host_resume(struct ata_host *host);
|
||||
extern int ata_ratelimit(void);
|
||||
extern unsigned int ata_busy_sleep(struct ata_port *ap,
|
||||
unsigned long timeout_pat,
|
||||
|
|
@ -725,7 +763,7 @@ extern u8 ata_altstatus(struct ata_port *ap);
|
|||
extern void ata_exec_command(struct ata_port *ap, const struct ata_taskfile *tf);
|
||||
extern int ata_port_start (struct ata_port *ap);
|
||||
extern void ata_port_stop (struct ata_port *ap);
|
||||
extern void ata_host_stop (struct ata_host_set *host_set);
|
||||
extern void ata_host_stop (struct ata_host *host);
|
||||
extern irqreturn_t ata_interrupt (int irq, void *dev_instance, struct pt_regs *regs);
|
||||
extern void ata_mmio_data_xfer(struct ata_device *adev, unsigned char *buf,
|
||||
unsigned int buflen, int write_data);
|
||||
|
|
@ -811,7 +849,7 @@ struct pci_bits {
|
|||
unsigned long val;
|
||||
};
|
||||
|
||||
extern void ata_pci_host_stop (struct ata_host_set *host_set);
|
||||
extern void ata_pci_host_stop (struct ata_host *host);
|
||||
extern struct ata_probe_ent *
|
||||
ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int portmask);
|
||||
extern int pci_test_config_bits(struct pci_dev *pdev, const struct pci_bits *bits);
|
||||
|
|
|
|||
|
|
@ -35,9 +35,13 @@
|
|||
#endif
|
||||
|
||||
#define KPROBE_ENTRY(name) \
|
||||
.section .kprobes.text, "ax"; \
|
||||
.pushsection .kprobes.text, "ax"; \
|
||||
ENTRY(name)
|
||||
|
||||
#define KPROBE_END(name) \
|
||||
END(name); \
|
||||
.popsection
|
||||
|
||||
#ifndef END
|
||||
#define END(name) \
|
||||
.size name, .-name
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ static inline void INIT_LIST_HEAD(struct list_head *list)
|
|||
* This is only for internal list manipulation where we know
|
||||
* the prev/next entries already!
|
||||
*/
|
||||
#ifndef CONFIG_DEBUG_LIST
|
||||
static inline void __list_add(struct list_head *new,
|
||||
struct list_head *prev,
|
||||
struct list_head *next)
|
||||
|
|
@ -48,6 +49,11 @@ static inline void __list_add(struct list_head *new,
|
|||
new->prev = prev;
|
||||
prev->next = new;
|
||||
}
|
||||
#else
|
||||
extern void __list_add(struct list_head *new,
|
||||
struct list_head *prev,
|
||||
struct list_head *next);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* list_add - add a new entry
|
||||
|
|
@ -57,10 +63,15 @@ static inline void __list_add(struct list_head *new,
|
|||
* Insert a new entry after the specified head.
|
||||
* This is good for implementing stacks.
|
||||
*/
|
||||
#ifndef CONFIG_DEBUG_LIST
|
||||
static inline void list_add(struct list_head *new, struct list_head *head)
|
||||
{
|
||||
__list_add(new, head, head->next);
|
||||
}
|
||||
#else
|
||||
extern void list_add(struct list_head *new, struct list_head *head);
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* list_add_tail - add a new entry
|
||||
|
|
@ -153,12 +164,16 @@ static inline void __list_del(struct list_head * prev, struct list_head * next)
|
|||
* Note: list_empty on entry does not return true after this, the entry is
|
||||
* in an undefined state.
|
||||
*/
|
||||
#ifndef CONFIG_DEBUG_LIST
|
||||
static inline void list_del(struct list_head *entry)
|
||||
{
|
||||
__list_del(entry->prev, entry->next);
|
||||
entry->next = LIST_POISON1;
|
||||
entry->prev = LIST_POISON2;
|
||||
}
|
||||
#else
|
||||
extern void list_del(struct list_head *entry);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* list_del_rcu - deletes entry from list without re-initialization
|
||||
|
|
|
|||
|
|
@ -8,13 +8,13 @@
|
|||
#ifndef __LINUX_LOCKDEP_H
|
||||
#define __LINUX_LOCKDEP_H
|
||||
|
||||
#ifdef CONFIG_LOCKDEP
|
||||
|
||||
#include <linux/linkage.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/debug_locks.h>
|
||||
#include <linux/stacktrace.h>
|
||||
|
||||
#ifdef CONFIG_LOCKDEP
|
||||
|
||||
/*
|
||||
* Lock-class usage-state bits:
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -59,10 +59,9 @@ struct loop_device {
|
|||
struct bio *lo_bio;
|
||||
struct bio *lo_biotail;
|
||||
int lo_state;
|
||||
struct completion lo_done;
|
||||
struct completion lo_bh_done;
|
||||
struct mutex lo_ctl_mutex;
|
||||
int lo_pending;
|
||||
struct task_struct *lo_thread;
|
||||
wait_queue_head_t lo_event;
|
||||
|
||||
request_queue_t *lo_queue;
|
||||
};
|
||||
|
|
|
|||
37
include/linux/magic.h
Normal file
37
include/linux/magic.h
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
#ifndef __LINUX_MAGIC_H__
|
||||
#define __LINUX_MAGIC_H__
|
||||
|
||||
#define ADFS_SUPER_MAGIC 0xadf5
|
||||
#define AFFS_SUPER_MAGIC 0xadff
|
||||
#define AUTOFS_SUPER_MAGIC 0x0187
|
||||
#define CODA_SUPER_MAGIC 0x73757245
|
||||
#define EFS_SUPER_MAGIC 0x414A53
|
||||
#define EXT2_SUPER_MAGIC 0xEF53
|
||||
#define EXT3_SUPER_MAGIC 0xEF53
|
||||
#define HPFS_SUPER_MAGIC 0xf995e849
|
||||
#define ISOFS_SUPER_MAGIC 0x9660
|
||||
#define JFFS2_SUPER_MAGIC 0x72b6
|
||||
|
||||
#define MINIX_SUPER_MAGIC 0x137F /* original minix fs */
|
||||
#define MINIX_SUPER_MAGIC2 0x138F /* minix fs, 30 char names */
|
||||
#define MINIX2_SUPER_MAGIC 0x2468 /* minix V2 fs */
|
||||
#define MINIX2_SUPER_MAGIC2 0x2478 /* minix V2 fs, 30 char names */
|
||||
|
||||
#define MSDOS_SUPER_MAGIC 0x4d44 /* MD */
|
||||
#define NCP_SUPER_MAGIC 0x564c /* Guess, what 0x564c is :-) */
|
||||
#define NFS_SUPER_MAGIC 0x6969
|
||||
#define OPENPROM_SUPER_MAGIC 0x9fa1
|
||||
#define PROC_SUPER_MAGIC 0x9fa0
|
||||
#define QNX4_SUPER_MAGIC 0x002f /* qnx4 fs detection */
|
||||
|
||||
#define REISERFS_SUPER_MAGIC 0x52654973 /* used by gcc */
|
||||
/* used by file system utilities that
|
||||
look at the superblock, etc. */
|
||||
#define REISERFS_SUPER_MAGIC_STRING "ReIsErFs"
|
||||
#define REISER2FS_SUPER_MAGIC_STRING "ReIsEr2Fs"
|
||||
#define REISER2FS_JR_SUPER_MAGIC_STRING "ReIsEr3Fs"
|
||||
|
||||
#define SMB_SUPER_MAGIC 0x517B
|
||||
#define USBDEVICE_SUPER_MAGIC 0x9fa2
|
||||
|
||||
#endif /* __LINUX_MAGIC_H__ */
|
||||
|
|
@ -57,7 +57,7 @@ struct memory_block {
|
|||
struct notifier_block;
|
||||
struct mem_section;
|
||||
|
||||
#ifndef CONFIG_MEMORY_HOTPLUG
|
||||
#ifndef CONFIG_MEMORY_HOTPLUG_SPARSE
|
||||
static inline int memory_dev_init(void)
|
||||
{
|
||||
return 0;
|
||||
|
|
@ -78,7 +78,7 @@ extern int remove_memory_block(unsigned long, struct mem_section *, int);
|
|||
#define CONFIG_MEM_BLOCK_SIZE (PAGES_PER_SECTION<<PAGE_SHIFT)
|
||||
|
||||
|
||||
#endif /* CONFIG_MEMORY_HOTPLUG */
|
||||
#endif /* CONFIG_MEMORY_HOTPLUG_SPARSE */
|
||||
|
||||
#define hotplug_memory_notifier(fn, pri) { \
|
||||
static struct notifier_block fn##_mem_nb = \
|
||||
|
|
|
|||
|
|
@ -172,5 +172,7 @@ static inline int __remove_pages(struct zone *zone, unsigned long start_pfn,
|
|||
extern int add_memory(int nid, u64 start, u64 size);
|
||||
extern int arch_add_memory(int nid, u64 start, u64 size);
|
||||
extern int remove_memory(u64 start, u64 size);
|
||||
extern int sparse_add_one_section(struct zone *zone, unsigned long start_pfn,
|
||||
int nr_pages);
|
||||
|
||||
#endif /* __LINUX_MEMORY_HOTPLUG_H */
|
||||
|
|
|
|||
|
|
@ -162,9 +162,9 @@ extern struct zonelist *huge_zonelist(struct vm_area_struct *vma,
|
|||
unsigned long addr);
|
||||
extern unsigned slab_node(struct mempolicy *policy);
|
||||
|
||||
extern int policy_zone;
|
||||
extern enum zone_type policy_zone;
|
||||
|
||||
static inline void check_highest_zone(int k)
|
||||
static inline void check_highest_zone(enum zone_type k)
|
||||
{
|
||||
if (k > policy_zone)
|
||||
policy_zone = k;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
#ifndef _LINUX_MINIX_FS_H
|
||||
#define _LINUX_MINIX_FS_H
|
||||
|
||||
#include <linux/magic.h>
|
||||
|
||||
/*
|
||||
* The minix filesystem constants/structures
|
||||
*/
|
||||
|
|
@ -19,10 +21,6 @@
|
|||
|
||||
#define MINIX_I_MAP_SLOTS 8
|
||||
#define MINIX_Z_MAP_SLOTS 64
|
||||
#define MINIX_SUPER_MAGIC 0x137F /* original minix fs */
|
||||
#define MINIX_SUPER_MAGIC2 0x138F /* minix fs, 30 char names */
|
||||
#define MINIX2_SUPER_MAGIC 0x2468 /* minix V2 fs */
|
||||
#define MINIX2_SUPER_MAGIC2 0x2478 /* minix V2 fs, 30 char names */
|
||||
#define MINIX_VALID_FS 0x0001 /* Clean fs. */
|
||||
#define MINIX_ERROR_FS 0x0002 /* fs has errors. */
|
||||
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue