Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
baf1aaad
Commit
baf1aaad
authored
Mar 14, 2003
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
820783a6
95803d5a
Changes
37
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
37 changed files
with
1879 additions
and
1013 deletions
+1879
-1013
Documentation/hw_random.txt
Documentation/hw_random.txt
+0
-0
Documentation/md.txt
Documentation/md.txt
+64
-4
arch/i386/kernel/cpu/centaur.c
arch/i386/kernel/cpu/centaur.c
+32
-15
arch/i386/kernel/cpu/common.c
arch/i386/kernel/cpu/common.c
+3
-2
arch/i386/kernel/cpu/proc.c
arch/i386/kernel/cpu/proc.c
+14
-1
drivers/base/platform.c
drivers/base/platform.c
+1
-0
drivers/char/Kconfig
drivers/char/Kconfig
+6
-25
drivers/char/Makefile
drivers/char/Makefile
+1
-2
drivers/char/amd768_rng.c
drivers/char/amd768_rng.c
+0
-295
drivers/char/hw_random.c
drivers/char/hw_random.c
+630
-0
drivers/i2c/i2c-core.c
drivers/i2c/i2c-core.c
+97
-84
drivers/i2c/i2c-proc.c
drivers/i2c/i2c-proc.c
+80
-100
drivers/md/linear.c
drivers/md/linear.c
+8
-10
drivers/md/md.c
drivers/md/md.c
+666
-289
drivers/md/multipath.c
drivers/md/multipath.c
+12
-14
drivers/md/raid0.c
drivers/md/raid0.c
+13
-14
drivers/md/raid1.c
drivers/md/raid1.c
+23
-27
drivers/md/raid5.c
drivers/md/raid5.c
+26
-30
fs/lockd/svclock.c
fs/lockd/svclock.c
+6
-2
fs/nfsd/export.c
fs/nfsd/export.c
+12
-3
fs/nfsd/vfs.c
fs/nfsd/vfs.c
+19
-3
fs/reiserfs/journal.c
fs/reiserfs/journal.c
+36
-40
include/asm-generic/xor.h
include/asm-generic/xor.h
+20
-20
include/asm-i386/cpufeature.h
include/asm-i386/cpufeature.h
+8
-2
include/asm-i386/msr.h
include/asm-i386/msr.h
+1
-0
include/asm-i386/xor.h
include/asm-i386/xor.h
+1
-0
include/linux/bio.h
include/linux/bio.h
+0
-1
include/linux/nfsd/export.h
include/linux/nfsd/export.h
+4
-3
include/linux/raid/md.h
include/linux/raid/md.h
+5
-3
include/linux/raid/md_k.h
include/linux/raid/md_k.h
+24
-12
include/linux/raid/md_p.h
include/linux/raid/md_p.h
+53
-0
include/linux/raid/multipath.h
include/linux/raid/multipath.h
+0
-1
include/linux/raid/raid1.h
include/linux/raid/raid1.h
+0
-2
include/linux/raid/raid5.h
include/linux/raid/raid5.h
+0
-2
include/linux/sunrpc/cache.h
include/linux/sunrpc/cache.h
+1
-0
net/sunrpc/svcauth_unix.c
net/sunrpc/svcauth_unix.c
+6
-4
net/sunrpc/svcsock.c
net/sunrpc/svcsock.c
+7
-3
No files found.
Documentation/
i810_rng
.txt
→
Documentation/
hw_random
.txt
View file @
baf1aaad
File moved
Documentation/md.txt
View file @
baf1aaad
Tools that manage md devices can be found at
Tools that manage md devices can be found at
http://www.<country>.kernel.org/pub/linux/
daemon
s/raid/....
http://www.<country>.kernel.org/pub/linux/
util
s/raid/....
You can boot
(if you selected boot support in the configuration) with your md
You can boot
with your md device with the following kernel command
device with the following kernel command
lines:
lines:
for old raid arrays without persistent superblocks:
for old raid arrays without persistent superblocks:
md=<md device no.>,<raid level>,<chunk size factor>,<fault level>,dev0,dev1,...,devn
md=<md device no.>,<raid level>,<chunk size factor>,<fault level>,dev0,dev1,...,devn
...
@@ -33,4 +33,64 @@ dev0-devn: e.g. /dev/hda1,/dev/hdc1,/dev/sda1,/dev/sdb1
...
@@ -33,4 +33,64 @@ dev0-devn: e.g. /dev/hda1,/dev/hdc1,/dev/sda1,/dev/sdb1
A possible loadlin line (Harald Hoyer <HarryH@Royal.Net>) looks like this:
A possible loadlin line (Harald Hoyer <HarryH@Royal.Net>) looks like this:
e:\loadlin\loadlin e:\zimage root=/dev/md0 md=0,0,4,0,/dev/hdb2,/dev/hdc3 ro
e:\loadlin\loadlin e:\zimage root=/dev/md0 md=0,0,4,0,/dev/hdb2,/dev/hdc3 ro
-------------------------------
The md driver can support a variety of different superblock formats.
(It doesn't yet, but it can)
The kernel does *NOT* autodetect which format superblock is being
used. It must be told.
Superblock format '0' is treated differently to others for legacy
reasons.
General Rules - apply for all superblock formats
------------------------------------------------
An array is 'created' by writing appropriate superblocks to all
devices.
It is 'assembled' by associating each of these devices with an
particular md virtual device. Once it is completely assembled, it can
be accessed.
An array should be created by a user-space tool. This will write
superblocks to all devices. It will usually mark the array as
'unclean', or with some devices missing so that the kernel md driver
can create approrpriate redundancy (copying in raid1, parity
calculation in raid4/5).
When an array is assembled, it is first initialised with the
SET_ARRAY_INFO ioctl. This contains, in particular, a major and minor
version number. The major version number selects which superblock
format is to be used. The minor number might be used to tune handling
of the format, such as suggesting where on each device to look for the
superblock.
Then each device is added using the ADD_NEW_DISK ioctl. This
provides, in particular, a major and minor number identifying the
device to add.
The array is started with the RUN_ARRAY ioctl.
Once started, new devices can be added. They should have an
appropriate superblock written to them, and then passed be in with
ADD_NEW_DISK.
Devices that have failed or are not yet active can be detached from an
array using HOT_REMOVE_DISK.
Specific Rules that apply to format-0 super block arrays, and
arrays with no superblock (non-presistant).
-------------------------------------------------------------
An array can be 'created' by describing the array (level, chunksize
etc) in a SET_ARRAY_INFO ioctl. This must has major_version==0 and
raid_disks != 0.
Then uninitialised devices can be added with ADD_NEW_DISK. The
structure passed to ADD_NEW_DISK must specify the state of the device
and it's role in the array.
One started with RUN_ARRAY, uninitialised spares can be added with
HOT_ADD_DISK.
arch/i386/kernel/cpu/centaur.c
View file @
baf1aaad
...
@@ -248,6 +248,37 @@ static void __init winchip2_protect_mcr(void)
...
@@ -248,6 +248,37 @@ static void __init winchip2_protect_mcr(void)
}
}
#endif
#endif
static
void
__init
init_c3
(
struct
cpuinfo_x86
*
c
)
{
u32
lo
,
hi
;
/* Test for Centaur Extended Feature Flags presence */
if
(
cpuid_eax
(
0xC0000000
)
>=
0xC0000001
)
{
/* store Centaur Extended Feature Flags as
* word 5 of the CPU capability bit array
*/
c
->
x86_capability
[
5
]
=
cpuid_edx
(
0xC0000001
);
}
switch
(
c
->
x86_model
)
{
case
6
...
8
:
/* Cyrix III family */
rdmsr
(
MSR_VIA_FCR
,
lo
,
hi
);
lo
|=
(
1
<<
1
|
1
<<
7
);
/* Report CX8 & enable PGE */
wrmsr
(
MSR_VIA_FCR
,
lo
,
hi
);
set_bit
(
X86_FEATURE_CX8
,
c
->
x86_capability
);
set_bit
(
X86_FEATURE_3DNOW
,
c
->
x86_capability
);
/* fall through */
case
9
:
/* Nehemiah */
default:
get_model_name
(
c
);
display_cacheinfo
(
c
);
break
;
}
}
static
void
__init
init_centaur
(
struct
cpuinfo_x86
*
c
)
static
void
__init
init_centaur
(
struct
cpuinfo_x86
*
c
)
{
{
enum
{
enum
{
...
@@ -386,21 +417,7 @@ static void __init init_centaur(struct cpuinfo_x86 *c)
...
@@ -386,21 +417,7 @@ static void __init init_centaur(struct cpuinfo_x86 *c)
break
;
break
;
case
6
:
case
6
:
switch
(
c
->
x86_model
)
{
init_c3
(
c
);
case
6
...
8
:
/* Cyrix III family */
rdmsr
(
MSR_VIA_FCR
,
lo
,
hi
);
lo
|=
(
1
<<
1
|
1
<<
7
);
/* Report CX8 & enable PGE */
wrmsr
(
MSR_VIA_FCR
,
lo
,
hi
);
set_bit
(
X86_FEATURE_CX8
,
c
->
x86_capability
);
set_bit
(
X86_FEATURE_3DNOW
,
c
->
x86_capability
);
case
9
:
/* Nehemiah */
default:
get_model_name
(
c
);
display_cacheinfo
(
c
);
break
;
}
break
;
break
;
}
}
}
}
...
...
arch/i386/kernel/cpu/common.c
View file @
baf1aaad
...
@@ -211,9 +211,10 @@ void __init generic_identify(struct cpuinfo_x86 * c)
...
@@ -211,9 +211,10 @@ void __init generic_identify(struct cpuinfo_x86 * c)
/* Intel-defined flags: level 0x00000001 */
/* Intel-defined flags: level 0x00000001 */
if
(
c
->
cpuid_level
>=
0x00000001
)
{
if
(
c
->
cpuid_level
>=
0x00000001
)
{
u32
capability
;
u32
capability
,
excap
;
cpuid
(
0x00000001
,
&
tfms
,
&
junk
,
&
junk
,
&
capability
);
cpuid
(
0x00000001
,
&
tfms
,
&
junk
,
&
excap
,
&
capability
);
c
->
x86_capability
[
0
]
=
capability
;
c
->
x86_capability
[
0
]
=
capability
;
c
->
x86_capability
[
4
]
=
excap
;
c
->
x86
=
(
tfms
>>
8
)
&
15
;
c
->
x86
=
(
tfms
>>
8
)
&
15
;
c
->
x86_model
=
(
tfms
>>
4
)
&
15
;
c
->
x86_model
=
(
tfms
>>
4
)
&
15
;
c
->
x86_mask
=
tfms
&
15
;
c
->
x86_mask
=
tfms
&
15
;
...
...
arch/i386/kernel/cpu/proc.c
View file @
baf1aaad
...
@@ -37,7 +37,20 @@ static int show_cpuinfo(struct seq_file *m, void *v)
...
@@ -37,7 +37,20 @@ static int show_cpuinfo(struct seq_file *m, void *v)
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
/* Other (Linux-defined) */
/* Other (Linux-defined) */
"cxmmx"
,
"k6_mtrr"
,
"cyrix_arr"
,
"centaur_mcr"
,
NULL
,
NULL
,
NULL
,
NULL
,
"cxmmx"
,
"k6_mtrr"
,
"cyrix_arr"
,
"centaur_mcr"
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
/* Intel-defined (#2) */
"pni"
,
NULL
,
NULL
,
"monitor"
,
"ds_cpl"
,
NULL
,
NULL
,
NULL
,
"tm2"
,
NULL
,
"cnxt_id"
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
/* VIA/Cyrix/Centaur-defined */
NULL
,
NULL
,
"xstore"
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
...
...
drivers/base/platform.c
View file @
baf1aaad
...
@@ -76,5 +76,6 @@ int __init platform_bus_init(void)
...
@@ -76,5 +76,6 @@ int __init platform_bus_init(void)
}
}
EXPORT_SYMBOL
(
legacy_bus
);
EXPORT_SYMBOL
(
legacy_bus
);
EXPORT_SYMBOL
(
platform_bus_type
);
EXPORT_SYMBOL
(
platform_device_register
);
EXPORT_SYMBOL
(
platform_device_register
);
EXPORT_SYMBOL
(
platform_device_unregister
);
EXPORT_SYMBOL
(
platform_device_unregister
);
drivers/char/Kconfig
View file @
baf1aaad
...
@@ -709,39 +709,20 @@ config NWFLASH
...
@@ -709,39 +709,20 @@ config NWFLASH
If you're not sure, say N.
If you're not sure, say N.
config
INTEL_RNG
config
HW_RANDOM
tristate "Intel
i8x0
Random Number Generator support"
tristate "Intel
/AMD/VIA HW
Random Number Generator support"
depends on (X86 || IA64) && PCI
depends on (X86 || IA64) && PCI
---help---
---help---
This driver provides kernel-side support for the Random Number
This driver provides kernel-side support for the Random Number
Generator hardware found on Intel i8xx-based motherboards.
Generator hardware found on Intel i8xx-based motherboards,
AMD 76x-based motherboards, and Via Nehemiah CPUs.
Both a character driver, used to read() entropy data, and a timer
Provides a character driver, used to read() entropy data.
function which automatically adds entropy directly into the
kernel pool, are exported by this driver.
To compile this driver as a module ( = code which can be inserted in
To compile this driver as a module ( = code which can be inserted in
and removed from the running kernel whenever you want), say M here
and removed from the running kernel whenever you want), say M here
and read <file:Documentation/modules.txt>. The module will be called
and read <file:Documentation/modules.txt>. The module will be called
i810_rng.
hw_random.
If unsure, say N.
config AMD_RNG
tristate "AMD 768 Random Number Generator support"
depends on X86 && PCI
---help---
This driver provides kernel-side support for the Random Number
Generator hardware found on AMD 76x based motherboards.
Both a character driver, used to read() entropy data, and a timer
function which automatically adds entropy directly into the
kernel pool, are exported by this driver.
To compile this driver as a module ( = code which can be inserted in
and removed from the running kernel whenever you want), say M here
and read <file:Documentation/modules.txt>. The module will be called
amd768_rng.
If unsure, say N.
If unsure, say N.
...
...
drivers/char/Makefile
View file @
baf1aaad
...
@@ -59,8 +59,7 @@ endif
...
@@ -59,8 +59,7 @@ endif
obj-$(CONFIG_TOSHIBA)
+=
toshiba.o
obj-$(CONFIG_TOSHIBA)
+=
toshiba.o
obj-$(CONFIG_I8K)
+=
i8k.o
obj-$(CONFIG_I8K)
+=
i8k.o
obj-$(CONFIG_DS1620)
+=
ds1620.o
obj-$(CONFIG_DS1620)
+=
ds1620.o
obj-$(CONFIG_INTEL_RNG)
+=
i810_rng.o
obj-$(CONFIG_HW_RANDOM)
+=
hw_random.o
obj-$(CONFIG_AMD_RNG)
+=
amd768_rng.o
obj-$(CONFIG_QIC02_TAPE)
+=
tpqic02.o
obj-$(CONFIG_QIC02_TAPE)
+=
tpqic02.o
obj-$(CONFIG_FTAPE)
+=
ftape/
obj-$(CONFIG_FTAPE)
+=
ftape/
obj-$(CONFIG_H8)
+=
h8.o
obj-$(CONFIG_H8)
+=
h8.o
...
...
drivers/char/amd768_rng.c
deleted
100644 → 0
View file @
820783a6
/*
Hardware driver for the AMD 768 Random Number Generator (RNG)
(c) Copyright 2001 Red Hat Inc <alan@redhat.com>
derived from
Hardware driver for Intel i810 Random Number Generator (RNG)
Copyright 2000,2001 Jeff Garzik <jgarzik@pobox.com>
Copyright 2000,2001 Philipp Rumpf <prumpf@mandrakesoft.com>
Please read Documentation/i810_rng.txt for details on use.
----------------------------------------------------------
This software may be used and distributed according to the terms
of the GNU General Public License, incorporated herein by reference.
*/
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/interrupt.h>
#include <linux/spinlock.h>
#include <linux/random.h>
#include <linux/miscdevice.h>
#include <linux/smp_lock.h>
#include <linux/mm.h>
#include <linux/delay.h>
#include <asm/io.h>
#include <asm/uaccess.h>
/*
* core module and version information
*/
#define RNG_VERSION "0.1.0"
#define RNG_MODULE_NAME "amd768_rng"
#define RNG_DRIVER_NAME RNG_MODULE_NAME " hardware driver " RNG_VERSION
#define PFX RNG_MODULE_NAME ": "
/*
* debugging macros
*/
#undef RNG_DEBUG
/* define to enable copious debugging info */
#ifdef RNG_DEBUG
/* note: prints function name for you */
#define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __FUNCTION__ , ## args)
#else
#define DPRINTK(fmt, args...)
#endif
#undef RNG_NDEBUG
/* define to disable lightweight runtime checks */
#ifdef RNG_NDEBUG
#define assert(expr)
#else
#define assert(expr) \
if(!(expr)) { \
printk( "Assertion failed! %s,%s,%s,line=%d\n", \
#expr,__FILE__,__FUNCTION__,__LINE__); \
}
#endif
#define RNG_MISCDEV_MINOR 183
/* official */
/*
* various RNG status variables. they are globals
* as we only support a single RNG device
*/
static
u32
pmbase
;
/* PMxx I/O base */
static
struct
semaphore
rng_open_sem
;
/* Semaphore for serializing rng_open/release */
/*
* inlined helper functions for accessing RNG registers
*/
static
inline
int
rng_data_present
(
void
)
{
return
inl
(
pmbase
+
0xF4
)
&
1
;
}
static
inline
int
rng_data_read
(
void
)
{
return
inl
(
pmbase
+
0xF0
);
}
static
int
rng_dev_open
(
struct
inode
*
inode
,
struct
file
*
filp
)
{
if
((
filp
->
f_mode
&
FMODE_READ
)
==
0
)
return
-
EINVAL
;
if
(
filp
->
f_mode
&
FMODE_WRITE
)
return
-
EINVAL
;
/* wait for device to become free */
if
(
filp
->
f_flags
&
O_NONBLOCK
)
{
if
(
down_trylock
(
&
rng_open_sem
))
return
-
EAGAIN
;
}
else
{
if
(
down_interruptible
(
&
rng_open_sem
))
return
-
ERESTARTSYS
;
}
return
0
;
}
static
int
rng_dev_release
(
struct
inode
*
inode
,
struct
file
*
filp
)
{
up
(
&
rng_open_sem
);
return
0
;
}
static
ssize_t
rng_dev_read
(
struct
file
*
filp
,
char
*
buf
,
size_t
size
,
loff_t
*
offp
)
{
static
spinlock_t
rng_lock
=
SPIN_LOCK_UNLOCKED
;
int
have_data
;
u32
data
=
0
;
ssize_t
ret
=
0
;
while
(
size
)
{
spin_lock
(
&
rng_lock
);
have_data
=
0
;
if
(
rng_data_present
())
{
data
=
rng_data_read
();
have_data
=
4
;
}
spin_unlock
(
&
rng_lock
);
while
(
have_data
>
0
)
{
if
(
put_user
((
u8
)
data
,
buf
++
))
{
ret
=
ret
?
:
-
EFAULT
;
break
;
}
size
--
;
ret
++
;
have_data
--
;
data
>>=
8
;
}
if
(
filp
->
f_flags
&
O_NONBLOCK
)
return
ret
?
:
-
EAGAIN
;
if
(
need_resched
())
{
current
->
state
=
TASK_INTERRUPTIBLE
;
schedule_timeout
(
1
);
}
else
udelay
(
200
);
/* FIXME: We could poll for 250uS ?? */
if
(
signal_pending
(
current
))
return
ret
?
:
-
ERESTARTSYS
;
}
return
ret
;
}
static
struct
file_operations
rng_chrdev_ops
=
{
.
owner
=
THIS_MODULE
,
.
open
=
rng_dev_open
,
.
release
=
rng_dev_release
,
.
read
=
rng_dev_read
,
};
static
struct
miscdevice
rng_miscdev
=
{
RNG_MISCDEV_MINOR
,
RNG_MODULE_NAME
,
&
rng_chrdev_ops
,
};
/*
* rng_init_one - look for and attempt to init a single RNG
*/
static
int
__init
rng_init_one
(
struct
pci_dev
*
dev
)
{
int
rc
;
u8
rnen
;
DPRINTK
(
"ENTER
\n
"
);
rc
=
misc_register
(
&
rng_miscdev
);
if
(
rc
)
{
printk
(
KERN_ERR
PFX
"cannot register misc device
\n
"
);
DPRINTK
(
"EXIT, returning %d
\n
"
,
rc
);
goto
err_out
;
}
pci_read_config_dword
(
dev
,
0x58
,
&
pmbase
);
pmbase
&=
0x0000FF00
;
if
(
pmbase
==
0
)
{
printk
(
KERN_ERR
PFX
"power management base not set
\n
"
);
DPRINTK
(
"EXIT, returning %d
\n
"
,
rc
);
goto
err_out_free_miscdev
;
}
pci_read_config_byte
(
dev
,
0x40
,
&
rnen
);
rnen
|=
(
1
<<
7
);
/* RNG on */
pci_write_config_byte
(
dev
,
0x40
,
rnen
);
pci_read_config_byte
(
dev
,
0x41
,
&
rnen
);
rnen
|=
(
1
<<
7
);
/* PMIO enable */
pci_write_config_byte
(
dev
,
0x41
,
rnen
);
printk
(
KERN_INFO
PFX
"AMD768 system management I/O registers at 0x%X.
\n
"
,
pmbase
);
DPRINTK
(
"EXIT, returning 0
\n
"
);
return
0
;
err_out_free_miscdev:
misc_deregister
(
&
rng_miscdev
);
err_out:
return
rc
;
}
/*
* Data for PCI driver interface
*
* This data only exists for exporting the supported
* PCI ids via MODULE_DEVICE_TABLE. We do not actually
* register a pci_driver, because someone else might one day
* want to register another driver on the same PCI id.
*/
static
struct
pci_device_id
rng_pci_tbl
[]
__initdata
=
{
{
0x1022
,
0x7443
,
PCI_ANY_ID
,
PCI_ANY_ID
,
},
{
0
,
},
};
MODULE_DEVICE_TABLE
(
pci
,
rng_pci_tbl
);
MODULE_AUTHOR
(
"Alan Cox, Jeff Garzik, Philipp Rumpf, Matt Sottek"
);
MODULE_DESCRIPTION
(
"AMD 768 Random Number Generator (RNG) driver"
);
MODULE_LICENSE
(
"GPL"
);
/*
* rng_init - initialize RNG module
*/
static
int
__init
rng_init
(
void
)
{
int
rc
;
struct
pci_dev
*
pdev
;
DPRINTK
(
"ENTER
\n
"
);
init_MUTEX
(
&
rng_open_sem
);
pci_for_each_dev
(
pdev
)
{
if
(
pci_match_device
(
rng_pci_tbl
,
pdev
)
!=
NULL
)
goto
match
;
}
DPRINTK
(
"EXIT, returning -ENODEV
\n
"
);
return
-
ENODEV
;
match:
rc
=
rng_init_one
(
pdev
);
if
(
rc
)
return
rc
;
printk
(
KERN_INFO
RNG_DRIVER_NAME
" loaded
\n
"
);
DPRINTK
(
"EXIT, returning 0
\n
"
);
return
0
;
}
/*
* rng_init - shutdown RNG module
*/
static
void
__exit
rng_cleanup
(
void
)
{
DPRINTK
(
"ENTER
\n
"
);
misc_deregister
(
&
rng_miscdev
);
DPRINTK
(
"EXIT
\n
"
);
}
module_init
(
rng_init
);
module_exit
(
rng_cleanup
);
drivers/char/
i810_rng
.c
→
drivers/char/
hw_random
.c
View file @
baf1aaad
This diff is collapsed.
Click to expand it.
drivers/i2c/i2c-core.c
View file @
baf1aaad
...
@@ -30,6 +30,7 @@
...
@@ -30,6 +30,7 @@
#include <linux/proc_fs.h>
#include <linux/proc_fs.h>
#include <linux/i2c.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/init.h>
#include <linux/seq_file.h>
#include <asm/uaccess.h>
#include <asm/uaccess.h>
...
@@ -326,42 +327,45 @@ int i2c_check_addr(struct i2c_adapter *adapter, int addr)
...
@@ -326,42 +327,45 @@ int i2c_check_addr(struct i2c_adapter *adapter, int addr)
int
i2c_attach_client
(
struct
i2c_client
*
client
)
int
i2c_attach_client
(
struct
i2c_client
*
client
)
{
{
struct
i2c_adapter
*
adapter
=
client
->
adapter
;
struct
i2c_adapter
*
adapter
=
client
->
adapter
;
int
res
=
-
EBUSY
,
i
;
int
i
;
down
(
&
adapter
->
list
);
down
(
&
adapter
->
list
);
if
(
__i2c_check_addr
(
client
->
adapter
,
client
->
addr
))
if
(
__i2c_check_addr
(
client
->
adapter
,
client
->
addr
))
goto
out_unlock_list
;
goto
out_unlock_list
;
for
(
i
=
0
;
i
<
I2C_CLIENT_MAX
;
i
++
)
for
(
i
=
0
;
i
<
I2C_CLIENT_MAX
;
i
++
)
{
if
(
NULL
==
adapter
->
clients
[
i
])
if
(
!
adapter
->
clients
[
i
])
break
;
goto
free_slot
;
if
(
I2C_CLIENT_MAX
==
i
)
{
printk
(
KERN_WARNING
" i2c-core.o: attach_client(%s) - enlarge I2C_CLIENT_MAX.
\n
"
,
client
->
name
);
res
=
-
ENOMEM
;
goto
out_unlock_list
;
}
}
printk
(
KERN_WARNING
" i2c-core.o: attach_client(%s) - enlarge I2C_CLIENT_MAX.
\n
"
,
client
->
name
);
out_unlock_list:
up
(
&
adapter
->
list
);
return
-
EBUSY
;
free_slot:
adapter
->
clients
[
i
]
=
client
;
adapter
->
clients
[
i
]
=
client
;
up
(
&
adapter
->
list
);
up
(
&
adapter
->
list
);
if
(
adapter
->
client_register
)
if
(
adapter
->
client_register
)
{
if
(
adapter
->
client_register
(
client
))
if
(
adapter
->
client_register
(
client
))
{
printk
(
KERN_DEBUG
"i2c-core.o: warning: client_register seems "
printk
(
KERN_DEBUG
"i2c-core.o: warning: client_register seems "
"to have failed for client %02x at adapter %s
\n
"
,
"to have failed for client %02x at adapter %s
\n
"
,
client
->
addr
,
adapter
->
name
);
client
->
addr
,
adapter
->
name
);
DEB
(
printk
(
KERN_DEBUG
"i2c-core.o: client [%s] registered to adapter [%s](pos. %d).
\n
"
,
}
client
->
name
,
adapter
->
name
,
i
));
}
DEB
(
printk
(
KERN_DEBUG
"i2c-core.o: client [%s] registered to adapter [%s] "
"(pos. %d).
\n
"
,
client
->
name
,
adapter
->
name
,
i
));
if
(
client
->
flags
&
I2C_CLIENT_ALLOW_USE
)
if
(
client
->
flags
&
I2C_CLIENT_ALLOW_USE
)
client
->
usage_count
=
0
;
client
->
usage_count
=
0
;
return
0
;
return
0
;
out_unlock_list:
up
(
&
adapter
->
list
);
return
res
;
}
}
...
@@ -376,28 +380,30 @@ int i2c_detach_client(struct i2c_client *client)
...
@@ -376,28 +380,30 @@ int i2c_detach_client(struct i2c_client *client)
if
(
adapter
->
client_unregister
)
{
if
(
adapter
->
client_unregister
)
{
res
=
adapter
->
client_unregister
(
client
);
res
=
adapter
->
client_unregister
(
client
);
if
(
res
)
{
if
(
res
)
{
printk
(
KERN_ERR
"i2c-core.o: client_unregister [%s] failed, "
printk
(
KERN_ERR
"client not detached"
,
client
->
name
);
"i2c-core.o: client_unregister [%s] failed, "
return
res
;
"client not detached"
,
client
->
name
);
goto
out
;
}
}
}
}
down
(
&
adapter
->
list
);
down
(
&
adapter
->
list
);
for
(
i
=
0
;
i
<
I2C_CLIENT_MAX
;
i
++
)
{
for
(
i
=
0
;
i
<
I2C_CLIENT_MAX
;
i
++
)
{
if
(
client
==
adapter
->
clients
[
i
])
if
(
client
==
adapter
->
clients
[
i
])
{
break
;
adapter
->
clients
[
i
]
=
NULL
;
goto
out_unlock
;
}
}
}
if
(
I2C_CLIENT_MAX
==
i
)
{
printk
(
KERN_WARNING
printk
(
KERN_WARNING
" i2c-core.o: unregister_client "
" i2c-core.o: unregister_client [%s] not found
\n
"
,
"[%s] not found
\n
"
,
client
->
name
);
client
->
name
);
res
=
-
ENODEV
;
return
-
ENODEV
;
}
else
adapter
->
clients
[
i
]
=
NULL
;
up
(
&
adapter
->
list
);
return
0
;
out_unlock:
up
(
&
adapter
->
list
);
out:
return
res
;
}
}
static
int
i2c_inc_use_client
(
struct
i2c_client
*
client
)
static
int
i2c_inc_use_client
(
struct
i2c_client
*
client
)
...
@@ -456,45 +462,7 @@ int i2c_release_client(struct i2c_client *client)
...
@@ -456,45 +462,7 @@ int i2c_release_client(struct i2c_client *client)
return
0
;
return
0
;
}
}
/* ----------------------------------------------------
* The /proc functions
* ----------------------------------------------------
*/
#ifdef CONFIG_PROC_FS
#ifdef CONFIG_PROC_FS
/* This function generates the output for /proc/bus/i2c */
static
int
read_bus_i2c
(
char
*
buf
,
char
**
start
,
off_t
offset
,
int
len
,
int
*
eof
,
void
*
private
)
{
int
i
;
int
nr
=
0
;
/* Note that it is safe to write a `little' beyond len. Yes, really. */
/* Fuck you. Will convert this to seq_file later. --hch */
down
(
&
core_lists
);
for
(
i
=
0
;
(
i
<
I2C_ADAP_MAX
)
&&
(
nr
<
len
);
i
++
)
{
if
(
adapters
[
i
])
{
nr
+=
sprintf
(
buf
+
nr
,
"i2c-%d
\t
"
,
i
);
if
(
adapters
[
i
]
->
algo
->
smbus_xfer
)
{
if
(
adapters
[
i
]
->
algo
->
master_xfer
)
nr
+=
sprintf
(
buf
+
nr
,
"smbus/i2c"
);
else
nr
+=
sprintf
(
buf
+
nr
,
"smbus "
);
}
else
if
(
adapters
[
i
]
->
algo
->
master_xfer
)
nr
+=
sprintf
(
buf
+
nr
,
"i2c "
);
else
nr
+=
sprintf
(
buf
+
nr
,
"dummy "
);
nr
+=
sprintf
(
buf
+
nr
,
"
\t
%-32s
\t
%-32s
\n
"
,
adapters
[
i
]
->
name
,
adapters
[
i
]
->
algo
->
name
);
}
}
up
(
&
core_lists
);
return
nr
;
}
/* This function generates the output for /proc/bus/i2c-? */
/* This function generates the output for /proc/bus/i2c-? */
static
ssize_t
i2cproc_bus_read
(
struct
file
*
file
,
char
*
buf
,
static
ssize_t
i2cproc_bus_read
(
struct
file
*
file
,
char
*
buf
,
size_t
count
,
loff_t
*
ppos
)
size_t
count
,
loff_t
*
ppos
)
...
@@ -564,6 +532,50 @@ static struct file_operations i2cproc_operations = {
...
@@ -564,6 +532,50 @@ static struct file_operations i2cproc_operations = {
.
read
=
i2cproc_bus_read
,
.
read
=
i2cproc_bus_read
,
};
};
/* This function generates the output for /proc/bus/i2c */
static
int
bus_i2c_show
(
struct
seq_file
*
s
,
void
*
p
)
{
int
i
;
down
(
&
core_lists
);
for
(
i
=
0
;
i
<
I2C_ADAP_MAX
;
i
++
)
{
struct
i2c_adapter
*
adapter
=
adapters
[
i
];
if
(
!
adapter
)
continue
;
seq_printf
(
s
,
"i2c-%d
\t
"
,
i
);
if
(
adapter
->
algo
->
smbus_xfer
)
{
if
(
adapter
->
algo
->
master_xfer
)
seq_printf
(
s
,
"smbus/i2c"
);
else
seq_printf
(
s
,
"smbus "
);
}
else
if
(
adapter
->
algo
->
master_xfer
)
seq_printf
(
s
,
"i2c "
);
else
seq_printf
(
s
,
"dummy "
);
seq_printf
(
s
,
"
\t
%-32s
\t
%-32s
\n
"
,
adapter
->
name
,
adapter
->
algo
->
name
);
}
up
(
&
core_lists
);
return
0
;
}
static
int
bus_i2c_open
(
struct
inode
*
inode
,
struct
file
*
file
)
{
return
single_open
(
file
,
bus_i2c_show
,
NULL
);
}
static
struct
file_operations
bus_i2c_fops
=
{
.
open
=
bus_i2c_open
,
.
read
=
seq_read
,
.
llseek
=
seq_lseek
,
.
release
=
single_release
,
};
static
int
i2cproc_register
(
struct
i2c_adapter
*
adap
,
int
bus
)
static
int
i2cproc_register
(
struct
i2c_adapter
*
adap
,
int
bus
)
{
{
struct
proc_dir_entry
*
proc_entry
;
struct
proc_dir_entry
*
proc_entry
;
...
@@ -576,7 +588,7 @@ static int i2cproc_register(struct i2c_adapter *adap, int bus)
...
@@ -576,7 +588,7 @@ static int i2cproc_register(struct i2c_adapter *adap, int bus)
goto
fail
;
goto
fail
;
proc_entry
->
proc_fops
=
&
i2cproc_operations
;
proc_entry
->
proc_fops
=
&
i2cproc_operations
;
proc_entry
->
owner
=
THIS_MODULE
;
proc_entry
->
owner
=
adap
->
owner
;
adap
->
inode
=
proc_entry
->
low_ino
;
adap
->
inode
=
proc_entry
->
low_ino
;
return
0
;
return
0
;
fail:
fail:
...
@@ -596,15 +608,16 @@ static int __init i2cproc_init(void)
...
@@ -596,15 +608,16 @@ static int __init i2cproc_init(void)
{
{
struct
proc_dir_entry
*
proc_bus_i2c
;
struct
proc_dir_entry
*
proc_bus_i2c
;
proc_bus_i2c
=
create_proc_entry
(
"i2c"
,
0
,
proc_bus
);
proc_bus_i2c
=
create_proc_entry
(
"i2c"
,
0
,
proc_bus
);
if
(
!
proc_bus_i2c
)
{
if
(
!
proc_bus_i2c
)
printk
(
KERN_ERR
"i2c-core.o: Could not create /proc/bus/i2c"
);
goto
fail
;
return
-
ENOENT
;
proc_bus_i2c
->
proc_fops
=
&
bus_i2c_fops
;
}
proc_bus_i2c
->
owner
=
THIS_MODULE
;
return
0
;
proc_bus_i2c
->
read_proc
=
&
read_bus_i2c
;
fail:
pr
oc_bus_i2c
->
owner
=
THIS_MODULE
;
pr
intk
(
KERN_ERR
"i2c-core.o: Could not create /proc/bus/i2c"
)
;
return
0
;
return
-
ENOENT
;
}
}
static
void
__exit
i2cproc_cleanup
(
void
)
static
void
__exit
i2cproc_cleanup
(
void
)
...
...
drivers/i2c/i2c-proc.c
View file @
baf1aaad
...
@@ -35,8 +35,6 @@
...
@@ -35,8 +35,6 @@
#include <linux/i2c-proc.h>
#include <linux/i2c-proc.h>
#include <asm/uaccess.h>
#include <asm/uaccess.h>
static
int
i2c_create_name
(
char
**
name
,
const
char
*
prefix
,
struct
i2c_adapter
*
adapter
,
int
addr
);
static
int
i2c_parse_reals
(
int
*
nrels
,
void
*
buffer
,
int
bufsize
,
static
int
i2c_parse_reals
(
int
*
nrels
,
void
*
buffer
,
int
bufsize
,
long
*
results
,
int
magnitude
);
long
*
results
,
int
magnitude
);
static
int
i2c_write_reals
(
int
nrels
,
void
*
buffer
,
size_t
*
bufsize
,
static
int
i2c_write_reals
(
int
nrels
,
void
*
buffer
,
size_t
*
bufsize
,
...
@@ -54,15 +52,6 @@ static struct ctl_table_header *i2c_entries[SENSORS_ENTRY_MAX];
...
@@ -54,15 +52,6 @@ static struct ctl_table_header *i2c_entries[SENSORS_ENTRY_MAX];
static
struct
i2c_client
*
i2c_clients
[
SENSORS_ENTRY_MAX
];
static
struct
i2c_client
*
i2c_clients
[
SENSORS_ENTRY_MAX
];
static
ctl_table
sysctl_table
[]
=
{
{
CTL_DEV
,
"dev"
,
NULL
,
0
,
0555
},
{
0
},
{
DEV_SENSORS
,
"sensors"
,
NULL
,
0
,
0555
},
{
0
},
{
0
,
NULL
,
NULL
,
0
,
0555
},
{
0
}
};
static
ctl_table
i2c_proc_dev_sensors
[]
=
{
static
ctl_table
i2c_proc_dev_sensors
[]
=
{
{
SENSORS_CHIPS
,
"chips"
,
NULL
,
0
,
0644
,
NULL
,
&
i2c_proc_chips
,
{
SENSORS_CHIPS
,
"chips"
,
NULL
,
0
,
0644
,
NULL
,
&
i2c_proc_chips
,
&
i2c_sysctl_chips
},
&
i2c_sysctl_chips
},
...
@@ -87,36 +76,40 @@ static struct ctl_table_header *i2c_proc_header;
...
@@ -87,36 +76,40 @@ static struct ctl_table_header *i2c_proc_header;
(for a LM78 chip on the ISA bus at port 0x310), or lm75-i2c-3-4e (for
(for a LM78 chip on the ISA bus at port 0x310), or lm75-i2c-3-4e (for
a LM75 chip on the third i2c bus at address 0x4e).
a LM75 chip on the third i2c bus at address 0x4e).
name is allocated first. */
name is allocated first. */
static
int
i2c_create_name
(
char
**
name
,
const
char
*
prefix
,
static
char
*
generate_name
(
struct
i2c_client
*
client
,
const
char
*
prefix
)
struct
i2c_adapter
*
adapter
,
int
addr
)
{
{
char
name_buffer
[
50
];
struct
i2c_adapter
*
adapter
=
client
->
adapter
;
int
id
,
i
,
end
;
int
addr
=
client
->
addr
;
if
(
i2c_is_isa_adapter
(
adapter
))
char
name_buffer
[
50
],
*
name
;
if
(
i2c_is_isa_adapter
(
adapter
))
{
sprintf
(
name_buffer
,
"%s-isa-%04x"
,
prefix
,
addr
);
sprintf
(
name_buffer
,
"%s-isa-%04x"
,
prefix
,
addr
);
else
if
(
!
adapter
->
algo
->
smbus_xfer
&&
!
adapter
->
algo
->
master_xfer
)
{
}
else
if
(
adapter
->
algo
->
smbus_xfer
||
adapter
->
algo
->
master_xfer
)
{
/* dummy adapter, generate prefix */
int
id
=
i2c_adapter_id
(
adapter
);
if
(
id
<
0
)
return
ERR_PTR
(
-
ENOENT
);
sprintf
(
name_buffer
,
"%s-i2c-%d-%02x"
,
prefix
,
id
,
addr
);
}
else
{
/* dummy adapter, generate prefix */
int
end
,
i
;
sprintf
(
name_buffer
,
"%s-"
,
prefix
);
sprintf
(
name_buffer
,
"%s-"
,
prefix
);
end
=
strlen
(
name_buffer
);
end
=
strlen
(
name_buffer
);
for
(
i
=
0
;
i
<
32
;
i
++
)
{
if
(
adapter
->
algo
->
name
[
i
]
==
' '
)
for
(
i
=
0
;
i
<
32
;
i
++
)
{
if
(
adapter
->
algo
->
name
[
i
]
==
' '
)
break
;
break
;
name_buffer
[
end
++
]
=
tolower
(
adapter
->
algo
->
name
[
i
]);
name_buffer
[
end
++
]
=
tolower
(
adapter
->
algo
->
name
[
i
]);
}
}
name_buffer
[
end
]
=
0
;
name_buffer
[
end
]
=
0
;
sprintf
(
name_buffer
+
end
,
"-%04x"
,
addr
);
sprintf
(
name_buffer
+
end
,
"-%04x"
,
addr
);
}
else
{
if
((
id
=
i2c_adapter_id
(
adapter
))
<
0
)
return
-
ENOENT
;
sprintf
(
name_buffer
,
"%s-i2c-%d-%02x"
,
prefix
,
id
,
addr
);
}
*
name
=
kmalloc
(
strlen
(
name_buffer
)
+
1
,
GFP_KERNEL
);
if
(
!*
name
)
{
printk
(
KERN_WARNING
"i2c_create_name: not enough memory
\n
"
);
return
-
ENOMEM
;
}
}
strcpy
(
*
name
,
name_buffer
);
return
0
;
name
=
kmalloc
(
strlen
(
name_buffer
)
+
1
,
GFP_KERNEL
);
if
(
unlikely
(
!
name
))
return
ERR_PTR
(
-
ENOMEM
);
strcpy
(
name
,
name_buffer
);
return
name
;
}
}
/* This rather complex function must be called when you want to add an entry
/* This rather complex function must be called when you want to add an entry
...
@@ -127,93 +120,80 @@ static int i2c_create_name(char **name, const char *prefix,
...
@@ -127,93 +120,80 @@ static int i2c_create_name(char **name, const char *prefix,
If any driver wants subdirectories within the newly created directory,
If any driver wants subdirectories within the newly created directory,
this function must be updated! */
this function must be updated! */
int
i2c_register_entry
(
struct
i2c_client
*
client
,
const
char
*
prefix
,
int
i2c_register_entry
(
struct
i2c_client
*
client
,
const
char
*
prefix
,
ctl_table
*
ctl_template
)
struct
ctl_table
*
leaf
)
{
{
int
i
,
res
,
len
,
id
;
struct
{
struct
ctl_table
root
[
2
],
dev
[
2
],
sensors
[
2
];
}
*
tbl
;
ctl_table
*
new_table
,
*
client_tbl
,
*
tbl
;
struct
ctl_table_header
*
hdr
;
char
*
name
;
struct
ctl_table
*
tmp
;
struct
ctl_table_header
*
new_header
;
const
char
*
name
;
int
id
;
name
=
generate_name
(
client
,
prefix
);
if
(
IS_ERR
(
name
))
return
PTR_ERR
(
name
);
for
(
id
=
0
;
id
<
SENSORS_ENTRY_MAX
;
id
++
)
{
if
(
!
i2c_entries
[
id
])
goto
free_slot
;
}
if
((
res
=
i2c_create_name
(
&
name
,
prefix
,
client
->
adapter
,
goto
out_free_name
;
client
->
addr
)))
return
res
;
for
(
id
=
0
;
id
<
SENSORS_ENTRY_MAX
;
id
++
)
free_slot:
if
(
!
i2c_entries
[
id
])
{
tbl
=
kmalloc
(
sizeof
(
*
tbl
),
GFP_KERNEL
);
break
;
if
(
unlikely
(
!
tbl
))
}
goto
out_free_name
;
if
(
id
==
SENSORS_ENTRY_MAX
)
{
memset
(
tbl
,
0
,
sizeof
(
*
tbl
));
kfree
(
name
);
return
-
ENOMEM
;
}
id
+=
256
;
for
(
tmp
=
leaf
;
tmp
->
ctl_name
;
tmp
++
)
tmp
->
extra2
=
client
;
len
=
0
;
while
(
ctl_template
[
len
].
procname
)
len
++
;
if
(
!
(
new_table
=
kmalloc
(
sizeof
(
sysctl_table
)
+
sizeof
(
ctl_table
)
*
(
len
+
1
),
GFP_KERNEL
)))
{
kfree
(
name
);
return
-
ENOMEM
;
}
memcpy
(
new_table
,
sysctl_table
,
sizeof
(
sysctl_table
));
tbl
->
sensors
->
ctl_name
=
id
+
256
;
tbl
=
new_table
;
/* sys/ */
tbl
->
sensors
->
procname
=
name
;
tbl
=
tbl
->
child
=
tbl
+
2
;
/* dev/ */
tbl
->
sensors
->
mode
=
0555
;
tbl
=
tbl
->
child
=
tbl
+
2
;
/* sensors/ */
tbl
->
sensors
->
child
=
leaf
;
client_tbl
=
tbl
->
child
=
tbl
+
2
;
/* XX-chip-YY-ZZ/ */
client_tbl
->
procname
=
name
;
tbl
->
dev
->
ctl_name
=
DEV_SENSORS
;
client_tbl
->
ctl_name
=
id
;
tbl
->
dev
->
procname
=
"sensors"
;
client_tbl
->
child
=
client_tbl
+
2
;
tbl
->
dev
->
mode
=
0555
;
tbl
->
dev
->
child
=
tbl
->
sensors
;
/* Next the client sysctls. --km */
tbl
->
root
->
ctl_name
=
CTL_DEV
;
tbl
=
client_tbl
->
child
;
tbl
->
root
->
procname
=
"dev"
;
memcpy
(
tbl
,
ctl_template
,
sizeof
(
ctl_table
)
*
(
len
+
1
));
tbl
->
root
->
mode
=
0555
;
for
(
i
=
0
;
i
<
len
;
i
++
)
tbl
->
root
->
child
=
tbl
->
dev
;
tbl
[
i
].
extra2
=
client
;
if
(
!
(
new_header
=
register_sysctl_table
(
new_table
,
0
)))
{
hdr
=
register_sysctl_table
(
tbl
->
root
,
0
);
printk
(
KERN_ERR
"i2c-proc.o: error: sysctl interface not supported by kernel!
\n
"
);
if
(
unlikely
(
!
hdr
))
kfree
(
new_table
);
goto
out_free_tbl
;
kfree
(
name
);
return
-
EPERM
;
}
i2c_entries
[
id
-
256
]
=
new_header
;
i2c_entries
[
id
]
=
hdr
;
i2c_clients
[
id
]
=
client
;
i2c_clients
[
id
-
256
]
=
client
;
return
(
id
+
256
);
/* XXX(hch) why?? */
#ifdef DEBUG
out_free_tbl:
if
(
!
new_header
||
!
new_header
->
ctl_table
||
kfree
(
tbl
);
!
new_header
->
ctl_table
->
child
||
out_free_name:
!
new_header
->
ctl_table
->
child
->
child
||
kfree
(
name
);
!
new_header
->
ctl_table
->
child
->
child
->
de
)
{
return
-
ENOMEM
;
printk
(
KERN_ERR
"i2c-proc.o: NULL pointer when trying to install fill_inode fix!
\n
"
);
return
id
;
}
#endif
/* DEBUG */
client_tbl
->
de
->
owner
=
client
->
driver
->
owner
;
return
id
;
}
}
void
i2c_deregister_entry
(
int
id
)
void
i2c_deregister_entry
(
int
id
)
{
{
ctl_table
*
table
;
id
-=
256
;
char
*
temp
;
id
-=
256
;
if
(
i2c_entries
[
id
])
{
if
(
i2c_entries
[
id
])
{
table
=
i2c_entries
[
id
]
->
ctl_table
;
struct
ctl_table_header
*
hdr
=
i2c_entries
[
id
];
unregister_sysctl_table
(
i2c_entries
[
id
]);
struct
ctl_table
*
tbl
=
hdr
->
ctl_table
;
/* 2-step kfree needed to keep gcc happy about const points */
(
const
char
*
)
temp
=
table
[
4
].
procname
;
unregister_sysctl_table
(
hdr
);
kfree
(
temp
);
kfree
(
tbl
->
child
->
child
->
procname
);
kfree
(
table
);
kfree
(
tbl
);
/* actually the whole anonymous struct */
i2c_entries
[
id
]
=
NULL
;
i2c_clients
[
id
]
=
NULL
;
}
}
i2c_entries
[
id
]
=
NULL
;
i2c_clients
[
id
]
=
NULL
;
}
}
static
int
i2c_proc_chips
(
ctl_table
*
ctl
,
int
write
,
struct
file
*
filp
,
static
int
i2c_proc_chips
(
ctl_table
*
ctl
,
int
write
,
struct
file
*
filp
,
...
...
drivers/md/linear.c
View file @
baf1aaad
...
@@ -203,36 +203,34 @@ static int linear_make_request (request_queue_t *q, struct bio *bio)
...
@@ -203,36 +203,34 @@ static int linear_make_request (request_queue_t *q, struct bio *bio)
return
0
;
return
0
;
}
}
bio
->
bi_bdev
=
tmp_dev
->
rdev
->
bdev
;
bio
->
bi_bdev
=
tmp_dev
->
rdev
->
bdev
;
bio
->
bi_sector
=
bio
->
bi_sector
-
(
tmp_dev
->
offset
<<
1
);
bio
->
bi_sector
=
bio
->
bi_sector
-
(
tmp_dev
->
offset
<<
1
)
+
tmp_dev
->
rdev
->
data_offset
;
return
1
;
return
1
;
}
}
static
int
linear_status
(
char
*
page
,
mddev_t
*
mddev
)
static
void
linear_status
(
struct
seq_file
*
seq
,
mddev_t
*
mddev
)
{
{
int
sz
=
0
;
#undef MD_DEBUG
#undef MD_DEBUG
#ifdef MD_DEBUG
#ifdef MD_DEBUG
int
j
;
int
j
;
linear_conf_t
*
conf
=
mddev_to_conf
(
mddev
);
linear_conf_t
*
conf
=
mddev_to_conf
(
mddev
);
s
z
+=
sprintf
(
page
+
sz
,
" "
);
s
eq_printf
(
seq
,
" "
);
for
(
j
=
0
;
j
<
conf
->
nr_zones
;
j
++
)
for
(
j
=
0
;
j
<
conf
->
nr_zones
;
j
++
)
{
{
s
z
+=
sprintf
(
page
+
sz
,
"[%s"
,
s
eq_printf
(
seq
,
"[%s"
,
bdev_partition_name
(
conf
->
hash_table
[
j
].
dev0
->
rdev
->
bdev
));
bdev_partition_name
(
conf
->
hash_table
[
j
].
dev0
->
rdev
->
bdev
));
if
(
conf
->
hash_table
[
j
].
dev1
)
if
(
conf
->
hash_table
[
j
].
dev1
)
s
z
+=
sprintf
(
page
+
sz
,
"/%s] "
,
s
eq_printf
(
seq
,
"/%s] "
,
bdev_partition_name
(
conf
->
hash_table
[
j
].
dev1
->
rdev
->
bdev
));
bdev_partition_name
(
conf
->
hash_table
[
j
].
dev1
->
rdev
->
bdev
));
else
else
s
z
+=
sprintf
(
page
+
sz
,
"] "
);
s
eq_printf
(
seq
,
"] "
);
}
}
s
z
+=
sprintf
(
page
+
sz
,
"
\n
"
);
s
eq_printf
(
seq
,
"
\n
"
);
#endif
#endif
sz
+=
sprintf
(
page
+
sz
,
" %dk rounding"
,
mddev
->
chunk_size
/
1024
);
seq_printf
(
seq
,
" %dk rounding"
,
mddev
->
chunk_size
/
1024
);
return
sz
;
}
}
...
...
drivers/md/md.c
View file @
baf1aaad
This diff is collapsed.
Click to expand it.
drivers/md/multipath.c
View file @
baf1aaad
...
@@ -86,7 +86,6 @@ static void multipath_reschedule_retry (struct multipath_bh *mp_bh)
...
@@ -86,7 +86,6 @@ static void multipath_reschedule_retry (struct multipath_bh *mp_bh)
{
{
unsigned
long
flags
;
unsigned
long
flags
;
mddev_t
*
mddev
=
mp_bh
->
mddev
;
mddev_t
*
mddev
=
mp_bh
->
mddev
;
multipath_conf_t
*
conf
=
mddev_to_conf
(
mddev
);
spin_lock_irqsave
(
&
retry_list_lock
,
flags
);
spin_lock_irqsave
(
&
retry_list_lock
,
flags
);
if
(
multipath_retry_list
==
NULL
)
if
(
multipath_retry_list
==
NULL
)
...
@@ -95,7 +94,7 @@ static void multipath_reschedule_retry (struct multipath_bh *mp_bh)
...
@@ -95,7 +94,7 @@ static void multipath_reschedule_retry (struct multipath_bh *mp_bh)
multipath_retry_tail
=
&
mp_bh
->
next_mp
;
multipath_retry_tail
=
&
mp_bh
->
next_mp
;
mp_bh
->
next_mp
=
NULL
;
mp_bh
->
next_mp
=
NULL
;
spin_unlock_irqrestore
(
&
retry_list_lock
,
flags
);
spin_unlock_irqrestore
(
&
retry_list_lock
,
flags
);
md_wakeup_thread
(
conf
->
thread
);
md_wakeup_thread
(
mddev
->
thread
);
}
}
...
@@ -185,19 +184,18 @@ static int multipath_make_request (request_queue_t *q, struct bio * bio)
...
@@ -185,19 +184,18 @@ static int multipath_make_request (request_queue_t *q, struct bio * bio)
return
0
;
return
0
;
}
}
static
int
multipath_status
(
char
*
page
,
mddev_t
*
mddev
)
static
void
multipath_status
(
struct
seq_file
*
seq
,
mddev_t
*
mddev
)
{
{
multipath_conf_t
*
conf
=
mddev_to_conf
(
mddev
);
multipath_conf_t
*
conf
=
mddev_to_conf
(
mddev
);
int
sz
=
0
,
i
;
int
i
;
s
z
+=
sprintf
(
page
+
sz
,
" [%d/%d] ["
,
conf
->
raid_disks
,
s
eq_printf
(
seq
,
" [%d/%d] ["
,
conf
->
raid_disks
,
conf
->
working_disks
);
conf
->
working_disks
);
for
(
i
=
0
;
i
<
conf
->
raid_disks
;
i
++
)
for
(
i
=
0
;
i
<
conf
->
raid_disks
;
i
++
)
s
z
+=
sprintf
(
page
+
sz
,
"%s"
,
s
eq_printf
(
seq
,
"%s"
,
conf
->
multipaths
[
i
].
rdev
&&
conf
->
multipaths
[
i
].
rdev
&&
conf
->
multipaths
[
i
].
rdev
->
in_sync
?
"U"
:
"_"
);
conf
->
multipaths
[
i
].
rdev
->
in_sync
?
"U"
:
"_"
);
sz
+=
sprintf
(
page
+
sz
,
"]"
);
seq_printf
(
seq
,
"]"
);
return
sz
;
}
}
#define LAST_DISK KERN_ALERT \
#define LAST_DISK KERN_ALERT \
...
@@ -334,14 +332,14 @@ static int multipath_remove_disk(mddev_t *mddev, int number)
...
@@ -334,14 +332,14 @@ static int multipath_remove_disk(mddev_t *mddev, int number)
* 3. Performs writes following reads for array syncronising.
* 3. Performs writes following reads for array syncronising.
*/
*/
static
void
multipathd
(
void
*
data
)
static
void
multipathd
(
mddev_t
*
mddev
)
{
{
struct
multipath_bh
*
mp_bh
;
struct
multipath_bh
*
mp_bh
;
struct
bio
*
bio
;
struct
bio
*
bio
;
unsigned
long
flags
;
unsigned
long
flags
;
mddev_t
*
mddev
;
mdk_rdev_t
*
rdev
;
mdk_rdev_t
*
rdev
;
md_check_recovery
(
mddev
);
for
(;;)
{
for
(;;)
{
spin_lock_irqsave
(
&
retry_list_lock
,
flags
);
spin_lock_irqsave
(
&
retry_list_lock
,
flags
);
mp_bh
=
multipath_retry_list
;
mp_bh
=
multipath_retry_list
;
...
@@ -471,10 +469,10 @@ static int multipath_run (mddev_t *mddev)
...
@@ -471,10 +469,10 @@ static int multipath_run (mddev_t *mddev)
}
}
{
{
const
char
*
name
=
"m
ultipathd
"
;
const
char
*
name
=
"m
d%d_multipath
"
;
conf
->
thread
=
md_register_thread
(
multipathd
,
conf
,
name
);
mddev
->
thread
=
md_register_thread
(
multipathd
,
mddev
,
name
);
if
(
!
conf
->
thread
)
{
if
(
!
mddev
->
thread
)
{
printk
(
THREAD_ERROR
,
mdidx
(
mddev
));
printk
(
THREAD_ERROR
,
mdidx
(
mddev
));
goto
out_free_conf
;
goto
out_free_conf
;
}
}
...
@@ -513,7 +511,7 @@ static int multipath_stop (mddev_t *mddev)
...
@@ -513,7 +511,7 @@ static int multipath_stop (mddev_t *mddev)
{
{
multipath_conf_t
*
conf
=
mddev_to_conf
(
mddev
);
multipath_conf_t
*
conf
=
mddev_to_conf
(
mddev
);
md_unregister_thread
(
conf
->
thread
);
md_unregister_thread
(
mddev
->
thread
);
mempool_destroy
(
conf
->
pool
);
mempool_destroy
(
conf
->
pool
);
kfree
(
conf
);
kfree
(
conf
);
mddev
->
private
=
NULL
;
mddev
->
private
=
NULL
;
...
...
drivers/md/raid0.c
View file @
baf1aaad
...
@@ -349,7 +349,7 @@ static int raid0_make_request (request_queue_t *q, struct bio *bio)
...
@@ -349,7 +349,7 @@ static int raid0_make_request (request_queue_t *q, struct bio *bio)
* is the only IO operation happening on this bh.
* is the only IO operation happening on this bh.
*/
*/
bio
->
bi_bdev
=
tmp_dev
->
bdev
;
bio
->
bi_bdev
=
tmp_dev
->
bdev
;
bio
->
bi_sector
=
rsect
;
bio
->
bi_sector
=
rsect
+
tmp_dev
->
data_offset
;
/*
/*
* Let the main block layer submit the IO and resolve recursion:
* Let the main block layer submit the IO and resolve recursion:
...
@@ -372,41 +372,40 @@ static int raid0_make_request (request_queue_t *q, struct bio *bio)
...
@@ -372,41 +372,40 @@ static int raid0_make_request (request_queue_t *q, struct bio *bio)
return
0
;
return
0
;
}
}
static
int
raid0_status
(
char
*
page
,
mddev_t
*
mddev
)
static
void
raid0_status
(
struct
seq_file
*
seq
,
mddev_t
*
mddev
)
{
{
int
sz
=
0
;
#undef MD_DEBUG
#undef MD_DEBUG
#ifdef MD_DEBUG
#ifdef MD_DEBUG
int
j
,
k
;
int
j
,
k
;
raid0_conf_t
*
conf
=
mddev_to_conf
(
mddev
);
raid0_conf_t
*
conf
=
mddev_to_conf
(
mddev
);
s
z
+=
sprintf
(
page
+
sz
,
" "
);
s
eq_printf
(
seq
,
" "
);
for
(
j
=
0
;
j
<
conf
->
nr_zones
;
j
++
)
{
for
(
j
=
0
;
j
<
conf
->
nr_zones
;
j
++
)
{
s
z
+=
sprintf
(
page
+
sz
,
"[z%d"
,
s
eq_printf
(
seq
,
"[z%d"
,
conf
->
hash_table
[
j
].
zone0
-
conf
->
strip_zone
);
conf
->
hash_table
[
j
].
zone0
-
conf
->
strip_zone
);
if
(
conf
->
hash_table
[
j
].
zone1
)
if
(
conf
->
hash_table
[
j
].
zone1
)
s
z
+=
sprintf
(
page
+
sz
,
"/z%d] "
,
s
eq_printf
(
seq
,
"/z%d] "
,
conf
->
hash_table
[
j
].
zone1
-
conf
->
strip_zone
);
conf
->
hash_table
[
j
].
zone1
-
conf
->
strip_zone
);
else
else
s
z
+=
sprintf
(
page
+
sz
,
"] "
);
s
eq_printf
(
seq
,
"] "
);
}
}
s
z
+=
sprintf
(
page
+
sz
,
"
\n
"
);
s
eq_printf
(
seq
,
"
\n
"
);
for
(
j
=
0
;
j
<
conf
->
nr_strip_zones
;
j
++
)
{
for
(
j
=
0
;
j
<
conf
->
nr_strip_zones
;
j
++
)
{
s
z
+=
sprintf
(
page
+
sz
,
" z%d=["
,
j
);
s
eq_printf
(
seq
,
" z%d=["
,
j
);
for
(
k
=
0
;
k
<
conf
->
strip_zone
[
j
].
nb_dev
;
k
++
)
for
(
k
=
0
;
k
<
conf
->
strip_zone
[
j
].
nb_dev
;
k
++
)
s
z
+=
sprintf
(
page
+
sz
,
"%s/"
,
bdev_partition_name
(
s
eq_printf
(
seq
,
"%s/"
,
bdev_partition_name
(
conf
->
strip_zone
[
j
].
dev
[
k
]
->
bdev
));
conf
->
strip_zone
[
j
].
dev
[
k
]
->
bdev
));
sz
--
;
s
z
+=
sprintf
(
page
+
sz
,
"] zo=%d do=%d s=%d
\n
"
,
s
eq_printf
(
seq
,
"] zo=%d do=%d s=%d
\n
"
,
conf
->
strip_zone
[
j
].
zone_offset
,
conf
->
strip_zone
[
j
].
zone_offset
,
conf
->
strip_zone
[
j
].
dev_offset
,
conf
->
strip_zone
[
j
].
dev_offset
,
conf
->
strip_zone
[
j
].
size
);
conf
->
strip_zone
[
j
].
size
);
}
}
#endif
#endif
s
z
+=
sprintf
(
page
+
sz
,
" %dk chunks"
,
mddev
->
chunk_size
/
1024
);
s
eq_printf
(
seq
,
" %dk chunks"
,
mddev
->
chunk_size
/
1024
);
return
sz
;
return
;
}
}
static
mdk_personality_t
raid0_personality
=
static
mdk_personality_t
raid0_personality
=
...
...
drivers/md/raid1.c
View file @
baf1aaad
...
@@ -225,13 +225,12 @@ static void reschedule_retry(r1bio_t *r1_bio)
...
@@ -225,13 +225,12 @@ static void reschedule_retry(r1bio_t *r1_bio)
{
{
unsigned
long
flags
;
unsigned
long
flags
;
mddev_t
*
mddev
=
r1_bio
->
mddev
;
mddev_t
*
mddev
=
r1_bio
->
mddev
;
conf_t
*
conf
=
mddev_to_conf
(
mddev
);
spin_lock_irqsave
(
&
retry_list_lock
,
flags
);
spin_lock_irqsave
(
&
retry_list_lock
,
flags
);
list_add
(
&
r1_bio
->
retry_list
,
&
retry_list_head
);
list_add
(
&
r1_bio
->
retry_list
,
&
retry_list_head
);
spin_unlock_irqrestore
(
&
retry_list_lock
,
flags
);
spin_unlock_irqrestore
(
&
retry_list_lock
,
flags
);
md_wakeup_thread
(
conf
->
thread
);
md_wakeup_thread
(
mddev
->
thread
);
}
}
/*
/*
...
@@ -320,7 +319,7 @@ static int end_request(struct bio *bio, unsigned int bytes_done, int error)
...
@@ -320,7 +319,7 @@ static int end_request(struct bio *bio, unsigned int bytes_done, int error)
* already.
* already.
*/
*/
if
(
atomic_dec_and_test
(
&
r1_bio
->
remaining
))
{
if
(
atomic_dec_and_test
(
&
r1_bio
->
remaining
))
{
md_write_end
(
r1_bio
->
mddev
,
conf
->
thread
);
md_write_end
(
r1_bio
->
mddev
);
raid_end_bio_io
(
r1_bio
,
uptodate
);
raid_end_bio_io
(
r1_bio
,
uptodate
);
}
}
}
}
...
@@ -494,7 +493,7 @@ static int make_request(request_queue_t *q, struct bio * bio)
...
@@ -494,7 +493,7 @@ static int make_request(request_queue_t *q, struct bio * bio)
BUG
();
BUG
();
r1_bio
->
read_bio
=
read_bio
;
r1_bio
->
read_bio
=
read_bio
;
read_bio
->
bi_sector
=
r1_bio
->
sector
;
read_bio
->
bi_sector
=
r1_bio
->
sector
+
mirror
->
rdev
->
data_offset
;
read_bio
->
bi_bdev
=
mirror
->
rdev
->
bdev
;
read_bio
->
bi_bdev
=
mirror
->
rdev
->
bdev
;
read_bio
->
bi_end_io
=
end_request
;
read_bio
->
bi_end_io
=
end_request
;
read_bio
->
bi_rw
=
r1_bio
->
cmd
;
read_bio
->
bi_rw
=
r1_bio
->
cmd
;
...
@@ -529,7 +528,7 @@ static int make_request(request_queue_t *q, struct bio * bio)
...
@@ -529,7 +528,7 @@ static int make_request(request_queue_t *q, struct bio * bio)
mbio
=
bio_clone
(
bio
,
GFP_NOIO
);
mbio
=
bio_clone
(
bio
,
GFP_NOIO
);
r1_bio
->
write_bios
[
i
]
=
mbio
;
r1_bio
->
write_bios
[
i
]
=
mbio
;
mbio
->
bi_sector
=
r1_bio
->
sector
;
mbio
->
bi_sector
=
r1_bio
->
sector
+
conf
->
mirrors
[
i
].
rdev
->
data_offset
;
mbio
->
bi_bdev
=
conf
->
mirrors
[
i
].
rdev
->
bdev
;
mbio
->
bi_bdev
=
conf
->
mirrors
[
i
].
rdev
->
bdev
;
mbio
->
bi_end_io
=
end_request
;
mbio
->
bi_end_io
=
end_request
;
mbio
->
bi_rw
=
r1_bio
->
cmd
;
mbio
->
bi_rw
=
r1_bio
->
cmd
;
...
@@ -542,7 +541,7 @@ static int make_request(request_queue_t *q, struct bio * bio)
...
@@ -542,7 +541,7 @@ static int make_request(request_queue_t *q, struct bio * bio)
* If all mirrors are non-operational
* If all mirrors are non-operational
* then return an IO error:
* then return an IO error:
*/
*/
md_write_end
(
mddev
,
conf
->
thread
);
md_write_end
(
mddev
);
raid_end_bio_io
(
r1_bio
,
0
);
raid_end_bio_io
(
r1_bio
,
0
);
return
0
;
return
0
;
}
}
...
@@ -571,19 +570,18 @@ static int make_request(request_queue_t *q, struct bio * bio)
...
@@ -571,19 +570,18 @@ static int make_request(request_queue_t *q, struct bio * bio)
return
0
;
return
0
;
}
}
static
int
status
(
char
*
page
,
mddev_t
*
mddev
)
static
void
status
(
struct
seq_file
*
seq
,
mddev_t
*
mddev
)
{
{
conf_t
*
conf
=
mddev_to_conf
(
mddev
);
conf_t
*
conf
=
mddev_to_conf
(
mddev
);
int
sz
=
0
,
i
;
int
i
;
s
z
+=
sprintf
(
page
+
sz
,
" [%d/%d] ["
,
conf
->
raid_disks
,
s
eq_printf
(
seq
,
" [%d/%d] ["
,
conf
->
raid_disks
,
conf
->
working_disks
);
conf
->
working_disks
);
for
(
i
=
0
;
i
<
conf
->
raid_disks
;
i
++
)
for
(
i
=
0
;
i
<
conf
->
raid_disks
;
i
++
)
s
z
+=
sprintf
(
page
+
sz
,
"%s"
,
s
eq_printf
(
seq
,
"%s"
,
conf
->
mirrors
[
i
].
rdev
&&
conf
->
mirrors
[
i
].
rdev
&&
conf
->
mirrors
[
i
].
rdev
->
in_sync
?
"U"
:
"_"
);
conf
->
mirrors
[
i
].
rdev
->
in_sync
?
"U"
:
"_"
);
sz
+=
sprintf
(
page
+
sz
,
"]"
);
seq_printf
(
seq
,
"]"
);
return
sz
;
}
}
#define LAST_DISK KERN_ALERT \
#define LAST_DISK KERN_ALERT \
...
@@ -624,10 +622,9 @@ static void error(mddev_t *mddev, mdk_rdev_t *rdev)
...
@@ -624,10 +622,9 @@ static void error(mddev_t *mddev, mdk_rdev_t *rdev)
mddev
->
degraded
++
;
mddev
->
degraded
++
;
conf
->
working_disks
--
;
conf
->
working_disks
--
;
/*
/*
* if recovery
was running, stop it now
.
* if recovery
is running, make sure it aborts
.
*/
*/
if
(
mddev
->
recovery_running
)
set_bit
(
MD_RECOVERY_ERR
,
&
mddev
->
recovery
);
mddev
->
recovery_running
=
-
EIO
;
}
}
rdev
->
in_sync
=
0
;
rdev
->
in_sync
=
0
;
rdev
->
faulty
=
1
;
rdev
->
faulty
=
1
;
...
@@ -859,7 +856,7 @@ static void sync_request_write(mddev_t *mddev, r1bio_t *r1_bio)
...
@@ -859,7 +856,7 @@ static void sync_request_write(mddev_t *mddev, r1bio_t *r1_bio)
mbio
=
bio_clone
(
bio
,
GFP_NOIO
);
mbio
=
bio_clone
(
bio
,
GFP_NOIO
);
r1_bio
->
write_bios
[
i
]
=
mbio
;
r1_bio
->
write_bios
[
i
]
=
mbio
;
mbio
->
bi_bdev
=
conf
->
mirrors
[
i
].
rdev
->
bdev
;
mbio
->
bi_bdev
=
conf
->
mirrors
[
i
].
rdev
->
bdev
;
mbio
->
bi_sector
=
r1_bio
->
sector
;
mbio
->
bi_sector
=
r1_bio
->
sector
|
conf
->
mirrors
[
i
].
rdev
->
data_offset
;
mbio
->
bi_end_io
=
end_sync_write
;
mbio
->
bi_end_io
=
end_sync_write
;
mbio
->
bi_rw
=
WRITE
;
mbio
->
bi_rw
=
WRITE
;
mbio
->
bi_private
=
r1_bio
;
mbio
->
bi_private
=
r1_bio
;
...
@@ -900,17 +897,17 @@ static void sync_request_write(mddev_t *mddev, r1bio_t *r1_bio)
...
@@ -900,17 +897,17 @@ static void sync_request_write(mddev_t *mddev, r1bio_t *r1_bio)
* 3. Performs writes following reads for array syncronising.
* 3. Performs writes following reads for array syncronising.
*/
*/
static
void
raid1d
(
void
*
data
)
static
void
raid1d
(
mddev_t
*
mddev
)
{
{
struct
list_head
*
head
=
&
retry_list_head
;
struct
list_head
*
head
=
&
retry_list_head
;
r1bio_t
*
r1_bio
;
r1bio_t
*
r1_bio
;
struct
bio
*
bio
;
struct
bio
*
bio
;
unsigned
long
flags
;
unsigned
long
flags
;
mddev_t
*
mddev
;
conf_t
*
conf
=
mddev_to_conf
(
mddev
);
conf_t
*
conf
=
data
;
mdk_rdev_t
*
rdev
;
mdk_rdev_t
*
rdev
;
md_handle_safemode
(
conf
->
mddev
);
md_check_recovery
(
mddev
);
md_handle_safemode
(
mddev
);
for
(;;)
{
for
(;;)
{
spin_lock_irqsave
(
&
retry_list_lock
,
flags
);
spin_lock_irqsave
(
&
retry_list_lock
,
flags
);
...
@@ -937,7 +934,7 @@ static void raid1d(void *data)
...
@@ -937,7 +934,7 @@ static void raid1d(void *data)
printk
(
REDIRECT_SECTOR
,
printk
(
REDIRECT_SECTOR
,
bdev_partition_name
(
rdev
->
bdev
),
(
unsigned
long
long
)
r1_bio
->
sector
);
bdev_partition_name
(
rdev
->
bdev
),
(
unsigned
long
long
)
r1_bio
->
sector
);
bio
->
bi_bdev
=
rdev
->
bdev
;
bio
->
bi_bdev
=
rdev
->
bdev
;
bio
->
bi_sector
=
r1_bio
->
sector
;
bio
->
bi_sector
=
r1_bio
->
sector
+
rdev
->
data_offset
;
bio
->
bi_rw
=
r1_bio
->
cmd
;
bio
->
bi_rw
=
r1_bio
->
cmd
;
generic_make_request
(
bio
);
generic_make_request
(
bio
);
...
@@ -1048,7 +1045,7 @@ static int sync_request(mddev_t *mddev, sector_t sector_nr, int go_faster)
...
@@ -1048,7 +1045,7 @@ static int sync_request(mddev_t *mddev, sector_t sector_nr, int go_faster)
read_bio
=
bio_clone
(
r1_bio
->
master_bio
,
GFP_NOIO
);
read_bio
=
bio_clone
(
r1_bio
->
master_bio
,
GFP_NOIO
);
read_bio
->
bi_sector
=
sector_nr
;
read_bio
->
bi_sector
=
sector_nr
+
mirror
->
rdev
->
data_offset
;
read_bio
->
bi_bdev
=
mirror
->
rdev
->
bdev
;
read_bio
->
bi_bdev
=
mirror
->
rdev
->
bdev
;
read_bio
->
bi_end_io
=
end_sync_read
;
read_bio
->
bi_end_io
=
end_sync_read
;
read_bio
->
bi_rw
=
READ
;
read_bio
->
bi_rw
=
READ
;
...
@@ -1190,10 +1187,8 @@ static int run(mddev_t *mddev)
...
@@ -1190,10 +1187,8 @@ static int run(mddev_t *mddev)
{
{
snprintf
(
conf
->
thread_name
,
MD_THREAD_NAME_MAX
,
"raid1d_md%d"
,
mdidx
(
mddev
));
mddev
->
thread
=
md_register_thread
(
raid1d
,
mddev
,
"md%d_raid1"
);
if
(
!
mddev
->
thread
)
{
conf
->
thread
=
md_register_thread
(
raid1d
,
conf
,
conf
->
thread_name
);
if
(
!
conf
->
thread
)
{
printk
(
THREAD_ERROR
,
mdidx
(
mddev
));
printk
(
THREAD_ERROR
,
mdidx
(
mddev
));
goto
out_free_conf
;
goto
out_free_conf
;
}
}
...
@@ -1219,7 +1214,8 @@ static int stop(mddev_t *mddev)
...
@@ -1219,7 +1214,8 @@ static int stop(mddev_t *mddev)
{
{
conf_t
*
conf
=
mddev_to_conf
(
mddev
);
conf_t
*
conf
=
mddev_to_conf
(
mddev
);
md_unregister_thread
(
conf
->
thread
);
md_unregister_thread
(
mddev
->
thread
);
mddev
->
thread
=
NULL
;
if
(
conf
->
r1bio_pool
)
if
(
conf
->
r1bio_pool
)
mempool_destroy
(
conf
->
r1bio_pool
);
mempool_destroy
(
conf
->
r1bio_pool
);
kfree
(
conf
);
kfree
(
conf
);
...
...
drivers/md/raid5.c
View file @
baf1aaad
...
@@ -71,12 +71,12 @@ static inline void __release_stripe(raid5_conf_t *conf, struct stripe_head *sh)
...
@@ -71,12 +71,12 @@ static inline void __release_stripe(raid5_conf_t *conf, struct stripe_head *sh)
list_add_tail
(
&
sh
->
lru
,
&
conf
->
delayed_list
);
list_add_tail
(
&
sh
->
lru
,
&
conf
->
delayed_list
);
else
else
list_add_tail
(
&
sh
->
lru
,
&
conf
->
handle_list
);
list_add_tail
(
&
sh
->
lru
,
&
conf
->
handle_list
);
md_wakeup_thread
(
conf
->
thread
);
md_wakeup_thread
(
conf
->
mddev
->
thread
);
}
else
{
}
else
{
if
(
test_and_clear_bit
(
STRIPE_PREREAD_ACTIVE
,
&
sh
->
state
))
{
if
(
test_and_clear_bit
(
STRIPE_PREREAD_ACTIVE
,
&
sh
->
state
))
{
atomic_dec
(
&
conf
->
preread_active_stripes
);
atomic_dec
(
&
conf
->
preread_active_stripes
);
if
(
atomic_read
(
&
conf
->
preread_active_stripes
)
<
IO_THRESHOLD
)
if
(
atomic_read
(
&
conf
->
preread_active_stripes
)
<
IO_THRESHOLD
)
md_wakeup_thread
(
conf
->
thread
);
md_wakeup_thread
(
conf
->
mddev
->
thread
);
}
}
list_add_tail
(
&
sh
->
lru
,
&
conf
->
inactive_list
);
list_add_tail
(
&
sh
->
lru
,
&
conf
->
inactive_list
);
atomic_dec
(
&
conf
->
active_stripes
);
atomic_dec
(
&
conf
->
active_stripes
);
...
@@ -463,10 +463,9 @@ static void error(mddev_t *mddev, mdk_rdev_t *rdev)
...
@@ -463,10 +463,9 @@ static void error(mddev_t *mddev, mdk_rdev_t *rdev)
conf
->
failed_disks
++
;
conf
->
failed_disks
++
;
rdev
->
in_sync
=
0
;
rdev
->
in_sync
=
0
;
/*
/*
* if recovery was running,
stop it now
.
* if recovery was running,
make sure it aborts
.
*/
*/
if
(
mddev
->
recovery_running
)
set_bit
(
MD_RECOVERY_ERR
,
&
mddev
->
recovery
);
mddev
->
recovery_running
=
-
EIO
;
}
}
rdev
->
faulty
=
1
;
rdev
->
faulty
=
1
;
printk
(
KERN_ALERT
printk
(
KERN_ALERT
...
@@ -913,7 +912,7 @@ static void handle_stripe(struct stripe_head *sh)
...
@@ -913,7 +912,7 @@ static void handle_stripe(struct stripe_head *sh)
struct
bio
*
nextbi
=
bi
->
bi_next
;
struct
bio
*
nextbi
=
bi
->
bi_next
;
clear_bit
(
BIO_UPTODATE
,
&
bi
->
bi_flags
);
clear_bit
(
BIO_UPTODATE
,
&
bi
->
bi_flags
);
if
(
--
bi
->
bi_phys_segments
==
0
)
{
if
(
--
bi
->
bi_phys_segments
==
0
)
{
md_write_end
(
conf
->
mddev
,
conf
->
thread
);
md_write_end
(
conf
->
mddev
);
bi
->
bi_next
=
return_bi
;
bi
->
bi_next
=
return_bi
;
return_bi
=
bi
;
return_bi
=
bi
;
}
}
...
@@ -970,7 +969,7 @@ static void handle_stripe(struct stripe_head *sh)
...
@@ -970,7 +969,7 @@ static void handle_stripe(struct stripe_head *sh)
while
(
wbi
&&
wbi
->
bi_sector
<
dev
->
sector
+
STRIPE_SECTORS
)
{
while
(
wbi
&&
wbi
->
bi_sector
<
dev
->
sector
+
STRIPE_SECTORS
)
{
wbi2
=
wbi
->
bi_next
;
wbi2
=
wbi
->
bi_next
;
if
(
--
wbi
->
bi_phys_segments
==
0
)
{
if
(
--
wbi
->
bi_phys_segments
==
0
)
{
md_write_end
(
conf
->
mddev
,
conf
->
thread
);
md_write_end
(
conf
->
mddev
);
wbi
->
bi_next
=
return_bi
;
wbi
->
bi_next
=
return_bi
;
return_bi
=
wbi
;
return_bi
=
wbi
;
}
}
...
@@ -1113,7 +1112,7 @@ static void handle_stripe(struct stripe_head *sh)
...
@@ -1113,7 +1112,7 @@ static void handle_stripe(struct stripe_head *sh)
if
(
test_and_clear_bit
(
STRIPE_PREREAD_ACTIVE
,
&
sh
->
state
))
{
if
(
test_and_clear_bit
(
STRIPE_PREREAD_ACTIVE
,
&
sh
->
state
))
{
atomic_dec
(
&
conf
->
preread_active_stripes
);
atomic_dec
(
&
conf
->
preread_active_stripes
);
if
(
atomic_read
(
&
conf
->
preread_active_stripes
)
<
IO_THRESHOLD
)
if
(
atomic_read
(
&
conf
->
preread_active_stripes
)
<
IO_THRESHOLD
)
md_wakeup_thread
(
conf
->
thread
);
md_wakeup_thread
(
conf
->
mddev
->
thread
);
}
}
}
}
}
}
...
@@ -1207,7 +1206,7 @@ static void handle_stripe(struct stripe_head *sh)
...
@@ -1207,7 +1206,7 @@ static void handle_stripe(struct stripe_head *sh)
bi
->
bi_bdev
=
rdev
->
bdev
;
bi
->
bi_bdev
=
rdev
->
bdev
;
PRINTK
(
"for %llu schedule op %ld on disc %d
\n
"
,
(
unsigned
long
long
)
sh
->
sector
,
bi
->
bi_rw
,
i
);
PRINTK
(
"for %llu schedule op %ld on disc %d
\n
"
,
(
unsigned
long
long
)
sh
->
sector
,
bi
->
bi_rw
,
i
);
atomic_inc
(
&
sh
->
count
);
atomic_inc
(
&
sh
->
count
);
bi
->
bi_sector
=
sh
->
sector
;
bi
->
bi_sector
=
sh
->
sector
+
rdev
->
data_offset
;
bi
->
bi_flags
=
1
<<
BIO_UPTODATE
;
bi
->
bi_flags
=
1
<<
BIO_UPTODATE
;
bi
->
bi_vcnt
=
1
;
bi
->
bi_vcnt
=
1
;
bi
->
bi_idx
=
0
;
bi
->
bi_idx
=
0
;
...
@@ -1251,7 +1250,7 @@ static void raid5_unplug_device(void *data)
...
@@ -1251,7 +1250,7 @@ static void raid5_unplug_device(void *data)
if
(
blk_remove_plug
(
q
))
if
(
blk_remove_plug
(
q
))
raid5_activate_delayed
(
conf
);
raid5_activate_delayed
(
conf
);
md_wakeup_thread
(
conf
->
thread
);
md_wakeup_thread
(
mddev
->
thread
);
spin_unlock_irqrestore
(
&
conf
->
device_lock
,
flags
);
spin_unlock_irqrestore
(
&
conf
->
device_lock
,
flags
);
}
}
...
@@ -1304,7 +1303,7 @@ static int make_request (request_queue_t *q, struct bio * bi)
...
@@ -1304,7 +1303,7 @@ static int make_request (request_queue_t *q, struct bio * bi)
int
bytes
=
bi
->
bi_size
;
int
bytes
=
bi
->
bi_size
;
if
(
bio_data_dir
(
bi
)
==
WRITE
)
if
(
bio_data_dir
(
bi
)
==
WRITE
)
md_write_end
(
mddev
,
conf
->
thread
);
md_write_end
(
mddev
);
bi
->
bi_size
=
0
;
bi
->
bi_size
=
0
;
bi
->
bi_end_io
(
bi
,
bytes
,
0
);
bi
->
bi_end_io
(
bi
,
bytes
,
0
);
}
}
...
@@ -1356,16 +1355,17 @@ static int sync_request (mddev_t *mddev, sector_t sector_nr, int go_faster)
...
@@ -1356,16 +1355,17 @@ static int sync_request (mddev_t *mddev, sector_t sector_nr, int go_faster)
* During the scan, completed stripes are saved for us by the interrupt
* During the scan, completed stripes are saved for us by the interrupt
* handler, so that they will not have to wait for our next wakeup.
* handler, so that they will not have to wait for our next wakeup.
*/
*/
static
void
raid5d
(
void
*
data
)
static
void
raid5d
(
mddev_t
*
mddev
)
{
{
struct
stripe_head
*
sh
;
struct
stripe_head
*
sh
;
raid5_conf_t
*
conf
=
data
;
raid5_conf_t
*
conf
=
mddev_to_conf
(
mddev
);
mddev_t
*
mddev
=
conf
->
mddev
;
int
handled
;
int
handled
;
PRINTK
(
"+++ raid5d active
\n
"
);
PRINTK
(
"+++ raid5d active
\n
"
);
md_check_recovery
(
mddev
);
md_handle_safemode
(
mddev
);
md_handle_safemode
(
mddev
);
handled
=
0
;
handled
=
0
;
spin_lock_irq
(
&
conf
->
device_lock
);
spin_lock_irq
(
&
conf
->
device_lock
);
while
(
1
)
{
while
(
1
)
{
...
@@ -1486,10 +1486,8 @@ static int run (mddev_t *mddev)
...
@@ -1486,10 +1486,8 @@ static int run (mddev_t *mddev)
}
}
{
{
snprintf
(
conf
->
thread_name
,
MD_THREAD_NAME_MAX
,
"raid5d_md%d"
,
mdidx
(
mddev
));
mddev
->
thread
=
md_register_thread
(
raid5d
,
mddev
,
"md%d_raid5"
);
if
(
!
mddev
->
thread
)
{
conf
->
thread
=
md_register_thread
(
raid5d
,
conf
,
conf
->
thread_name
);
if
(
!
conf
->
thread
)
{
printk
(
KERN_ERR
"raid5: couldn't allocate thread for md%d
\n
"
,
mdidx
(
mddev
));
printk
(
KERN_ERR
"raid5: couldn't allocate thread for md%d
\n
"
,
mdidx
(
mddev
));
goto
abort
;
goto
abort
;
}
}
...
@@ -1500,7 +1498,7 @@ static int run (mddev_t *mddev)
...
@@ -1500,7 +1498,7 @@ static int run (mddev_t *mddev)
if
(
grow_stripes
(
conf
,
conf
->
max_nr_stripes
))
{
if
(
grow_stripes
(
conf
,
conf
->
max_nr_stripes
))
{
printk
(
KERN_ERR
"raid5: couldn't allocate %dkB for buffers
\n
"
,
memory
);
printk
(
KERN_ERR
"raid5: couldn't allocate %dkB for buffers
\n
"
,
memory
);
shrink_stripes
(
conf
);
shrink_stripes
(
conf
);
md_unregister_thread
(
conf
->
thread
);
md_unregister_thread
(
mddev
->
thread
);
goto
abort
;
goto
abort
;
}
else
}
else
printk
(
KERN_INFO
"raid5: allocated %dkB for md%d
\n
"
,
memory
,
mdidx
(
mddev
));
printk
(
KERN_INFO
"raid5: allocated %dkB for md%d
\n
"
,
memory
,
mdidx
(
mddev
));
...
@@ -1536,7 +1534,8 @@ static int stop (mddev_t *mddev)
...
@@ -1536,7 +1534,8 @@ static int stop (mddev_t *mddev)
{
{
raid5_conf_t
*
conf
=
(
raid5_conf_t
*
)
mddev
->
private
;
raid5_conf_t
*
conf
=
(
raid5_conf_t
*
)
mddev
->
private
;
md_unregister_thread
(
conf
->
thread
);
md_unregister_thread
(
mddev
->
thread
);
mddev
->
thread
=
NULL
;
shrink_stripes
(
conf
);
shrink_stripes
(
conf
);
free_pages
((
unsigned
long
)
conf
->
stripe_hashtbl
,
HASH_PAGES_ORDER
);
free_pages
((
unsigned
long
)
conf
->
stripe_hashtbl
,
HASH_PAGES_ORDER
);
kfree
(
conf
);
kfree
(
conf
);
...
@@ -1574,29 +1573,26 @@ static void printall (raid5_conf_t *conf)
...
@@ -1574,29 +1573,26 @@ static void printall (raid5_conf_t *conf)
}
}
}
}
spin_unlock_irq
(
&
conf
->
device_lock
);
spin_unlock_irq
(
&
conf
->
device_lock
);
PRINTK
(
"--- raid5d inactive
\n
"
);
}
}
#endif
#endif
static
int
status
(
char
*
page
,
mddev_t
*
mddev
)
static
void
status
(
struct
seq_file
*
seq
,
mddev_t
*
mddev
)
{
{
raid5_conf_t
*
conf
=
(
raid5_conf_t
*
)
mddev
->
private
;
raid5_conf_t
*
conf
=
(
raid5_conf_t
*
)
mddev
->
private
;
int
sz
=
0
,
i
;
int
i
;
s
z
+=
sprintf
(
page
+
sz
,
" level %d, %dk chunk, algorithm %d"
,
mddev
->
level
,
mddev
->
chunk_size
>>
10
,
mddev
->
layout
);
s
eq_printf
(
seq
,
" level %d, %dk chunk, algorithm %d"
,
mddev
->
level
,
mddev
->
chunk_size
>>
10
,
mddev
->
layout
);
s
z
+=
sprintf
(
page
+
sz
,
" [%d/%d] ["
,
conf
->
raid_disks
,
conf
->
working_disks
);
s
eq_printf
(
seq
,
" [%d/%d] ["
,
conf
->
raid_disks
,
conf
->
working_disks
);
for
(
i
=
0
;
i
<
conf
->
raid_disks
;
i
++
)
for
(
i
=
0
;
i
<
conf
->
raid_disks
;
i
++
)
s
z
+=
sprintf
(
page
+
sz
,
"%s"
,
s
eq_printf
(
seq
,
"%s"
,
conf
->
disks
[
i
].
rdev
&&
conf
->
disks
[
i
].
rdev
&&
conf
->
disks
[
i
].
rdev
->
in_sync
?
"U"
:
"_"
);
conf
->
disks
[
i
].
rdev
->
in_sync
?
"U"
:
"_"
);
s
z
+=
sprintf
(
page
+
sz
,
"]"
);
s
eq_printf
(
seq
,
"]"
);
#if RAID5_DEBUG
#if RAID5_DEBUG
#define D(x) \
#define D(x) \
s
z += sprintf (page+sz
, "<"#x":%d>", atomic_read(&conf->x))
s
eq_printf (seq
, "<"#x":%d>", atomic_read(&conf->x))
printall
(
conf
);
printall
(
conf
);
#endif
#endif
return
sz
;
}
}
static
void
print_raid5_conf
(
raid5_conf_t
*
conf
)
static
void
print_raid5_conf
(
raid5_conf_t
*
conf
)
...
...
fs/lockd/svclock.c
View file @
baf1aaad
...
@@ -305,8 +305,6 @@ nlmsvc_lock(struct svc_rqst *rqstp, struct nlm_file *file,
...
@@ -305,8 +305,6 @@ nlmsvc_lock(struct svc_rqst *rqstp, struct nlm_file *file,
(
long
long
)
lock
->
fl
.
fl_end
,
(
long
long
)
lock
->
fl
.
fl_end
,
wait
);
wait
);
/* Lock file against concurrent access */
down
(
&
file
->
f_sema
);
/* Get existing block (in case client is busy-waiting) */
/* Get existing block (in case client is busy-waiting) */
block
=
nlmsvc_lookup_block
(
file
,
lock
,
0
);
block
=
nlmsvc_lookup_block
(
file
,
lock
,
0
);
...
@@ -314,6 +312,9 @@ nlmsvc_lock(struct svc_rqst *rqstp, struct nlm_file *file,
...
@@ -314,6 +312,9 @@ nlmsvc_lock(struct svc_rqst *rqstp, struct nlm_file *file,
lock
->
fl
.
fl_flags
|=
FL_LOCKD
;
lock
->
fl
.
fl_flags
|=
FL_LOCKD
;
again:
again:
/* Lock file against concurrent access */
down
(
&
file
->
f_sema
);
if
(
!
(
conflock
=
posix_test_lock
(
&
file
->
f_file
,
&
lock
->
fl
)))
{
if
(
!
(
conflock
=
posix_test_lock
(
&
file
->
f_file
,
&
lock
->
fl
)))
{
error
=
posix_lock_file
(
&
file
->
f_file
,
&
lock
->
fl
);
error
=
posix_lock_file
(
&
file
->
f_file
,
&
lock
->
fl
);
...
@@ -346,7 +347,10 @@ nlmsvc_lock(struct svc_rqst *rqstp, struct nlm_file *file,
...
@@ -346,7 +347,10 @@ nlmsvc_lock(struct svc_rqst *rqstp, struct nlm_file *file,
/* If we don't have a block, create and initialize it. Then
/* If we don't have a block, create and initialize it. Then
* retry because we may have slept in kmalloc. */
* retry because we may have slept in kmalloc. */
/* We have to release f_sema as nlmsvc_create_block may try to
* to claim it while doing host garbage collection */
if
(
block
==
NULL
)
{
if
(
block
==
NULL
)
{
up
(
&
file
->
f_sema
);
dprintk
(
"lockd: blocking on this lock (allocating).
\n
"
);
dprintk
(
"lockd: blocking on this lock (allocating).
\n
"
);
if
(
!
(
block
=
nlmsvc_create_block
(
rqstp
,
file
,
lock
,
cookie
)))
if
(
!
(
block
=
nlmsvc_create_block
(
rqstp
,
file
,
lock
,
cookie
)))
return
nlm_lck_denied_nolocks
;
return
nlm_lck_denied_nolocks
;
...
...
fs/nfsd/export.c
View file @
baf1aaad
...
@@ -294,7 +294,9 @@ int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen)
...
@@ -294,7 +294,9 @@ int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen)
/* client */
/* client */
len
=
qword_get
(
&
mesg
,
buf
,
PAGE_SIZE
);
len
=
qword_get
(
&
mesg
,
buf
,
PAGE_SIZE
);
if
(
len
<=
0
)
return
-
EINVAL
;
err
=
-
EINVAL
;
if
(
len
<=
0
)
goto
out
;
err
=
-
ENOENT
;
err
=
-
ENOENT
;
dom
=
auth_domain_find
(
buf
);
dom
=
auth_domain_find
(
buf
);
if
(
!
dom
)
if
(
!
dom
)
...
@@ -473,8 +475,14 @@ exp_get_by_name(svc_client *clp, struct vfsmount *mnt, struct dentry *dentry,
...
@@ -473,8 +475,14 @@ exp_get_by_name(svc_client *clp, struct vfsmount *mnt, struct dentry *dentry,
exp
=
svc_export_lookup
(
&
key
,
0
);
exp
=
svc_export_lookup
(
&
key
,
0
);
if
(
exp
!=
NULL
)
if
(
exp
!=
NULL
)
if
(
cache_check
(
&
svc_export_cache
,
&
exp
->
h
,
reqp
))
switch
(
cache_check
(
&
svc_export_cache
,
&
exp
->
h
,
reqp
))
{
case
0
:
break
;
case
-
EAGAIN
:
exp
=
ERR_PTR
(
-
EAGAIN
);
break
;
default:
exp
=
NULL
;
exp
=
NULL
;
}
return
exp
;
return
exp
;
}
}
...
@@ -915,7 +923,8 @@ struct flags {
...
@@ -915,7 +923,8 @@ struct flags {
{
NFSEXP_UIDMAP
,
{
"uidmap"
,
""
}},
{
NFSEXP_UIDMAP
,
{
"uidmap"
,
""
}},
{
NFSEXP_KERBEROS
,
{
"kerberos"
,
""
}},
{
NFSEXP_KERBEROS
,
{
"kerberos"
,
""
}},
{
NFSEXP_SUNSECURE
,
{
"sunsecure"
,
""
}},
{
NFSEXP_SUNSECURE
,
{
"sunsecure"
,
""
}},
{
NFSEXP_CROSSMNT
,
{
"nohide"
,
""
}},
{
NFSEXP_NOHIDE
,
{
"nohide"
,
""
}},
{
NFSEXP_CROSSMNT
,
{
"crossmnt"
,
""
}},
{
NFSEXP_NOSUBTREECHECK
,
{
"no_subtree_check"
,
""
}},
{
NFSEXP_NOSUBTREECHECK
,
{
"no_subtree_check"
,
""
}},
{
NFSEXP_NOAUTHNLM
,
{
"insecure_locks"
,
""
}},
{
NFSEXP_NOAUTHNLM
,
{
"insecure_locks"
,
""
}},
#ifdef MSNFS
#ifdef MSNFS
...
...
fs/nfsd/vfs.c
View file @
baf1aaad
...
@@ -79,7 +79,7 @@ static struct raparms * raparm_cache;
...
@@ -79,7 +79,7 @@ static struct raparms * raparm_cache;
* N.B. After this call _both_ fhp and resfh need an fh_put
* N.B. After this call _both_ fhp and resfh need an fh_put
*
*
* If the lookup would cross a mountpoint, and the mounted filesystem
* If the lookup would cross a mountpoint, and the mounted filesystem
* is exported to the client with NFSEXP_
CROSSMNT
, then the lookup is
* is exported to the client with NFSEXP_
NOHIDE
, then the lookup is
* accepted as it stands and the mounted directory is
* accepted as it stands and the mounted directory is
* returned. Otherwise the covered directory is returned.
* returned. Otherwise the covered directory is returned.
* NOTE: this mountpoint crossing is not supported properly by all
* NOTE: this mountpoint crossing is not supported properly by all
...
@@ -115,7 +115,7 @@ nfsd_lookup(struct svc_rqst *rqstp, struct svc_fh *fhp, const char *name,
...
@@ -115,7 +115,7 @@ nfsd_lookup(struct svc_rqst *rqstp, struct svc_fh *fhp, const char *name,
read_lock
(
&
dparent_lock
);
read_lock
(
&
dparent_lock
);
dentry
=
dget
(
dparent
->
d_parent
);
dentry
=
dget
(
dparent
->
d_parent
);
read_unlock
(
&
dparent_lock
);
read_unlock
(
&
dparent_lock
);
}
else
if
(
!
EX_
CROSSMNT
(
exp
))
}
else
if
(
!
EX_
NOHIDE
(
exp
))
dentry
=
dget
(
dparent
);
/* .. == . just like at / */
dentry
=
dget
(
dparent
);
/* .. == . just like at / */
else
{
else
{
/* checking mountpoint crossing is very different when stepping up */
/* checking mountpoint crossing is very different when stepping up */
...
@@ -133,6 +133,12 @@ nfsd_lookup(struct svc_rqst *rqstp, struct svc_fh *fhp, const char *name,
...
@@ -133,6 +133,12 @@ nfsd_lookup(struct svc_rqst *rqstp, struct svc_fh *fhp, const char *name,
exp2
=
exp_parent
(
exp
->
ex_client
,
mnt
,
dentry
,
exp2
=
exp_parent
(
exp
->
ex_client
,
mnt
,
dentry
,
&
rqstp
->
rq_chandle
);
&
rqstp
->
rq_chandle
);
if
(
IS_ERR
(
exp2
))
{
err
=
PTR_ERR
(
exp2
);
dput
(
dentry
);
mntput
(
mnt
);
goto
out
;
}
if
(
!
exp2
)
{
if
(
!
exp2
)
{
dput
(
dentry
);
dput
(
dentry
);
dentry
=
dget
(
dparent
);
dentry
=
dget
(
dparent
);
...
@@ -157,9 +163,19 @@ nfsd_lookup(struct svc_rqst *rqstp, struct svc_fh *fhp, const char *name,
...
@@ -157,9 +163,19 @@ nfsd_lookup(struct svc_rqst *rqstp, struct svc_fh *fhp, const char *name,
struct
dentry
*
mounts
=
dget
(
dentry
);
struct
dentry
*
mounts
=
dget
(
dentry
);
while
(
follow_down
(
&
mnt
,
&
mounts
)
&&
d_mountpoint
(
mounts
))
while
(
follow_down
(
&
mnt
,
&
mounts
)
&&
d_mountpoint
(
mounts
))
;
;
exp2
=
exp_get_by_name
(
exp
->
ex_client
,
mnt
,
exp2
=
exp_get_by_name
(
exp
->
ex_client
,
mnt
,
mounts
,
&
rqstp
->
rq_chandle
);
mounts
,
&
rqstp
->
rq_chandle
);
if
(
exp2
&&
EX_CROSSMNT
(
exp2
))
{
if
(
IS_ERR
(
exp2
))
{
err
=
PTR_ERR
(
exp2
);
dput
(
mounts
);
dput
(
dentry
);
mntput
(
mnt
);
goto
out
;
}
if
(
exp2
&&
((
exp
->
ex_flags
&
NFSEXP_CROSSMNT
)
||
EX_NOHIDE
(
exp2
)))
{
/* successfully crossed mount point */
/* successfully crossed mount point */
exp_put
(
exp
);
exp_put
(
exp
);
exp
=
exp2
;
exp
=
exp2
;
...
...
fs/reiserfs/journal.c
View file @
baf1aaad
...
@@ -1310,6 +1310,10 @@ static void free_journal_ram(struct super_block *p_s_sb) {
...
@@ -1310,6 +1310,10 @@ static void free_journal_ram(struct super_block *p_s_sb) {
if
(
SB_JOURNAL
(
p_s_sb
)
->
j_header_bh
)
{
if
(
SB_JOURNAL
(
p_s_sb
)
->
j_header_bh
)
{
brelse
(
SB_JOURNAL
(
p_s_sb
)
->
j_header_bh
)
;
brelse
(
SB_JOURNAL
(
p_s_sb
)
->
j_header_bh
)
;
}
}
/* j_header_bh is on the journal dev, make sure not to release the journal
* dev until we brelse j_header_bh
*/
release_journal_dev
(
p_s_sb
,
SB_JOURNAL
(
p_s_sb
));
vfree
(
SB_JOURNAL
(
p_s_sb
))
;
vfree
(
SB_JOURNAL
(
p_s_sb
))
;
}
}
...
@@ -1341,7 +1345,6 @@ static int do_journal_release(struct reiserfs_transaction_handle *th, struct sup
...
@@ -1341,7 +1345,6 @@ static int do_journal_release(struct reiserfs_transaction_handle *th, struct sup
commit_wq
=
NULL
;
commit_wq
=
NULL
;
}
}
release_journal_dev
(
p_s_sb
,
SB_JOURNAL
(
p_s_sb
)
);
free_journal_ram
(
p_s_sb
)
;
free_journal_ram
(
p_s_sb
)
;
return
0
;
return
0
;
...
@@ -1867,24 +1870,18 @@ static int release_journal_dev( struct super_block *super,
...
@@ -1867,24 +1870,18 @@ static int release_journal_dev( struct super_block *super,
int
result
;
int
result
;
result
=
0
;
result
=
0
;
if
(
journal
->
j_dev_file
!=
NULL
)
{
if
(
journal
->
j_dev_file
!=
NULL
)
{
/*
* journal block device was taken via filp_open
*/
result
=
filp_close
(
journal
->
j_dev_file
,
NULL
);
result
=
filp_close
(
journal
->
j_dev_file
,
NULL
);
journal
->
j_dev_file
=
NULL
;
journal
->
j_dev_file
=
NULL
;
journal
->
j_dev_bd
=
NULL
;
journal
->
j_dev_bd
=
NULL
;
}
else
if
(
journal
->
j_dev_bd
!=
NULL
)
{
}
else
if
(
journal
->
j_dev_bd
!=
NULL
)
{
/*
* journal block device was taken via bdget and blkdev_get
*/
result
=
blkdev_put
(
journal
->
j_dev_bd
,
BDEV_FS
);
result
=
blkdev_put
(
journal
->
j_dev_bd
,
BDEV_FS
);
journal
->
j_dev_bd
=
NULL
;
journal
->
j_dev_bd
=
NULL
;
}
}
if
(
result
!=
0
)
{
if
(
result
!=
0
)
{
reiserfs_warning
(
"sh-457: release_journal_dev: Cannot release journal device: %i"
,
result
);
reiserfs_warning
(
"sh-457: release_journal_dev: Cannot release journal device: %i
\n
"
,
result
);
}
}
return
result
;
return
result
;
}
}
...
@@ -1895,6 +1892,7 @@ static int journal_init_dev( struct super_block *super,
...
@@ -1895,6 +1892,7 @@ static int journal_init_dev( struct super_block *super,
{
{
int
result
;
int
result
;
dev_t
jdev
;
dev_t
jdev
;
int
blkdev_mode
=
FMODE_READ
|
FMODE_WRITE
;
result
=
0
;
result
=
0
;
...
@@ -1902,12 +1900,16 @@ static int journal_init_dev( struct super_block *super,
...
@@ -1902,12 +1900,16 @@ static int journal_init_dev( struct super_block *super,
journal
->
j_dev_file
=
NULL
;
journal
->
j_dev_file
=
NULL
;
jdev
=
SB_ONDISK_JOURNAL_DEVICE
(
super
)
?
jdev
=
SB_ONDISK_JOURNAL_DEVICE
(
super
)
?
SB_ONDISK_JOURNAL_DEVICE
(
super
)
:
super
->
s_dev
;
SB_ONDISK_JOURNAL_DEVICE
(
super
)
:
super
->
s_dev
;
if
(
bdev_read_only
(
super
->
s_bdev
))
blkdev_mode
=
FMODE_READ
;
/* there is no "jdev" option and journal is on separate device */
/* there is no "jdev" option and journal is on separate device */
if
(
(
!
jdev_name
||
!
jdev_name
[
0
]
)
)
{
if
(
(
!
jdev_name
||
!
jdev_name
[
0
]
)
)
{
journal
->
j_dev_bd
=
bdget
(
jdev
);
journal
->
j_dev_bd
=
bdget
(
jdev
);
if
(
journal
->
j_dev_bd
)
if
(
journal
->
j_dev_bd
)
result
=
blkdev_get
(
journal
->
j_dev_bd
,
result
=
blkdev_get
(
journal
->
j_dev_bd
,
FMODE_READ
|
FMODE_WRITE
,
0
,
blkdev_mode
,
0
,
BDEV_FS
);
BDEV_FS
);
else
else
result
=
-
ENOMEM
;
result
=
-
ENOMEM
;
...
@@ -1928,10 +1930,10 @@ static int journal_init_dev( struct super_block *super,
...
@@ -1928,10 +1930,10 @@ static int journal_init_dev( struct super_block *super,
jdev_inode
=
journal
->
j_dev_file
->
f_dentry
->
d_inode
;
jdev_inode
=
journal
->
j_dev_file
->
f_dentry
->
d_inode
;
journal
->
j_dev_bd
=
jdev_inode
->
i_bdev
;
journal
->
j_dev_bd
=
jdev_inode
->
i_bdev
;
if
(
!
S_ISBLK
(
jdev_inode
->
i_mode
)
)
{
if
(
!
S_ISBLK
(
jdev_inode
->
i_mode
)
)
{
printk
(
"journal_init_dev: '%s' is not a block device"
,
jdev_name
);
printk
(
"journal_init_dev: '%s' is not a block device
\n
"
,
jdev_name
);
result
=
-
ENOTBLK
;
result
=
-
ENOTBLK
;
}
else
if
(
jdev_inode
->
i_bdev
==
NULL
)
{
}
else
if
(
jdev_inode
->
i_bdev
==
NULL
)
{
printk
(
"journal_init_dev: bdev uninitialized for '%s'"
,
jdev_name
);
printk
(
"journal_init_dev: bdev uninitialized for '%s'
\n
"
,
jdev_name
);
result
=
-
ENOMEM
;
result
=
-
ENOMEM
;
}
else
{
}
else
{
/* ok */
/* ok */
...
@@ -1941,12 +1943,12 @@ static int journal_init_dev( struct super_block *super,
...
@@ -1941,12 +1943,12 @@ static int journal_init_dev( struct super_block *super,
}
else
{
}
else
{
result
=
PTR_ERR
(
journal
->
j_dev_file
);
result
=
PTR_ERR
(
journal
->
j_dev_file
);
journal
->
j_dev_file
=
NULL
;
journal
->
j_dev_file
=
NULL
;
printk
(
"journal_init_dev: Cannot open '%s': %i"
,
jdev_name
,
result
);
printk
(
"journal_init_dev: Cannot open '%s': %i
\n
"
,
jdev_name
,
result
);
}
}
if
(
result
!=
0
)
{
if
(
result
!=
0
)
{
release_journal_dev
(
super
,
journal
);
release_journal_dev
(
super
,
journal
);
}
}
printk
(
"journal_init_dev: journal device: %s"
,
bdevname
(
journal
->
j_dev_bd
));
printk
(
"journal_init_dev: journal device: %s
\n
"
,
bdevname
(
journal
->
j_dev_bd
));
return
result
;
return
result
;
}
}
...
@@ -1960,20 +1962,24 @@ int journal_init(struct super_block *p_s_sb, const char * j_dev_name, int old_fo
...
@@ -1960,20 +1962,24 @@ int journal_init(struct super_block *p_s_sb, const char * j_dev_name, int old_fo
struct
reiserfs_journal_header
*
jh
;
struct
reiserfs_journal_header
*
jh
;
struct
reiserfs_journal
*
journal
;
struct
reiserfs_journal
*
journal
;
if
(
sizeof
(
struct
reiserfs_journal_commit
)
!=
4096
||
if
(
sizeof
(
struct
reiserfs_journal_commit
)
!=
4096
||
sizeof
(
struct
reiserfs_journal_desc
)
!=
4096
sizeof
(
struct
reiserfs_journal_desc
)
!=
4096
)
{
)
{
printk
(
"journal-1249: commit or desc struct not 4096 %Zd %Zd
\n
"
,
sizeof
(
struct
reiserfs_journal_commit
),
printk
(
"journal-1249: commit or desc struct not 4096 %Zd %Zd
\n
"
,
sizeof
(
struct
reiserfs_journal_commit
),
sizeof
(
struct
reiserfs_journal_desc
))
;
sizeof
(
struct
reiserfs_journal_desc
))
;
return
1
;
return
1
;
}
}
journal
=
SB_JOURNAL
(
p_s_sb
)
=
vmalloc
(
sizeof
(
struct
reiserfs_journal
))
;
journal
=
SB_JOURNAL
(
p_s_sb
)
=
vmalloc
(
sizeof
(
struct
reiserfs_journal
))
;
if
(
!
journal
)
{
if
(
!
journal
)
{
printk
(
"journal-1256: unable to get memory for journal structure
\n
"
)
;
printk
(
"journal-1256: unable to get memory for journal structure
\n
"
)
;
return
1
;
return
1
;
}
}
memset
(
journal
,
0
,
sizeof
(
struct
reiserfs_journal
))
;
memset
(
journal
,
0
,
sizeof
(
struct
reiserfs_journal
))
;
INIT_LIST_HEAD
(
&
SB_JOURNAL
(
p_s_sb
)
->
j_bitmap_nodes
)
;
INIT_LIST_HEAD
(
&
SB_JOURNAL
(
p_s_sb
)
->
j_prealloc_list
);
reiserfs_allocate_list_bitmaps
(
p_s_sb
,
SB_JOURNAL
(
p_s_sb
)
->
j_list_bitmap
,
SB_BMAP_NR
(
p_s_sb
))
;
allocate_bitmap_nodes
(
p_s_sb
)
;
/* reserved for journal area support */
/* reserved for journal area support */
SB_JOURNAL_1st_RESERVED_BLOCK
(
p_s_sb
)
=
(
old_format
?
SB_JOURNAL_1st_RESERVED_BLOCK
(
p_s_sb
)
=
(
old_format
?
...
@@ -1983,7 +1989,7 @@ int journal_init(struct super_block *p_s_sb, const char * j_dev_name, int old_fo
...
@@ -1983,7 +1989,7 @@ int journal_init(struct super_block *p_s_sb, const char * j_dev_name, int old_fo
if
(
journal_init_dev
(
p_s_sb
,
journal
,
j_dev_name
)
!=
0
)
{
if
(
journal_init_dev
(
p_s_sb
,
journal
,
j_dev_name
)
!=
0
)
{
printk
(
"sh-462: unable to initialize jornal device
\n
"
);
printk
(
"sh-462: unable to initialize jornal device
\n
"
);
return
1
;
goto
free_and_return
;
}
}
rs
=
SB_DISK_SUPER_BLOCK
(
p_s_sb
);
rs
=
SB_DISK_SUPER_BLOCK
(
p_s_sb
);
...
@@ -1993,8 +1999,7 @@ int journal_init(struct super_block *p_s_sb, const char * j_dev_name, int old_fo
...
@@ -1993,8 +1999,7 @@ int journal_init(struct super_block *p_s_sb, const char * j_dev_name, int old_fo
SB_ONDISK_JOURNAL_1st_BLOCK
(
p_s_sb
)
+
SB_ONDISK_JOURNAL_SIZE
(
p_s_sb
));
SB_ONDISK_JOURNAL_1st_BLOCK
(
p_s_sb
)
+
SB_ONDISK_JOURNAL_SIZE
(
p_s_sb
));
if
(
!
bhjh
)
{
if
(
!
bhjh
)
{
printk
(
"sh-459: unable to read journal header
\n
"
)
;
printk
(
"sh-459: unable to read journal header
\n
"
)
;
release_journal_dev
(
p_s_sb
,
journal
);
goto
free_and_return
;
return
1
;
}
}
jh
=
(
struct
reiserfs_journal_header
*
)(
bhjh
->
b_data
);
jh
=
(
struct
reiserfs_journal_header
*
)(
bhjh
->
b_data
);
...
@@ -2005,8 +2010,7 @@ int journal_init(struct super_block *p_s_sb, const char * j_dev_name, int old_fo
...
@@ -2005,8 +2010,7 @@ int journal_init(struct super_block *p_s_sb, const char * j_dev_name, int old_fo
jh
->
jh_journal
.
jp_journal_magic
,
bdevname
(
SB_JOURNAL
(
p_s_sb
)
->
j_dev_bd
),
jh
->
jh_journal
.
jp_journal_magic
,
bdevname
(
SB_JOURNAL
(
p_s_sb
)
->
j_dev_bd
),
sb_jp_journal_magic
(
rs
),
reiserfs_bdevname
(
p_s_sb
));
sb_jp_journal_magic
(
rs
),
reiserfs_bdevname
(
p_s_sb
));
brelse
(
bhjh
);
brelse
(
bhjh
);
release_journal_dev
(
p_s_sb
,
journal
);
goto
free_and_return
;
return
1
;
}
}
SB_JOURNAL_TRANS_MAX
(
p_s_sb
)
=
le32_to_cpu
(
jh
->
jh_journal
.
jp_journal_trans_max
);
SB_JOURNAL_TRANS_MAX
(
p_s_sb
)
=
le32_to_cpu
(
jh
->
jh_journal
.
jp_journal_trans_max
);
...
@@ -2064,7 +2068,6 @@ int journal_init(struct super_block *p_s_sb, const char * j_dev_name, int old_fo
...
@@ -2064,7 +2068,6 @@ int journal_init(struct super_block *p_s_sb, const char * j_dev_name, int old_fo
brelse
(
bhjh
);
brelse
(
bhjh
);
SB_JOURNAL
(
p_s_sb
)
->
j_list_bitmap_index
=
0
;
SB_JOURNAL
(
p_s_sb
)
->
j_list_bitmap_index
=
0
;
SB_JOURNAL_LIST_INDEX
(
p_s_sb
)
=
-
10000
;
/* make sure flush_old_commits does not try to flush a list while replay is on */
SB_JOURNAL_LIST_INDEX
(
p_s_sb
)
=
-
10000
;
/* make sure flush_old_commits does not try to flush a list while replay is on */
...
@@ -2075,12 +2078,8 @@ int journal_init(struct super_block *p_s_sb, const char * j_dev_name, int old_fo
...
@@ -2075,12 +2078,8 @@ int journal_init(struct super_block *p_s_sb, const char * j_dev_name, int old_fo
memset
(
SB_JOURNAL
(
p_s_sb
)
->
j_list_hash_table
,
0
,
JOURNAL_HASH_SIZE
*
sizeof
(
struct
reiserfs_journal_cnode
*
))
;
memset
(
SB_JOURNAL
(
p_s_sb
)
->
j_list_hash_table
,
0
,
JOURNAL_HASH_SIZE
*
sizeof
(
struct
reiserfs_journal_cnode
*
))
;
memset
(
journal_writers
,
0
,
sizeof
(
char
*
)
*
512
)
;
/* debug code */
memset
(
journal_writers
,
0
,
sizeof
(
char
*
)
*
512
)
;
/* debug code */
INIT_LIST_HEAD
(
&
SB_JOURNAL
(
p_s_sb
)
->
j_bitmap_nodes
)
;
INIT_LIST_HEAD
(
&
SB_JOURNAL
(
p_s_sb
)
->
j_dirty_buffers
)
;
INIT_LIST_HEAD
(
&
SB_JOURNAL
(
p_s_sb
)
->
j_dirty_buffers
)
;
spin_lock_init
(
&
SB_JOURNAL
(
p_s_sb
)
->
j_dirty_buffers_lock
)
;
spin_lock_init
(
&
SB_JOURNAL
(
p_s_sb
)
->
j_dirty_buffers_lock
)
;
reiserfs_allocate_list_bitmaps
(
p_s_sb
,
SB_JOURNAL
(
p_s_sb
)
->
j_list_bitmap
,
SB_BMAP_NR
(
p_s_sb
))
;
allocate_bitmap_nodes
(
p_s_sb
)
;
SB_JOURNAL
(
p_s_sb
)
->
j_start
=
0
;
SB_JOURNAL
(
p_s_sb
)
->
j_start
=
0
;
SB_JOURNAL
(
p_s_sb
)
->
j_len
=
0
;
SB_JOURNAL
(
p_s_sb
)
->
j_len
=
0
;
...
@@ -2107,20 +2106,15 @@ int journal_init(struct super_block *p_s_sb, const char * j_dev_name, int old_fo
...
@@ -2107,20 +2106,15 @@ int journal_init(struct super_block *p_s_sb, const char * j_dev_name, int old_fo
SB_JOURNAL_LIST
(
p_s_sb
)[
0
].
j_list_bitmap
=
get_list_bitmap
(
p_s_sb
,
SB_JOURNAL_LIST
(
p_s_sb
))
;
SB_JOURNAL_LIST
(
p_s_sb
)[
0
].
j_list_bitmap
=
get_list_bitmap
(
p_s_sb
,
SB_JOURNAL_LIST
(
p_s_sb
))
;
if
(
!
(
SB_JOURNAL_LIST
(
p_s_sb
)[
0
].
j_list_bitmap
))
{
if
(
!
(
SB_JOURNAL_LIST
(
p_s_sb
)[
0
].
j_list_bitmap
))
{
reiserfs_warning
(
"journal-2005, get_list_bitmap failed for journal list 0
\n
"
)
;
reiserfs_warning
(
"journal-2005, get_list_bitmap failed for journal list 0
\n
"
)
;
release_journal_dev
(
p_s_sb
,
journal
);
goto
free_and_return
;
return
1
;
}
}
if
(
journal_read
(
p_s_sb
)
<
0
)
{
if
(
journal_read
(
p_s_sb
)
<
0
)
{
reiserfs_warning
(
"Replay Failure, unable to mount
\n
"
)
;
reiserfs_warning
(
"Replay Failure, unable to mount
\n
"
)
;
free_journal_ram
(
p_s_sb
)
;
goto
free_and_return
;
release_journal_dev
(
p_s_sb
,
journal
);
return
1
;
}
}
SB_JOURNAL_LIST_INDEX
(
p_s_sb
)
=
0
;
/* once the read is done, we can set this
SB_JOURNAL_LIST_INDEX
(
p_s_sb
)
=
0
;
/* once the read is done, we can set this
where it belongs */
where it belongs */
INIT_LIST_HEAD
(
&
SB_JOURNAL
(
p_s_sb
)
->
j_prealloc_list
);
if
(
reiserfs_dont_log
(
p_s_sb
))
if
(
reiserfs_dont_log
(
p_s_sb
))
return
0
;
return
0
;
...
@@ -2129,7 +2123,9 @@ int journal_init(struct super_block *p_s_sb, const char * j_dev_name, int old_fo
...
@@ -2129,7 +2123,9 @@ int journal_init(struct super_block *p_s_sb, const char * j_dev_name, int old_fo
commit_wq
=
create_workqueue
(
"reiserfs"
);
commit_wq
=
create_workqueue
(
"reiserfs"
);
return
0
;
return
0
;
free_and_return:
free_journal_ram
(
p_s_sb
);
return
1
;
}
}
/*
/*
...
...
include/asm-generic/xor.h
View file @
baf1aaad
...
@@ -678,35 +678,35 @@ xor_32regs_p_5(unsigned long bytes, unsigned long *p1, unsigned long *p2,
...
@@ -678,35 +678,35 @@ xor_32regs_p_5(unsigned long bytes, unsigned long *p1, unsigned long *p2,
}
}
static
struct
xor_block_template
xor_block_8regs
=
{
static
struct
xor_block_template
xor_block_8regs
=
{
name:
"8regs"
,
.
name
=
"8regs"
,
do_2:
xor_8regs_2
,
.
do_2
=
xor_8regs_2
,
do_3:
xor_8regs_3
,
.
do_3
=
xor_8regs_3
,
do_4:
xor_8regs_4
,
.
do_4
=
xor_8regs_4
,
do_5:
xor_8regs_5
,
.
do_5
=
xor_8regs_5
,
};
};
static
struct
xor_block_template
xor_block_32regs
=
{
static
struct
xor_block_template
xor_block_32regs
=
{
name:
"32regs"
,
.
name
=
"32regs"
,
do_2:
xor_32regs_2
,
.
do_2
=
xor_32regs_2
,
do_3:
xor_32regs_3
,
.
do_3
=
xor_32regs_3
,
do_4:
xor_32regs_4
,
.
do_4
=
xor_32regs_4
,
do_5:
xor_32regs_5
,
.
do_5
=
xor_32regs_5
,
};
};
static
struct
xor_block_template
xor_block_8regs_p
=
{
static
struct
xor_block_template
xor_block_8regs_p
=
{
name:
"8regs_prefetch"
,
.
name
=
"8regs_prefetch"
,
do_2:
xor_8regs_p_2
,
.
do_2
=
xor_8regs_p_2
,
do_3:
xor_8regs_p_3
,
.
do_3
=
xor_8regs_p_3
,
do_4:
xor_8regs_p_4
,
.
do_4
=
xor_8regs_p_4
,
do_5:
xor_8regs_p_5
,
.
do_5
=
xor_8regs_p_5
,
};
};
static
struct
xor_block_template
xor_block_32regs_p
=
{
static
struct
xor_block_template
xor_block_32regs_p
=
{
name:
"32regs_prefetch"
,
.
name
=
"32regs_prefetch"
,
do_2:
xor_32regs_p_2
,
.
do_2
=
xor_32regs_p_2
,
do_3:
xor_32regs_p_3
,
.
do_3
=
xor_32regs_p_3
,
do_4:
xor_32regs_p_4
,
.
do_4
=
xor_32regs_p_4
,
do_5:
xor_32regs_p_5
,
.
do_5
=
xor_32regs_p_5
,
};
};
#define XOR_TRY_TEMPLATES \
#define XOR_TRY_TEMPLATES \
...
...
include/asm-i386/cpufeature.h
View file @
baf1aaad
...
@@ -9,9 +9,9 @@
...
@@ -9,9 +9,9 @@
#include <linux/bitops.h>
#include <linux/bitops.h>
#define NCAPINTS
4
/* Currently we have 4
32-bit words worth of info */
#define NCAPINTS
6
/* Currently we have 6
32-bit words worth of info */
/* Intel-defined CPU features, CPUID level 0x00000001, word 0 */
/* Intel-defined CPU features, CPUID level 0x00000001
(edx)
, word 0 */
#define X86_FEATURE_FPU (0*32+ 0)
/* Onboard FPU */
#define X86_FEATURE_FPU (0*32+ 0)
/* Onboard FPU */
#define X86_FEATURE_VME (0*32+ 1)
/* Virtual Mode Extensions */
#define X86_FEATURE_VME (0*32+ 1)
/* Virtual Mode Extensions */
#define X86_FEATURE_DE (0*32+ 2)
/* Debugging Extensions */
#define X86_FEATURE_DE (0*32+ 2)
/* Debugging Extensions */
...
@@ -64,6 +64,11 @@
...
@@ -64,6 +64,11 @@
#define X86_FEATURE_CYRIX_ARR (3*32+ 2)
/* Cyrix ARRs (= MTRRs) */
#define X86_FEATURE_CYRIX_ARR (3*32+ 2)
/* Cyrix ARRs (= MTRRs) */
#define X86_FEATURE_CENTAUR_MCR (3*32+ 3)
/* Centaur MCRs (= MTRRs) */
#define X86_FEATURE_CENTAUR_MCR (3*32+ 3)
/* Centaur MCRs (= MTRRs) */
/* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */
/* VIA/Cyrix/Centaur-defined CPU features, CPUID level 0xC0000001, word 5 */
#define X86_FEATURE_XSTORE (5*32+ 2)
/* on-CPU RNG present (xstore insn) */
#define cpu_has(c, bit) test_bit(bit, (c)->x86_capability)
#define cpu_has(c, bit) test_bit(bit, (c)->x86_capability)
#define boot_cpu_has(bit) test_bit(bit, boot_cpu_data.x86_capability)
#define boot_cpu_has(bit) test_bit(bit, boot_cpu_data.x86_capability)
...
@@ -87,6 +92,7 @@
...
@@ -87,6 +92,7 @@
#define cpu_has_k6_mtrr boot_cpu_has(X86_FEATURE_K6_MTRR)
#define cpu_has_k6_mtrr boot_cpu_has(X86_FEATURE_K6_MTRR)
#define cpu_has_cyrix_arr boot_cpu_has(X86_FEATURE_CYRIX_ARR)
#define cpu_has_cyrix_arr boot_cpu_has(X86_FEATURE_CYRIX_ARR)
#define cpu_has_centaur_mcr boot_cpu_has(X86_FEATURE_CENTAUR_MCR)
#define cpu_has_centaur_mcr boot_cpu_has(X86_FEATURE_CENTAUR_MCR)
#define cpu_has_xstore boot_cpu_has(X86_FEATURE_XSTORE)
#endif
/* __ASM_I386_CPUFEATURE_H */
#endif
/* __ASM_I386_CPUFEATURE_H */
...
...
include/asm-i386/msr.h
View file @
baf1aaad
...
@@ -218,6 +218,7 @@
...
@@ -218,6 +218,7 @@
/* VIA Cyrix defined MSRs*/
/* VIA Cyrix defined MSRs*/
#define MSR_VIA_FCR 0x1107
#define MSR_VIA_FCR 0x1107
#define MSR_VIA_LONGHAUL 0x110a
#define MSR_VIA_LONGHAUL 0x110a
#define MSR_VIA_RNG 0x110b
#define MSR_VIA_BCR2 0x1147
#define MSR_VIA_BCR2 0x1147
/* Transmeta defined MSRs */
/* Transmeta defined MSRs */
...
...
include/asm-i386/xor.h
View file @
baf1aaad
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
#define XO3(x,y) " pxor 8*("#x")(%4), %%mm"#y" ;\n"
#define XO3(x,y) " pxor 8*("#x")(%4), %%mm"#y" ;\n"
#define XO4(x,y) " pxor 8*("#x")(%5), %%mm"#y" ;\n"
#define XO4(x,y) " pxor 8*("#x")(%5), %%mm"#y" ;\n"
#include <asm/i387.h>
static
void
static
void
xor_pII_mmx_2
(
unsigned
long
bytes
,
unsigned
long
*
p1
,
unsigned
long
*
p2
)
xor_pII_mmx_2
(
unsigned
long
bytes
,
unsigned
long
*
p1
,
unsigned
long
*
p2
)
...
...
include/linux/bio.h
View file @
baf1aaad
...
@@ -239,7 +239,6 @@ extern inline char *bio_kmap_irq(struct bio *bio, unsigned long *flags)
...
@@ -239,7 +239,6 @@ extern inline char *bio_kmap_irq(struct bio *bio, unsigned long *flags)
* balancing is a lot nicer this way
* balancing is a lot nicer this way
*/
*/
local_save_flags
(
*
flags
);
local_save_flags
(
*
flags
);
local_irq_disable
();
addr
=
(
unsigned
long
)
kmap_atomic
(
bio_page
(
bio
),
KM_BIO_SRC_IRQ
);
addr
=
(
unsigned
long
)
kmap_atomic
(
bio_page
(
bio
),
KM_BIO_SRC_IRQ
);
if
(
addr
&
~
PAGE_MASK
)
if
(
addr
&
~
PAGE_MASK
)
...
...
include/linux/nfsd/export.h
View file @
baf1aaad
...
@@ -35,12 +35,13 @@
...
@@ -35,12 +35,13 @@
#define NFSEXP_UIDMAP 0x0040
#define NFSEXP_UIDMAP 0x0040
#define NFSEXP_KERBEROS 0x0080
/* not available */
#define NFSEXP_KERBEROS 0x0080
/* not available */
#define NFSEXP_SUNSECURE 0x0100
#define NFSEXP_SUNSECURE 0x0100
#define NFSEXP_
CROSSMNT
0x0200
#define NFSEXP_
NOHIDE
0x0200
#define NFSEXP_NOSUBTREECHECK 0x0400
#define NFSEXP_NOSUBTREECHECK 0x0400
#define NFSEXP_NOAUTHNLM 0x0800
/* Don't authenticate NLM requests - just trust */
#define NFSEXP_NOAUTHNLM 0x0800
/* Don't authenticate NLM requests - just trust */
#define NFSEXP_MSNFS 0x1000
/* do silly things that MS clients expect */
#define NFSEXP_MSNFS 0x1000
/* do silly things that MS clients expect */
#define NFSEXP_FSID 0x2000
#define NFSEXP_FSID 0x2000
#define NFSEXP_ALLFLAGS 0x3FFF
#define NFSEXP_CROSSMNT 0x4000
#define NFSEXP_ALLFLAGS 0x7FFF
#ifdef __KERNEL__
#ifdef __KERNEL__
...
@@ -73,7 +74,7 @@ struct svc_expkey {
...
@@ -73,7 +74,7 @@ struct svc_expkey {
#define EX_SECURE(exp) (!((exp)->ex_flags & NFSEXP_INSECURE_PORT))
#define EX_SECURE(exp) (!((exp)->ex_flags & NFSEXP_INSECURE_PORT))
#define EX_ISSYNC(exp) (!((exp)->ex_flags & NFSEXP_ASYNC))
#define EX_ISSYNC(exp) (!((exp)->ex_flags & NFSEXP_ASYNC))
#define EX_RDONLY(exp) ((exp)->ex_flags & NFSEXP_READONLY)
#define EX_RDONLY(exp) ((exp)->ex_flags & NFSEXP_READONLY)
#define EX_
CROSSMNT(exp) ((exp)->ex_flags & NFSEXP_CROSSMNT
)
#define EX_
NOHIDE(exp) ((exp)->ex_flags & NFSEXP_NOHIDE
)
#define EX_SUNSECURE(exp) ((exp)->ex_flags & NFSEXP_SUNSECURE)
#define EX_SUNSECURE(exp) ((exp)->ex_flags & NFSEXP_SUNSECURE)
#define EX_WGATHER(exp) ((exp)->ex_flags & NFSEXP_GATHERED_WRITES)
#define EX_WGATHER(exp) ((exp)->ex_flags & NFSEXP_GATHERED_WRITES)
...
...
include/linux/raid/md.h
View file @
baf1aaad
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
#include <linux/module.h>
#include <linux/module.h>
#include <linux/hdreg.h>
#include <linux/hdreg.h>
#include <linux/proc_fs.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <linux/smp_lock.h>
#include <linux/smp_lock.h>
#include <linux/delay.h>
#include <linux/delay.h>
#include <net/checksum.h>
#include <net/checksum.h>
...
@@ -68,13 +69,14 @@ extern inline char * bdev_partition_name (struct block_device *bdev)
...
@@ -68,13 +69,14 @@ extern inline char * bdev_partition_name (struct block_device *bdev)
}
}
extern
int
register_md_personality
(
int
p_num
,
mdk_personality_t
*
p
);
extern
int
register_md_personality
(
int
p_num
,
mdk_personality_t
*
p
);
extern
int
unregister_md_personality
(
int
p_num
);
extern
int
unregister_md_personality
(
int
p_num
);
extern
mdk_thread_t
*
md_register_thread
(
void
(
*
run
)
(
void
*
data
),
extern
mdk_thread_t
*
md_register_thread
(
void
(
*
run
)
(
mddev_t
*
mddev
),
void
*
data
,
const
char
*
name
);
mddev_t
*
mddev
,
const
char
*
name
);
extern
void
md_unregister_thread
(
mdk_thread_t
*
thread
);
extern
void
md_unregister_thread
(
mdk_thread_t
*
thread
);
extern
void
md_wakeup_thread
(
mdk_thread_t
*
thread
);
extern
void
md_wakeup_thread
(
mdk_thread_t
*
thread
);
extern
void
md_check_recovery
(
mddev_t
*
mddev
);
extern
void
md_interrupt_thread
(
mdk_thread_t
*
thread
);
extern
void
md_interrupt_thread
(
mdk_thread_t
*
thread
);
extern
void
md_write_start
(
mddev_t
*
mddev
);
extern
void
md_write_start
(
mddev_t
*
mddev
);
extern
void
md_write_end
(
mddev_t
*
mddev
,
mdk_thread_t
*
thread
);
extern
void
md_write_end
(
mddev_t
*
mddev
);
extern
void
md_handle_safemode
(
mddev_t
*
mddev
);
extern
void
md_handle_safemode
(
mddev_t
*
mddev
);
extern
void
md_done_sync
(
mddev_t
*
mddev
,
int
blocks
,
int
ok
);
extern
void
md_done_sync
(
mddev_t
*
mddev
,
int
blocks
,
int
ok
);
extern
void
md_sync_acct
(
mdk_rdev_t
*
rdev
,
unsigned
long
nr_sectors
);
extern
void
md_sync_acct
(
mdk_rdev_t
*
rdev
,
unsigned
long
nr_sectors
);
...
...
include/linux/raid/md_k.h
View file @
baf1aaad
...
@@ -155,6 +155,7 @@ struct mdk_rdev_s
...
@@ -155,6 +155,7 @@ struct mdk_rdev_s
struct
page
*
sb_page
;
struct
page
*
sb_page
;
int
sb_loaded
;
int
sb_loaded
;
sector_t
data_offset
;
/* start of data in array */
sector_t
sb_offset
;
sector_t
sb_offset
;
int
preferred_minor
;
/* autorun support */
int
preferred_minor
;
/* autorun support */
...
@@ -206,22 +207,31 @@ struct mddev_s
...
@@ -206,22 +207,31 @@ struct mddev_s
char
uuid
[
16
];
char
uuid
[
16
];
struct
mdk_thread_s
*
thread
;
/* management thread */
struct
mdk_thread_s
*
sync_thread
;
/* doing resync or reconstruct */
struct
mdk_thread_s
*
sync_thread
;
/* doing resync or reconstruct */
unsigned
long
curr_resync
;
/* blocks scheduled */
unsigned
long
curr_resync
;
/* blocks scheduled */
unsigned
long
resync_mark
;
/* a recent timestamp */
unsigned
long
resync_mark
;
/* a recent timestamp */
unsigned
long
resync_mark_cnt
;
/* blocks written at resync_mark */
unsigned
long
resync_mark_cnt
;
/* blocks written at resync_mark */
/* recovery_running is 0 for no recovery/resync,
* 1 for active recovery
/* recovery/resync flags
* 2 for active resync
* NEEDED: we might need to start a resync/recover
* -error for an error (e.g. -EINTR)
* RUNNING: a thread is running, or about to be started
* it can only be set > 0 under reconfig_sem
* SYNC: actually doing a resync, not a recovery
* ERR: and IO error was detected - abort the resync/recovery
* INTR: someone requested a (clean) early abort.
* DONE: thread is done and is waiting to be reaped
*/
*/
int
recovery_running
;
#define MD_RECOVERY_RUNNING 0
int
recovery_error
;
/* error from recovery write */
#define MD_RECOVERY_SYNC 1
#define MD_RECOVERY_ERR 2
#define MD_RECOVERY_INTR 3
#define MD_RECOVERY_DONE 4
#define MD_RECOVERY_NEEDED 5
unsigned
long
recovery
;
int
in_sync
;
/* know to not need resync */
int
in_sync
;
/* know to not need resync */
struct
semaphore
reconfig_sem
;
struct
semaphore
reconfig_sem
;
atomic_t
active
;
atomic_t
active
;
int
spares
;
int
degraded
;
/* whether md should consider
int
degraded
;
/* whether md should consider
* adding a spare
* adding a spare
...
@@ -230,9 +240,11 @@ struct mddev_s
...
@@ -230,9 +240,11 @@ struct mddev_s
atomic_t
recovery_active
;
/* blocks scheduled, but not written */
atomic_t
recovery_active
;
/* blocks scheduled, but not written */
wait_queue_head_t
recovery_wait
;
wait_queue_head_t
recovery_wait
;
sector_t
recovery_cp
;
sector_t
recovery_cp
;
int
safemode
;
/* if set, update "clean" superblock
unsigned
int
safemode
;
/* if set, update "clean" superblock
* when no writes pending.
* when no writes pending.
*/
*/
unsigned
int
safemode_delay
;
struct
timer_list
safemode_timer
;
atomic_t
writes_pending
;
atomic_t
writes_pending
;
request_queue_t
queue
;
/* for plugging ... */
request_queue_t
queue
;
/* for plugging ... */
...
@@ -245,7 +257,7 @@ struct mdk_personality_s
...
@@ -245,7 +257,7 @@ struct mdk_personality_s
int
(
*
make_request
)(
request_queue_t
*
q
,
struct
bio
*
bio
);
int
(
*
make_request
)(
request_queue_t
*
q
,
struct
bio
*
bio
);
int
(
*
run
)(
mddev_t
*
mddev
);
int
(
*
run
)(
mddev_t
*
mddev
);
int
(
*
stop
)(
mddev_t
*
mddev
);
int
(
*
stop
)(
mddev_t
*
mddev
);
int
(
*
status
)(
char
*
page
,
mddev_t
*
mddev
);
void
(
*
status
)(
struct
seq_file
*
seq
,
mddev_t
*
mddev
);
/* error_handler must set ->faulty and clear ->in_sync
/* error_handler must set ->faulty and clear ->in_sync
* if appropriate, and should abort recovery if needed
* if appropriate, and should abort recovery if needed
*/
*/
...
@@ -292,8 +304,8 @@ extern mdk_rdev_t * find_rdev_nr(mddev_t *mddev, int nr);
...
@@ -292,8 +304,8 @@ extern mdk_rdev_t * find_rdev_nr(mddev_t *mddev, int nr);
ITERATE_RDEV_GENERIC(pending_raid_disks,rdev,tmp)
ITERATE_RDEV_GENERIC(pending_raid_disks,rdev,tmp)
typedef
struct
mdk_thread_s
{
typedef
struct
mdk_thread_s
{
void
(
*
run
)
(
void
*
data
);
void
(
*
run
)
(
mddev_t
*
mddev
);
void
*
data
;
mddev_t
*
mddev
;
wait_queue_head_t
wqueue
;
wait_queue_head_t
wqueue
;
unsigned
long
flags
;
unsigned
long
flags
;
struct
completion
*
event
;
struct
completion
*
event
;
...
...
include/linux/raid/md_p.h
View file @
baf1aaad
...
@@ -173,5 +173,58 @@ static inline __u64 md_event(mdp_super_t *sb) {
...
@@ -173,5 +173,58 @@ static inline __u64 md_event(mdp_super_t *sb) {
return
(
ev
<<
32
)
|
sb
->
events_lo
;
return
(
ev
<<
32
)
|
sb
->
events_lo
;
}
}
/*
* The version-1 superblock :
* All numeric fields are little-endian.
*
* total size: 256 bytes plus 2 per device.
* 1K allows 384 devices.
*/
struct
mdp_superblock_1
{
/* constant array information - 128 bytes */
__u32
magic
;
/* MD_SB_MAGIC: 0xa92b4efc - little endian */
__u32
major_version
;
/* 1 */
__u32
feature_map
;
/* 0 for now */
__u32
pad0
;
/* always set to 0 when writing */
__u8
set_uuid
[
16
];
/* user-space generated. */
char
set_name
[
32
];
/* set and interpreted by user-space */
__u64
ctime
;
/* lo 40 bits are seconds, top 24 are microseconds or 0*/
__u32
level
;
/* -4 (multipath), -1 (linear), 0,1,4,5 */
__u32
layout
;
/* only for raid5 currently */
__u64
size
;
/* used size of component devices, in 512byte sectors */
__u32
chunksize
;
/* in 512byte sectors */
__u32
raid_disks
;
__u8
pad1
[
128
-
92
];
/* set to 0 when written */
/* constant this-device information - 64 bytes */
__u64
data_offset
;
/* sector start of data, often 0 */
__u64
data_size
;
/* sectors in this device that can be used for data */
__u64
super_offset
;
/* sector start of this superblock */
__u64
recovery_offset
;
/* sectors before this offset (from data_offset) have been recovered */
__u32
dev_number
;
/* permanent identifier of this device - not role in raid */
__u32
cnt_corrected_read
;
/* number of read errors that were corrected by re-writing */
__u8
device_uuid
[
16
];
/* user-space setable, ignored by kernel */
__u8
pad2
[
64
-
56
];
/* set to 0 when writing */
/* array state information - 64 bytes */
__u64
utime
;
/* 40 bits second, 24 btes microseconds */
__u64
events
;
/* incremented when superblock updated */
__u64
resync_offset
;
/* data before this offset (from data_offset) known to be in sync */
__u32
sb_csum
;
/* checksum upto devs[max_dev] */
__u32
max_dev
;
/* size of devs[] array to consider */
__u8
pad3
[
64
-
40
];
/* set to 0 when writing */
/* device state information. Indexed by dev_number.
* 2 bytes per device
* Note there are no per-device state flags. State information is rolled
* into the 'roles' value. If a device is spare or faulty, then it doesn't
* have a meaningful role.
*/
__u16
dev_roles
[
0
];
/* role in array, or 0xffff for a spare, or 0xfffe for faulty */
};
#endif
#endif
include/linux/raid/multipath.h
View file @
baf1aaad
...
@@ -13,7 +13,6 @@ struct multipath_private_data {
...
@@ -13,7 +13,6 @@ struct multipath_private_data {
struct
multipath_info
multipaths
[
MD_SB_DISKS
];
struct
multipath_info
multipaths
[
MD_SB_DISKS
];
int
raid_disks
;
int
raid_disks
;
int
working_disks
;
int
working_disks
;
mdk_thread_t
*
thread
;
spinlock_t
device_lock
;
spinlock_t
device_lock
;
mempool_t
*
pool
;
mempool_t
*
pool
;
...
...
include/linux/raid/raid1.h
View file @
baf1aaad
...
@@ -19,7 +19,6 @@ struct r1_private_data_s {
...
@@ -19,7 +19,6 @@ struct r1_private_data_s {
int
working_disks
;
int
working_disks
;
int
last_used
;
int
last_used
;
sector_t
next_seq_sect
;
sector_t
next_seq_sect
;
mdk_thread_t
*
thread
;
spinlock_t
device_lock
;
spinlock_t
device_lock
;
/* for use when syncing mirrors: */
/* for use when syncing mirrors: */
...
@@ -34,7 +33,6 @@ struct r1_private_data_s {
...
@@ -34,7 +33,6 @@ struct r1_private_data_s {
mempool_t
*
r1bio_pool
;
mempool_t
*
r1bio_pool
;
mempool_t
*
r1buf_pool
;
mempool_t
*
r1buf_pool
;
char
thread_name
[
MD_THREAD_NAME_MAX
];
};
};
typedef
struct
r1_private_data_s
conf_t
;
typedef
struct
r1_private_data_s
conf_t
;
...
...
include/linux/raid/raid5.h
View file @
baf1aaad
...
@@ -203,7 +203,6 @@ struct disk_info {
...
@@ -203,7 +203,6 @@ struct disk_info {
struct
raid5_private_data
{
struct
raid5_private_data
{
struct
stripe_head
**
stripe_hashtbl
;
struct
stripe_head
**
stripe_hashtbl
;
mddev_t
*
mddev
;
mddev_t
*
mddev
;
mdk_thread_t
*
thread
;
struct
disk_info
disks
[
MD_SB_DISKS
];
struct
disk_info
disks
[
MD_SB_DISKS
];
struct
disk_info
*
spare
;
struct
disk_info
*
spare
;
int
chunk_size
,
level
,
algorithm
;
int
chunk_size
,
level
,
algorithm
;
...
@@ -226,7 +225,6 @@ struct raid5_private_data {
...
@@ -226,7 +225,6 @@ struct raid5_private_data {
* waiting for 25% to be free
* waiting for 25% to be free
*/
*/
spinlock_t
device_lock
;
spinlock_t
device_lock
;
char
thread_name
[
MD_THREAD_NAME_MAX
];
};
};
typedef
struct
raid5_private_data
raid5_conf_t
;
typedef
struct
raid5_private_data
raid5_conf_t
;
...
...
include/linux/sunrpc/cache.h
View file @
baf1aaad
...
@@ -190,6 +190,7 @@ RTN *FNAME ARGS \
...
@@ -190,6 +190,7 @@ RTN *FNAME ARGS \
else read_unlock(&(DETAIL)->hash_lock); \
else read_unlock(&(DETAIL)->hash_lock); \
if (set) \
if (set) \
cache_fresh(DETAIL, &tmp->MEMBER, item->MEMBER.expiry_time); \
cache_fresh(DETAIL, &tmp->MEMBER, item->MEMBER.expiry_time); \
if (set==1 && new) cache_fresh(DETAIL, &new->MEMBER, 0); \
if (new) (DETAIL)->cache_put(&new->MEMBER, DETAIL); \
if (new) (DETAIL)->cache_put(&new->MEMBER, DETAIL); \
return tmp; \
return tmp; \
} \
} \
...
...
net/sunrpc/svcauth_unix.c
View file @
baf1aaad
...
@@ -441,9 +441,6 @@ svcauth_unix_accept(struct svc_rqst *rqstp, u32 *authp)
...
@@ -441,9 +441,6 @@ svcauth_unix_accept(struct svc_rqst *rqstp, u32 *authp)
return
SVC_DENIED
;
return
SVC_DENIED
;
}
}
/* Put NULL verifier */
svc_putu32
(
resv
,
RPC_AUTH_NULL
);
svc_putu32
(
resv
,
0
);
key
.
m_class
=
rqstp
->
rq_server
->
sv_program
->
pg_class
;
key
.
m_class
=
rqstp
->
rq_server
->
sv_program
->
pg_class
;
key
.
m_addr
=
rqstp
->
rq_addr
.
sin_addr
;
key
.
m_addr
=
rqstp
->
rq_addr
.
sin_addr
;
...
@@ -470,8 +467,13 @@ svcauth_unix_accept(struct svc_rqst *rqstp, u32 *authp)
...
@@ -470,8 +467,13 @@ svcauth_unix_accept(struct svc_rqst *rqstp, u32 *authp)
}
}
else
rv
=
SVC_DROP
;
else
rv
=
SVC_DROP
;
if
(
rqstp
->
rq_client
==
NULL
&&
rqstp
->
rq_proc
!=
0
)
if
(
r
v
==
SVC_OK
&&
r
qstp
->
rq_client
==
NULL
&&
rqstp
->
rq_proc
!=
0
)
goto
badcred
;
goto
badcred
;
/* Put NULL verifier */
svc_putu32
(
resv
,
RPC_AUTH_NULL
);
svc_putu32
(
resv
,
0
);
return
rv
;
return
rv
;
badcred:
badcred:
...
...
net/sunrpc/svcsock.c
View file @
baf1aaad
...
@@ -577,12 +577,15 @@ svc_udp_recvfrom(struct svc_rqst *rqstp)
...
@@ -577,12 +577,15 @@ svc_udp_recvfrom(struct svc_rqst *rqstp)
if
(
skb_is_nonlinear
(
skb
))
{
if
(
skb_is_nonlinear
(
skb
))
{
/* we have to copy */
/* we have to copy */
local_bh_disable
();
if
(
csum_partial_copy_to_xdr
(
&
rqstp
->
rq_arg
,
skb
))
{
if
(
csum_partial_copy_to_xdr
(
&
rqstp
->
rq_arg
,
skb
))
{
local_bh_enable
();
/* checksum error */
/* checksum error */
skb_free_datagram
(
svsk
->
sk_sk
,
skb
);
skb_free_datagram
(
svsk
->
sk_sk
,
skb
);
svc_sock_received
(
svsk
);
svc_sock_received
(
svsk
);
return
0
;
return
0
;
}
}
local_bh_enable
();
skb_free_datagram
(
svsk
->
sk_sk
,
skb
);
skb_free_datagram
(
svsk
->
sk_sk
,
skb
);
}
else
{
}
else
{
/* we can use it in-place */
/* we can use it in-place */
...
@@ -1435,7 +1438,7 @@ static struct cache_deferred_req *
...
@@ -1435,7 +1438,7 @@ static struct cache_deferred_req *
svc_defer
(
struct
cache_req
*
req
)
svc_defer
(
struct
cache_req
*
req
)
{
{
struct
svc_rqst
*
rqstp
=
container_of
(
req
,
struct
svc_rqst
,
rq_chandle
);
struct
svc_rqst
*
rqstp
=
container_of
(
req
,
struct
svc_rqst
,
rq_chandle
);
int
size
=
sizeof
(
struct
svc_deferred_req
)
+
(
rqstp
->
rq_arg
.
head
[
0
].
iov_
len
);
int
size
=
sizeof
(
struct
svc_deferred_req
)
+
(
rqstp
->
rq_arg
.
len
);
struct
svc_deferred_req
*
dr
;
struct
svc_deferred_req
*
dr
;
if
(
rqstp
->
rq_arg
.
page_len
)
if
(
rqstp
->
rq_arg
.
page_len
)
...
@@ -1444,6 +1447,7 @@ svc_defer(struct cache_req *req)
...
@@ -1444,6 +1447,7 @@ svc_defer(struct cache_req *req)
dr
=
rqstp
->
rq_deferred
;
dr
=
rqstp
->
rq_deferred
;
rqstp
->
rq_deferred
=
NULL
;
rqstp
->
rq_deferred
=
NULL
;
}
else
{
}
else
{
int
skip
=
rqstp
->
rq_arg
.
len
-
rqstp
->
rq_arg
.
head
[
0
].
iov_len
;
/* FIXME maybe discard if size too large */
/* FIXME maybe discard if size too large */
dr
=
kmalloc
(
size
,
GFP_KERNEL
);
dr
=
kmalloc
(
size
,
GFP_KERNEL
);
if
(
dr
==
NULL
)
if
(
dr
==
NULL
)
...
@@ -1452,8 +1456,8 @@ svc_defer(struct cache_req *req)
...
@@ -1452,8 +1456,8 @@ svc_defer(struct cache_req *req)
dr
->
serv
=
rqstp
->
rq_server
;
dr
->
serv
=
rqstp
->
rq_server
;
dr
->
prot
=
rqstp
->
rq_prot
;
dr
->
prot
=
rqstp
->
rq_prot
;
dr
->
addr
=
rqstp
->
rq_addr
;
dr
->
addr
=
rqstp
->
rq_addr
;
dr
->
argslen
=
rqstp
->
rq_arg
.
head
[
0
].
iov_
len
>>
2
;
dr
->
argslen
=
rqstp
->
rq_arg
.
len
>>
2
;
memcpy
(
dr
->
args
,
rqstp
->
rq_arg
.
head
[
0
].
iov_base
,
dr
->
argslen
<<
2
);
memcpy
(
dr
->
args
,
rqstp
->
rq_arg
.
head
[
0
].
iov_base
-
skip
,
dr
->
argslen
<<
2
);
}
}
spin_lock
(
&
rqstp
->
rq_server
->
sv_lock
);
spin_lock
(
&
rqstp
->
rq_server
->
sv_lock
);
rqstp
->
rq_sock
->
sk_inuse
++
;
rqstp
->
rq_sock
->
sk_inuse
++
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment