Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 9281
b: refs/heads/master
c: 2ead1aa
h: refs/heads/master
i:
  9279: c80ef7c
v: v3
  • Loading branch information
Linus Torvalds committed Sep 23, 2005
1 parent 67e5ab6 commit a5bfa7e
Show file tree
Hide file tree
Showing 105 changed files with 2,457 additions and 674 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c8868611389aa28e0e5e0d63f468727781eac68c
refs/heads/master: 2ead1aa6f14ed542af0c9e2302a51ea02128f587
73 changes: 73 additions & 0 deletions trunk/Documentation/device-mapper/snapshot.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
Device-mapper snapshot support
==============================

Device-mapper allows you, without massive data copying:

*) To create snapshots of any block device i.e. mountable, saved states of
the block device which are also writable without interfering with the
original content;
*) To create device "forks", i.e. multiple different versions of the
same data stream.


In both cases, dm copies only the chunks of data that get changed and
uses a separate copy-on-write (COW) block device for storage.


There are two dm targets available: snapshot and snapshot-origin.

*) snapshot-origin <origin>

which will normally have one or more snapshots based on it.
You must create the snapshot-origin device before you can create snapshots.
Reads will be mapped directly to the backing device. For each write, the
original data will be saved in the <COW device> of each snapshot to keep
its visible content unchanged, at least until the <COW device> fills up.


*) snapshot <origin> <COW device> <persistent?> <chunksize>

A snapshot is created of the <origin> block device. Changed chunks of
<chunksize> sectors will be stored on the <COW device>. Writes will
only go to the <COW device>. Reads will come from the <COW device> or
from <origin> for unchanged data. <COW device> will often be
smaller than the origin and if it fills up the snapshot will become
useless and be disabled, returning errors. So it is important to monitor
the amount of free space and expand the <COW device> before it fills up.

<persistent?> is P (Persistent) or N (Not persistent - will not survive
after reboot).


How this is used by LVM2
========================
When you create the first LVM2 snapshot of a volume, four dm devices are used:

1) a device containing the original mapping table of the source volume;
2) a device used as the <COW device>;
3) a "snapshot" device, combining #1 and #2, which is the visible snapshot
volume;
4) the "original" volume (which uses the device number used by the original
source volume), whose table is replaced by a "snapshot-origin" mapping
from device #1.

A fixed naming scheme is used, so with the following commands:

lvcreate -L 1G -n base volumeGroup
lvcreate -L 100M --snapshot -n snap volumeGroup/base

we'll have this situation (with volumes in above order):

# dmsetup table|grep volumeGroup

volumeGroup-base-real: 0 2097152 linear 8:19 384
volumeGroup-snap-cow: 0 204800 linear 8:19 2097536
volumeGroup-snap: 0 2097152 snapshot 254:11 254:12 P 16
volumeGroup-base: 0 2097152 snapshot-origin 254:11

# ls -lL /dev/mapper/volumeGroup-*
brw------- 1 root root 254, 11 29 ago 18:15 /dev/mapper/volumeGroup-base-real
brw------- 1 root root 254, 12 29 ago 18:15 /dev/mapper/volumeGroup-snap-cow
brw------- 1 root root 254, 13 29 ago 18:15 /dev/mapper/volumeGroup-snap
brw------- 1 root root 254, 10 29 ago 18:14 /dev/mapper/volumeGroup-base

4 changes: 2 additions & 2 deletions trunk/Documentation/sparse.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ or you don't get any checking at all.
Where to get sparse
~~~~~~~~~~~~~~~~~~~

With BK, you can just get it from
With git, you can just get it from

bk://sparse.bkbits.net/sparse
rsync://rsync.kernel.org/pub/scm/devel/sparse/sparse.git

and DaveJ has tar-balls at

Expand Down
12 changes: 12 additions & 0 deletions trunk/MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -1402,6 +1402,18 @@ L: linux-kernel@vger.kernel.org
L: fastboot@osdl.org
S: Maintained

KPROBES
P: Prasanna S Panchamukhi
M: prasanna@in.ibm.com
P: Ananth N Mavinakayanahalli
M: ananth@in.ibm.com
P: Anil S Keshavamurthy
M: anil.s.keshavamurthy@intel.com
P: David S. Miller
M: davem@davemloft.net
L: linux-kernel@vger.kernel.org
S: Maintained

LANMEDIA WAN CARD DRIVER
P: Andrew Stanley-Jones
M: asj@lanmedia.com
Expand Down
8 changes: 4 additions & 4 deletions trunk/README
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ CONFIGURING the kernel:
your existing ./.config file.
"make silentoldconfig"
Like above, but avoids cluttering the screen
with question already answered.
with questions already answered.

NOTES on "make config":
- having unnecessary drivers will make the kernel bigger, and can
Expand Down Expand Up @@ -199,9 +199,9 @@ COMPILING the kernel:
are installing a new kernel with the same version number as your
working kernel, make a backup of your modules directory before you
do a "make modules_install".
In alternative, before compiling, edit your Makefile and change the
"EXTRAVERSION" line - its content is appended to the regular kernel
version.
Alternatively, before compiling, use the kernel config option
"LOCALVERSION" to append a unique suffix to the regular kernel version.
LOCALVERSION can be set in the "General Setup" menu.

- In order to boot your new kernel, you'll need to copy the kernel
image (e.g. .../linux/arch/i386/boot/bzImage after compilation)
Expand Down
4 changes: 4 additions & 0 deletions trunk/arch/alpha/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ common_shutdown_1(void *generic_ptr)
/* If booted from SRM, reset some of the original environment. */
if (alpha_using_srm) {
#ifdef CONFIG_DUMMY_CONSOLE
/* If we've gotten here after SysRq-b, leave interrupt
context before taking over the console. */
if (in_interrupt())
irq_exit();
/* This has the effect of resetting the VGA video origin. */
take_over_console(&dummy_con, 0, MAX_NR_CONSOLES-1, 1);
#endif
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/arm/kernel/entry-armv.S
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ ENTRY(__switch_to)
#ifdef CONFIG_CPU_MPCORE
clrex
#else
strex r3, r4, [ip] @ Clear exclusive monitor
strex r5, r4, [ip] @ Clear exclusive monitor
#endif
#endif
#if defined(CONFIG_CPU_XSCALE) && !defined(CONFIG_IWMMXT)
Expand Down
29 changes: 23 additions & 6 deletions trunk/arch/ia64/hp/sim/simscsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,13 +233,31 @@ simscsi_readwrite10 (struct scsi_cmnd *sc, int mode)
simscsi_readwrite(sc, mode, offset, ((sc->cmnd[7] << 8) | sc->cmnd[8])*512);
}

static void simscsi_fillresult(struct scsi_cmnd *sc, char *buf, unsigned len)
{

int scatterlen = sc->use_sg;
struct scatterlist *slp;

if (scatterlen == 0)
memcpy(sc->request_buffer, buf, len);
else for (slp = (struct scatterlist *)sc->buffer; scatterlen-- > 0 && len > 0; slp++) {
unsigned thislen = min(len, slp->length);

memcpy(page_address(slp->page) + slp->offset, buf, thislen);
slp++;
len -= thislen;
}
}

static int
simscsi_queuecommand (struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *))
{
unsigned int target_id = sc->device->id;
char fname[MAX_ROOT_LEN+16];
size_t disk_size;
char *buf;
char localbuf[36];
#if DEBUG_SIMSCSI
register long sp asm ("sp");

Expand All @@ -263,7 +281,7 @@ simscsi_queuecommand (struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *))
/* disk doesn't exist... */
break;
}
buf = sc->request_buffer;
buf = localbuf;
buf[0] = 0; /* magnetic disk */
buf[1] = 0; /* not a removable medium */
buf[2] = 2; /* SCSI-2 compliant device */
Expand All @@ -273,6 +291,7 @@ simscsi_queuecommand (struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *))
buf[6] = 0; /* reserved */
buf[7] = 0; /* various flags */
memcpy(buf + 8, "HP SIMULATED DISK 0.00", 28);
simscsi_fillresult(sc, buf, 36);
sc->result = GOOD;
break;

Expand Down Expand Up @@ -304,16 +323,13 @@ simscsi_queuecommand (struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *))
simscsi_readwrite10(sc, SSC_WRITE);
break;


case READ_CAPACITY:
if (desc[target_id] < 0 || sc->request_bufflen < 8) {
break;
}
buf = sc->request_buffer;

buf = localbuf;
disk_size = simscsi_get_disk_size(desc[target_id]);

/* pretend to be a 1GB disk (partition table contains real stuff): */
buf[0] = (disk_size >> 24) & 0xff;
buf[1] = (disk_size >> 16) & 0xff;
buf[2] = (disk_size >> 8) & 0xff;
Expand All @@ -323,13 +339,14 @@ simscsi_queuecommand (struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *))
buf[5] = 0;
buf[6] = 2;
buf[7] = 0;
simscsi_fillresult(sc, buf, 8);
sc->result = GOOD;
break;

case MODE_SENSE:
case MODE_SENSE_10:
/* sd.c uses this to determine whether disk does write-caching. */
memset(sc->request_buffer, 0, 128);
simscsi_fillresult(sc, (char *)empty_zero_page, sc->request_bufflen);
sc->result = GOOD;
break;

Expand Down
96 changes: 85 additions & 11 deletions trunk/arch/ia64/kernel/mca_asm.S
Original file line number Diff line number Diff line change
Expand Up @@ -489,24 +489,27 @@ ia64_state_save:
;;
st8 [temp1]=r17,16 // pal_min_state
st8 [temp2]=r6,16 // prev_IA64_KR_CURRENT
mov r6=IA64_KR(CURRENT_STACK)
;;
st8 [temp1]=r6,16 // prev_IA64_KR_CURRENT_STACK
st8 [temp2]=r0,16 // prev_task, starts off as NULL
mov r6=cr.ifa
;;
st8 [temp1]=r0,16 // prev_task, starts off as NULL
st8 [temp2]=r12,16 // cr.isr
st8 [temp1]=r12,16 // cr.isr
st8 [temp2]=r6,16 // cr.ifa
mov r12=cr.itir
;;
st8 [temp1]=r6,16 // cr.ifa
st8 [temp2]=r12,16 // cr.itir
st8 [temp1]=r12,16 // cr.itir
st8 [temp2]=r11,16 // cr.iipa
mov r12=cr.iim
;;
st8 [temp1]=r11,16 // cr.iipa
st8 [temp2]=r12,16 // cr.iim
mov r6=cr.iha
st8 [temp1]=r12,16 // cr.iim
(p1) mov r12=IA64_MCA_COLD_BOOT
(p2) mov r12=IA64_INIT_WARM_BOOT
mov r6=cr.iha
;;
st8 [temp1]=r6,16 // cr.iha
st8 [temp2]=r12 // os_status, default is cold boot
st8 [temp2]=r6,16 // cr.iha
st8 [temp1]=r12 // os_status, default is cold boot
mov r6=IA64_MCA_SAME_CONTEXT
;;
st8 [temp1]=r6 // context, default is same context
Expand Down Expand Up @@ -823,9 +826,12 @@ ia64_state_restore:
ld8 r12=[temp1],16 // sal_ra
ld8 r9=[temp2],16 // sal_gp
;;
ld8 r22=[temp1],24 // pal_min_state, virtual. skip prev_task
ld8 r22=[temp1],16 // pal_min_state, virtual
ld8 r21=[temp2],16 // prev_IA64_KR_CURRENT
;;
ld8 r16=[temp1],16 // prev_IA64_KR_CURRENT_STACK
ld8 r20=[temp2],16 // prev_task
;;
ld8 temp3=[temp1],16 // cr.isr
ld8 temp4=[temp2],16 // cr.ifa
;;
Expand All @@ -846,6 +852,45 @@ ia64_state_restore:
ld8 r8=[temp1] // os_status
ld8 r10=[temp2] // context

/* Wire IA64_TR_CURRENT_STACK to the stack that we are resuming to. To
* avoid any dependencies on the algorithm in ia64_switch_to(), just
* purge any existing CURRENT_STACK mapping and insert the new one.
*
* r16 contains prev_IA64_KR_CURRENT_STACK, r21 contains
* prev_IA64_KR_CURRENT, these values may have been changed by the C
* code. Do not use r8, r9, r10, r22, they contain values ready for
* the return to SAL.
*/

mov r15=IA64_KR(CURRENT_STACK) // physical granule mapped by IA64_TR_CURRENT_STACK
;;
shl r15=r15,IA64_GRANULE_SHIFT
;;
dep r15=-1,r15,61,3 // virtual granule
mov r18=IA64_GRANULE_SHIFT<<2 // for cr.itir.ps
;;
ptr.d r15,r18
;;
srlz.d

extr.u r19=r21,61,3 // r21 = prev_IA64_KR_CURRENT
shl r20=r16,IA64_GRANULE_SHIFT // r16 = prev_IA64_KR_CURRENT_STACK
movl r21=PAGE_KERNEL // page properties
;;
mov IA64_KR(CURRENT_STACK)=r16
cmp.ne p6,p0=RGN_KERNEL,r19 // new stack is in the kernel region?
or r21=r20,r21 // construct PA | page properties
(p6) br.spnt 1f // the dreaded cpu 0 idle task in region 5:(
;;
mov cr.itir=r18
mov cr.ifa=r21
mov r20=IA64_TR_CURRENT_STACK
;;
itr.d dtr[r20]=r21
;;
srlz.d
1:

br.sptk b0

//EndStub//////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -982,6 +1027,7 @@ ia64_set_kernel_registers:
add temp4=temp4, temp1 // &struct ia64_sal_os_state.os_gp
add r12=temp1, temp3 // kernel stack pointer on MCA/INIT stack
add r13=temp1, r3 // set current to start of MCA/INIT stack
add r20=temp1, r3 // physical start of MCA/INIT stack
;;
ld8 r1=[temp4] // OS GP from SAL OS state
;;
Expand All @@ -991,7 +1037,35 @@ ia64_set_kernel_registers:
;;
mov IA64_KR(CURRENT)=r13

// FIXME: do I need to wire IA64_KR_CURRENT_STACK and IA64_TR_CURRENT_STACK?
/* Wire IA64_TR_CURRENT_STACK to the MCA/INIT handler stack. To avoid
* any dependencies on the algorithm in ia64_switch_to(), just purge
* any existing CURRENT_STACK mapping and insert the new one.
*/

mov r16=IA64_KR(CURRENT_STACK) // physical granule mapped by IA64_TR_CURRENT_STACK
;;
shl r16=r16,IA64_GRANULE_SHIFT
;;
dep r16=-1,r16,61,3 // virtual granule
mov r18=IA64_GRANULE_SHIFT<<2 // for cr.itir.ps
;;
ptr.d r16,r18
;;
srlz.d

shr.u r16=r20,IA64_GRANULE_SHIFT // r20 = physical start of MCA/INIT stack
movl r21=PAGE_KERNEL // page properties
;;
mov IA64_KR(CURRENT_STACK)=r16
or r21=r20,r21 // construct PA | page properties
;;
mov cr.itir=r18
mov cr.ifa=r13
mov r20=IA64_TR_CURRENT_STACK
;;
itr.d dtr[r20]=r21
;;
srlz.d

br.sptk b0

Expand Down
Loading

0 comments on commit a5bfa7e

Please sign in to comment.