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
95ca0bf3
Commit
95ca0bf3
authored
Sep 21, 2004
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge
bk://linux-ntfs.bkbits.net/ntfs-2.6
into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents
f852c697
1071ed3f
Changes
54
Show whitespace changes
Inline
Side-by-side
Showing
54 changed files
with
604 additions
and
591 deletions
+604
-591
drivers/char/applicom.c
drivers/char/applicom.c
+14
-14
drivers/input/gameport/vortex.c
drivers/input/gameport/vortex.c
+2
-2
drivers/input/serio/serio_raw.c
drivers/input/serio/serio_raw.c
+2
-2
drivers/input/tsdev.c
drivers/input/tsdev.c
+2
-2
drivers/usb/gadget/net2280.c
drivers/usb/gadget/net2280.c
+18
-17
drivers/usb/gadget/net2280.h
drivers/usb/gadget/net2280.h
+11
-11
fs/afs/cmservice.c
fs/afs/cmservice.c
+1
-1
fs/afs/dir.c
fs/afs/dir.c
+8
-8
fs/afs/fsclient.c
fs/afs/fsclient.c
+3
-3
fs/afs/vlclient.c
fs/afs/vlclient.c
+6
-5
fs/bio.c
fs/bio.c
+0
-12
fs/efs/super.c
fs/efs/super.c
+4
-3
fs/ext3/acl.h
fs/ext3/acl.h
+6
-6
fs/ext3/balloc.c
fs/ext3/balloc.c
+2
-2
fs/ext3/ialloc.c
fs/ext3/ialloc.c
+2
-2
fs/ext3/inode.c
fs/ext3/inode.c
+24
-22
fs/ext3/namei.c
fs/ext3/namei.c
+17
-20
fs/ext3/super.c
fs/ext3/super.c
+16
-15
fs/ext3/xattr.c
fs/ext3/xattr.c
+1
-1
fs/ext3/xattr.h
fs/ext3/xattr.h
+8
-8
fs/fat/cache.c
fs/fat/cache.c
+4
-4
fs/fat/dir.c
fs/fat/dir.c
+1
-1
fs/fat/inode.c
fs/fat/inode.c
+3
-3
fs/fat/misc.c
fs/fat/misc.c
+3
-4
fs/jbd/commit.c
fs/jbd/commit.c
+9
-9
fs/jbd/journal.c
fs/jbd/journal.c
+25
-25
fs/jbd/recovery.c
fs/jbd/recovery.c
+16
-16
fs/jbd/revoke.c
fs/jbd/revoke.c
+6
-6
fs/sysv/balloc.c
fs/sysv/balloc.c
+16
-15
fs/sysv/ialloc.c
fs/sysv/ialloc.c
+1
-1
fs/sysv/itree.c
fs/sysv/itree.c
+18
-18
fs/sysv/super.c
fs/sysv/super.c
+22
-14
fs/sysv/sysv.h
fs/sysv/sysv.h
+38
-32
fs/vfat/namei.c
fs/vfat/namei.c
+4
-3
include/linux/efs_dir.h
include/linux/efs_dir.h
+2
-2
include/linux/efs_fs_i.h
include/linux/efs_fs_i.h
+12
-12
include/linux/efs_fs_sb.h
include/linux/efs_fs_sb.h
+26
-26
include/linux/efs_vh.h
include/linux/efs_vh.h
+10
-10
include/linux/ext3_fs.h
include/linux/ext3_fs.h
+68
-68
include/linux/ext3_fs_i.h
include/linux/ext3_fs_i.h
+1
-1
include/linux/jbd.h
include/linux/jbd.h
+19
-19
include/linux/msdos_fs.h
include/linux/msdos_fs.h
+26
-27
include/linux/sysv_fs.h
include/linux/sysv_fs.h
+68
-63
include/rxrpc/call.h
include/rxrpc/call.h
+3
-3
include/rxrpc/connection.h
include/rxrpc/connection.h
+6
-6
include/rxrpc/packet.h
include/rxrpc/packet.h
+13
-13
include/rxrpc/peer.h
include/rxrpc/peer.h
+1
-1
include/rxrpc/rxrpc.h
include/rxrpc/rxrpc.h
+1
-1
include/rxrpc/types.h
include/rxrpc/types.h
+2
-0
net/rxrpc/call.c
net/rxrpc/call.c
+5
-5
net/rxrpc/connection.c
net/rxrpc/connection.c
+19
-18
net/rxrpc/main.c
net/rxrpc/main.c
+1
-1
net/rxrpc/peer.c
net/rxrpc/peer.c
+2
-2
net/rxrpc/transport.c
net/rxrpc/transport.c
+6
-6
No files found.
drivers/char/applicom.c
View file @
95ca0bf3
...
...
@@ -89,7 +89,7 @@ MODULE_SUPPORTED_DEVICE("ac");
static
struct
applicom_board
{
unsigned
long
PhysIO
;
unsigned
long
RamIO
;
void
__iomem
*
RamIO
;
wait_queue_head_t
FlagSleepSend
;
long
irq
;
spinlock_t
mutex
;
...
...
@@ -127,7 +127,7 @@ static struct miscdevice ac_miscdev = {
static
int
dummy
;
/* dev_id for request_irq() */
static
int
ac_register_board
(
unsigned
long
physloc
,
unsigned
long
loc
,
static
int
ac_register_board
(
unsigned
long
physloc
,
void
__iomem
*
loc
,
unsigned
char
boardno
)
{
volatile
unsigned
char
byte_reset_it
;
...
...
@@ -180,10 +180,10 @@ void cleanup_module(void)
if
(
!
apbs
[
i
].
RamIO
)
continue
;
iounmap
((
void
*
)
apbs
[
i
].
RamIO
);
if
(
apbs
[
i
].
irq
)
free_irq
(
apbs
[
i
].
irq
,
&
dummy
);
iounmap
(
apbs
[
i
].
RamIO
);
}
}
...
...
@@ -193,7 +193,7 @@ int __init applicom_init(void)
{
int
i
,
numisa
=
0
;
struct
pci_dev
*
dev
=
NULL
;
void
*
RamIO
;
void
__iomem
*
RamIO
;
int
boardno
;
printk
(
KERN_INFO
"Applicom driver: $Id: ac.c,v 1.30 2000/03/22 16:03:57 dwmw2 Exp $
\n
"
);
...
...
@@ -223,8 +223,8 @@ int __init applicom_init(void)
applicom_pci_devnames
[
dev
->
device
-
1
],
dev
->
resource
[
0
].
start
,
dev
->
irq
);
if
(
!
(
boardno
=
ac_register_board
(
dev
->
resource
[
0
].
start
,
(
unsigned
long
)
RamIO
,
0
))
)
{
boardno
=
ac_register_board
(
dev
->
resource
[
0
].
start
,
RamIO
,
0
);
if
(
!
boardno
)
{
printk
(
KERN_INFO
"ac.o: PCI Applicom device doesn't have correct signature.
\n
"
);
iounmap
(
RamIO
);
pci_disable_device
(
dev
);
...
...
@@ -235,7 +235,7 @@ int __init applicom_init(void)
printk
(
KERN_INFO
"Could not allocate IRQ %d for PCI Applicom device.
\n
"
,
dev
->
irq
);
iounmap
(
RamIO
);
pci_disable_device
(
dev
);
apbs
[
boardno
-
1
].
RamIO
=
0
;
apbs
[
boardno
-
1
].
RamIO
=
NULL
;
continue
;
}
...
...
@@ -270,7 +270,7 @@ int __init applicom_init(void)
}
if
(
!
(
boardno
=
ac_register_board
((
unsigned
long
)
mem
+
(
LEN_RAM_IO
*
i
),
(
unsigned
long
)
RamIO
,
i
+
1
)))
{
RamIO
,
i
+
1
)))
{
iounmap
(
RamIO
);
continue
;
}
...
...
@@ -280,8 +280,8 @@ int __init applicom_init(void)
if
(
!
numisa
)
{
if
(
request_irq
(
irq
,
&
ac_interrupt
,
SA_SHIRQ
,
"Applicom ISA"
,
&
dummy
))
{
printk
(
KERN_WARNING
"Could not allocate IRQ %d for ISA Applicom device.
\n
"
,
irq
);
iounmap
(
(
void
*
)
RamIO
);
apbs
[
boardno
-
1
].
RamIO
=
0
;
iounmap
(
RamIO
);
apbs
[
boardno
-
1
].
RamIO
=
NULL
;
}
else
apbs
[
boardno
-
1
].
irq
=
irq
;
...
...
@@ -449,7 +449,7 @@ static ssize_t ac_write(struct file *file, const char __user *buf, size_t count,
because it works with 2.2 still */
{
unsigned
char
*
from
=
(
unsigned
char
*
)
&
tmpmailbox
;
unsigned
long
to
=
(
unsigned
long
)
apbs
[
IndexCard
].
RamIO
+
RAM_FROM_PC
;
void
__iomem
*
to
=
apbs
[
IndexCard
].
RamIO
+
RAM_FROM_PC
;
int
c
;
for
(
c
=
0
;
c
<
sizeof
(
struct
mailbox
);
c
++
)
...
...
@@ -470,7 +470,7 @@ static ssize_t ac_write(struct file *file, const char __user *buf, size_t count,
static
int
do_ac_read
(
int
IndexCard
,
char
__user
*
buf
,
struct
st_ram_io
*
st_loc
,
struct
mailbox
*
mailbox
)
{
unsigned
long
from
=
(
unsigned
long
)
apbs
[
IndexCard
].
RamIO
+
RAM_TO_PC
;
void
__iomem
*
from
=
apbs
[
IndexCard
].
RamIO
+
RAM_TO_PC
;
unsigned
char
*
to
=
(
unsigned
char
*
)
&
mailbox
;
#ifdef DEBUG
int
c
;
...
...
@@ -685,7 +685,7 @@ static int ac_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
{
/* @ ADG ou ATO selon le cas */
int
i
;
unsigned
char
IndexCard
;
unsigned
long
pmem
;
void
__iomem
*
pmem
;
int
ret
=
0
;
volatile
unsigned
char
byte_reset_it
;
struct
st_ram_io
*
adgl
;
...
...
drivers/input/gameport/vortex.c
View file @
95ca0bf3
...
...
@@ -55,8 +55,8 @@ MODULE_LICENSE("GPL");
struct
vortex
{
struct
gameport
gameport
;
struct
pci_dev
*
dev
;
unsigned
char
*
base
;
unsigned
char
*
io
;
unsigned
char
__iomem
*
base
;
unsigned
char
__iomem
*
io
;
char
phys
[
32
];
};
...
...
drivers/input/serio/serio_raw.c
View file @
95ca0bf3
...
...
@@ -157,7 +157,7 @@ static int serio_raw_fetch_byte(struct serio_raw *serio_raw, char *c)
return
!
empty
;
}
static
ssize_t
serio_raw_read
(
struct
file
*
file
,
char
*
buffer
,
size_t
count
,
loff_t
*
ppos
)
static
ssize_t
serio_raw_read
(
struct
file
*
file
,
char
__user
*
buffer
,
size_t
count
,
loff_t
*
ppos
)
{
struct
serio_raw_list
*
list
=
file
->
private_data
;
struct
serio_raw
*
serio_raw
=
list
->
serio_raw
;
...
...
@@ -187,7 +187,7 @@ static ssize_t serio_raw_read(struct file *file, char *buffer, size_t count, lof
return
retval
;
}
static
ssize_t
serio_raw_write
(
struct
file
*
file
,
const
char
*
buffer
,
size_t
count
,
loff_t
*
ppos
)
static
ssize_t
serio_raw_write
(
struct
file
*
file
,
const
char
__user
*
buffer
,
size_t
count
,
loff_t
*
ppos
)
{
struct
serio_raw_list
*
list
=
file
->
private_data
;
ssize_t
written
=
0
;
...
...
drivers/input/tsdev.c
View file @
95ca0bf3
...
...
@@ -250,12 +250,12 @@ static int tsdev_ioctl(struct inode *inode, struct file *file,
switch
(
cmd
)
{
case
TS_GET_CAL
:
if
(
copy_to_user
((
void
*
)
arg
,
&
tsdev
->
cal
,
if
(
copy_to_user
((
void
__user
*
)
arg
,
&
tsdev
->
cal
,
sizeof
(
struct
ts_calibration
)))
retval
=
-
EFAULT
;
break
;
case
TS_SET_CAL
:
if
(
copy_from_user
(
&
tsdev
->
cal
,
(
void
*
)
arg
,
if
(
copy_from_user
(
&
tsdev
->
cal
,
(
void
__user
*
)
arg
,
sizeof
(
struct
ts_calibration
)))
retval
=
-
EFAULT
;
break
;
...
...
drivers/usb/gadget/net2280.c
View file @
95ca0bf3
...
...
@@ -253,7 +253,7 @@ net2280_enable (struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc)
return
0
;
}
static
int
handshake
(
u32
*
ptr
,
u32
mask
,
u32
done
,
int
usec
)
static
int
handshake
(
u32
__iomem
*
ptr
,
u32
mask
,
u32
done
,
int
usec
)
{
u32
result
;
...
...
@@ -272,7 +272,7 @@ static int handshake (u32 *ptr, u32 mask, u32 done, int usec)
static
struct
usb_ep_ops
net2280_ep_ops
;
static
void
ep_reset
(
struct
net2280_regs
*
regs
,
struct
net2280_ep
*
ep
)
static
void
ep_reset
(
struct
net2280_regs
__iomem
*
regs
,
struct
net2280_ep
*
ep
)
{
u32
tmp
;
...
...
@@ -512,7 +512,7 @@ net2280_free_buffer (
static
void
write_fifo
(
struct
net2280_ep
*
ep
,
struct
usb_request
*
req
)
{
struct
net2280_ep_regs
*
regs
=
ep
->
regs
;
struct
net2280_ep_regs
__iomem
*
regs
=
ep
->
regs
;
u8
*
buf
;
u32
tmp
;
unsigned
count
,
total
;
...
...
@@ -572,7 +572,8 @@ write_fifo (struct net2280_ep *ep, struct usb_request *req)
*/
static
void
out_flush
(
struct
net2280_ep
*
ep
)
{
u32
*
statp
,
tmp
;
u32
__iomem
*
statp
;
u32
tmp
;
ASSERT_OUT_NAKING
(
ep
);
...
...
@@ -605,7 +606,7 @@ static void out_flush (struct net2280_ep *ep)
static
int
read_fifo
(
struct
net2280_ep
*
ep
,
struct
net2280_request
*
req
)
{
struct
net2280_ep_regs
*
regs
=
ep
->
regs
;
struct
net2280_ep_regs
__iomem
*
regs
=
ep
->
regs
;
u8
*
buf
=
req
->
req
.
buf
+
req
->
req
.
actual
;
unsigned
count
,
tmp
,
is_short
;
unsigned
cleanup
=
0
,
prevent
=
0
;
...
...
@@ -732,12 +733,12 @@ static const u32 dmactl_default =
/* erratum 0116 workaround part 2 (no AUTOSTART) */
|
(
1
<<
DMA_ENABLE
);
static
inline
void
spin_stop_dma
(
struct
net2280_dma_regs
*
dma
)
static
inline
void
spin_stop_dma
(
struct
net2280_dma_regs
__iomem
*
dma
)
{
handshake
(
&
dma
->
dmactl
,
(
1
<<
DMA_ENABLE
),
0
,
50
);
}
static
inline
void
stop_dma
(
struct
net2280_dma_regs
*
dma
)
static
inline
void
stop_dma
(
struct
net2280_dma_regs
__iomem
*
dma
)
{
writel
(
readl
(
&
dma
->
dmactl
)
&
~
(
1
<<
DMA_ENABLE
),
&
dma
->
dmactl
);
spin_stop_dma
(
dma
);
...
...
@@ -745,7 +746,7 @@ static inline void stop_dma (struct net2280_dma_regs *dma)
static
void
start_queue
(
struct
net2280_ep
*
ep
,
u32
dmactl
,
u32
td_dma
)
{
struct
net2280_dma_regs
*
dma
=
ep
->
dma
;
struct
net2280_dma_regs
__iomem
*
dma
=
ep
->
dma
;
writel
((
1
<<
VALID_BIT
)
|
(
ep
->
is_in
<<
DMA_DIRECTION
),
&
dma
->
dmacount
);
...
...
@@ -766,7 +767,7 @@ static void start_queue (struct net2280_ep *ep, u32 dmactl, u32 td_dma)
static
void
start_dma
(
struct
net2280_ep
*
ep
,
struct
net2280_request
*
req
)
{
u32
tmp
;
struct
net2280_dma_regs
*
dma
=
ep
->
dma
;
struct
net2280_dma_regs
__iomem
*
dma
=
ep
->
dma
;
/* FIXME can't use DMA for ZLPs */
...
...
@@ -2579,7 +2580,7 @@ static void handle_stat1_irqs (struct net2280 *dev, u32 stat)
stat
&=
~
DMA_INTERRUPTS
;
scratch
>>=
9
;
for
(
num
=
0
;
scratch
;
num
++
)
{
struct
net2280_dma_regs
*
dma
;
struct
net2280_dma_regs
__iomem
*
dma
;
tmp
=
1
<<
num
;
if
((
tmp
&
scratch
)
==
0
)
...
...
@@ -2748,7 +2749,7 @@ static int net2280_probe (struct pci_dev *pdev, const struct pci_device_id *id)
{
struct
net2280
*
dev
;
unsigned
long
resource
,
len
;
void
*
base
=
NULL
;
void
__iomem
*
base
=
NULL
;
int
retval
,
i
;
char
buf
[
8
],
*
bufp
;
...
...
@@ -2806,12 +2807,12 @@ static int net2280_probe (struct pci_dev *pdev, const struct pci_device_id *id)
retval
=
-
EFAULT
;
goto
done
;
}
dev
->
regs
=
(
struct
net2280_regs
*
)
base
;
dev
->
usb
=
(
struct
net2280_usb_regs
*
)
(
base
+
0x0080
);
dev
->
pci
=
(
struct
net2280_pci_regs
*
)
(
base
+
0x0100
);
dev
->
dma
=
(
struct
net2280_dma_regs
*
)
(
base
+
0x0180
);
dev
->
dep
=
(
struct
net2280_dep_regs
*
)
(
base
+
0x0200
);
dev
->
epregs
=
(
struct
net2280_ep_regs
*
)
(
base
+
0x0300
);
dev
->
regs
=
(
struct
net2280_regs
__iomem
*
)
base
;
dev
->
usb
=
(
struct
net2280_usb_regs
__iomem
*
)
(
base
+
0x0080
);
dev
->
pci
=
(
struct
net2280_pci_regs
__iomem
*
)
(
base
+
0x0100
);
dev
->
dma
=
(
struct
net2280_dma_regs
__iomem
*
)
(
base
+
0x0180
);
dev
->
dep
=
(
struct
net2280_dep_regs
__iomem
*
)
(
base
+
0x0200
);
dev
->
epregs
=
(
struct
net2280_ep_regs
__iomem
*
)
(
base
+
0x0300
);
/* put into initial config, link up all endpoints */
writel
(
0
,
&
dev
->
usb
->
usbctl
);
...
...
drivers/usb/gadget/net2280.h
View file @
95ca0bf3
...
...
@@ -446,7 +446,7 @@ struct net2280_ep_regs { /* [11.9] */
*/
static
inline
u32
get_idx_reg
(
struct
net2280_regs
*
regs
,
u32
index
)
get_idx_reg
(
struct
net2280_regs
__iomem
*
regs
,
u32
index
)
{
writel
(
index
,
&
regs
->
idxaddr
);
/* NOTE: synchs device/cpu memory views */
...
...
@@ -454,7 +454,7 @@ get_idx_reg (struct net2280_regs *regs, u32 index)
}
static
inline
void
set_idx_reg
(
struct
net2280_regs
*
regs
,
u32
index
,
u32
value
)
set_idx_reg
(
struct
net2280_regs
__iomem
*
regs
,
u32
index
,
u32
value
)
{
writel
(
index
,
&
regs
->
idxaddr
);
writel
(
value
,
&
regs
->
idxdata
);
...
...
@@ -507,8 +507,8 @@ struct net2280_dma {
struct
net2280_ep
{
struct
usb_ep
ep
;
struct
net2280_ep_regs
*
regs
;
struct
net2280_dma_regs
*
dma
;
struct
net2280_ep_regs
__iomem
*
regs
;
struct
net2280_dma_regs
__iomem
*
dma
;
struct
net2280_dma
*
dummy
;
dma_addr_t
td_dma
;
/* of dummy */
struct
net2280
*
dev
;
...
...
@@ -539,7 +539,7 @@ static inline void allow_status (struct net2280_ep *ep)
/* count (<= 4) bytes in the next fifo write will be valid */
static
inline
void
set_fifo_bytecount
(
struct
net2280_ep
*
ep
,
unsigned
count
)
{
writeb
(
count
,
2
+
(
u8
*
)
&
ep
->
regs
->
ep_cfg
);
writeb
(
count
,
2
+
(
u8
__iomem
*
)
&
ep
->
regs
->
ep_cfg
);
}
struct
net2280_request
{
...
...
@@ -566,12 +566,12 @@ struct net2280 {
/* pci state used to access those endpoints */
struct
pci_dev
*
pdev
;
struct
net2280_regs
*
regs
;
struct
net2280_usb_regs
*
usb
;
struct
net2280_pci_regs
*
pci
;
struct
net2280_dma_regs
*
dma
;
struct
net2280_dep_regs
*
dep
;
struct
net2280_ep_regs
*
epregs
;
struct
net2280_regs
__iomem
*
regs
;
struct
net2280_usb_regs
__iomem
*
usb
;
struct
net2280_pci_regs
__iomem
*
pci
;
struct
net2280_dma_regs
__iomem
*
dma
;
struct
net2280_dep_regs
__iomem
*
dep
;
struct
net2280_ep_regs
__iomem
*
epregs
;
struct
pci_pool
*
requests
;
// statistics...
...
...
fs/afs/cmservice.c
View file @
95ca0bf3
...
...
@@ -424,7 +424,7 @@ static void _SRXAFSCM_CallBack(struct rxrpc_call *call)
{
struct
afs_callback
*
cb
,
*
pcb
;
int
loop
;
u
32
*
fp
,
*
bp
;
__be
32
*
fp
,
*
bp
;
fp
=
rxrpc_call_alloc_scratch
(
call
,
qty
);
...
...
fs/afs/dir.c
View file @
95ca0bf3
...
...
@@ -65,9 +65,9 @@ union afs_dirent {
struct
{
uint8_t
valid
;
uint8_t
unused
[
1
];
uint16_t
hash_next
;
uint32_t
vnode
;
uint32_t
unique
;
__be16
hash_next
;
__be32
vnode
;
__be32
unique
;
uint8_t
name
[
16
];
uint8_t
overflow
[
4
];
/* if any char of the name (inc
* NUL) reaches here, consume
...
...
@@ -78,8 +78,8 @@ union afs_dirent {
/* AFS directory page header (one at the beginning of every 2048-byte chunk) */
struct
afs_dir_pagehdr
{
uint16_t
npages
;
uint16_t
magic
;
__be16
npages
;
__be16
magic
;
#define AFS_DIR_MAGIC htons(1234)
uint8_t
nentries
;
uint8_t
bitmap
[
8
];
...
...
@@ -308,7 +308,7 @@ static int afs_dir_iterate_block(unsigned *fpos,
blkoff
+
offset
*
sizeof
(
union
afs_dirent
),
ntohl
(
dire
->
u
.
vnode
),
filldir
==
afs_dir_lookup_filldir
?
dire
->
u
.
unique
:
DT_UNKNOWN
);
ntohl
(
dire
->
u
.
unique
)
:
DT_UNKNOWN
);
if
(
ret
<
0
)
{
_leave
(
" = 0 [full]"
);
return
0
;
...
...
@@ -416,7 +416,7 @@ static int afs_dir_lookup_filldir(void *_cookie, const char *name, int nlen,
struct
afs_dir_lookup_cookie
*
cookie
=
_cookie
;
_enter
(
"{%s,%Zu},%s,%u,,%lu,%u"
,
cookie
->
name
,
cookie
->
nlen
,
name
,
nlen
,
ino
,
ntohl
(
dtype
)
);
cookie
->
name
,
cookie
->
nlen
,
name
,
nlen
,
ino
,
dtype
);
if
(
cookie
->
nlen
!=
nlen
||
memcmp
(
cookie
->
name
,
name
,
nlen
)
!=
0
)
{
_leave
(
" = 0 [no]"
);
...
...
@@ -424,7 +424,7 @@ static int afs_dir_lookup_filldir(void *_cookie, const char *name, int nlen,
}
cookie
->
fid
.
vnode
=
ino
;
cookie
->
fid
.
unique
=
ntohl
(
dtype
)
;
cookie
->
fid
.
unique
=
dtype
;
cookie
->
found
=
1
;
_leave
(
" = -1 [found]"
);
...
...
fs/afs/fsclient.c
View file @
95ca0bf3
...
...
@@ -307,7 +307,7 @@ int afs_rxfs_fetch_file_status(struct afs_server *server,
struct
kvec
piov
[
1
];
size_t
sent
;
int
ret
;
u
32
*
bp
;
__be
32
*
bp
;
DECLARE_WAITQUEUE
(
myself
,
current
);
...
...
@@ -432,7 +432,7 @@ int afs_rxfs_fetch_file_data(struct afs_server *server,
struct
kvec
piov
[
1
];
size_t
sent
;
int
ret
;
u
32
*
bp
;
__be
32
*
bp
;
DECLARE_WAITQUEUE
(
myself
,
current
);
...
...
@@ -583,7 +583,7 @@ int afs_rxfs_give_up_callback(struct afs_server *server,
struct
kvec
piov
[
1
];
size_t
sent
;
int
ret
;
u
32
*
bp
;
__be
32
*
bp
;
DECLARE_WAITQUEUE
(
myself
,
current
);
...
...
fs/afs/vlclient.c
View file @
95ca0bf3
...
...
@@ -101,7 +101,7 @@ static int afs_rxvl_probe(struct afs_server *server, int alloc_flags)
struct kvec piov[1];
size_t sent;
int ret;
u
32 param[1];
__be
32 param[1];
DECLARE_WAITQUEUE(myself, current);
...
...
@@ -193,7 +193,7 @@ int afs_rxvl_get_entry_by_name(struct afs_server *server,
unsigned
tmp
;
size_t
sent
;
int
ret
,
loop
;
u
32
*
bp
,
param
[
2
],
zero
;
__be
32
*
bp
,
param
[
2
],
zero
;
_enter
(
",%*.*s,%u,"
,
volnamesz
,
volnamesz
,
volname
,
volnamesz
);
...
...
@@ -328,7 +328,7 @@ int afs_rxvl_get_entry_by_id(struct afs_server *server,
unsigned
tmp
;
size_t
sent
;
int
ret
,
loop
;
u
32
*
bp
,
param
[
3
];
__be
32
*
bp
,
param
[
3
];
_enter
(
",%x,%d,"
,
volid
,
voltype
);
...
...
@@ -464,7 +464,7 @@ int afs_rxvl_get_entry_by_id_async(struct afs_async_op *op,
struct
kvec
piov
[
1
];
size_t
sent
;
int
ret
;
u
32
param
[
3
];
__be
32
param
[
3
];
_enter
(
",%x,%d,"
,
volid
,
voltype
);
...
...
@@ -547,7 +547,8 @@ int afs_rxvl_get_entry_by_id_async(struct afs_async_op *op,
int
afs_rxvl_get_entry_by_id_async2
(
struct
afs_async_op
*
op
,
struct
afs_cache_vlocation
*
entry
)
{
unsigned
*
bp
,
tmp
;
__be32
*
bp
;
__u32
tmp
;
int
loop
,
ret
;
_enter
(
"{op=%p cst=%u}"
,
op
,
op
->
call
->
app_call_state
);
...
...
fs/bio.c
View file @
95ca0bf3
...
...
@@ -603,18 +603,6 @@ static void __bio_unmap_user(struct bio *bio)
struct
bio_vec
*
bvec
;
int
i
;
/*
* find original bio if it was bounced
*/
if
(
bio
->
bi_private
)
{
/*
* someone stole our bio, must not happen
*/
BUG_ON
(
!
bio_flagged
(
bio
,
BIO_BOUNCED
));
bio
=
bio
->
bi_private
;
}
/*
* make sure we dirty pages we wrote to
*/
...
...
fs/efs/super.c
View file @
95ca0bf3
...
...
@@ -121,7 +121,8 @@ module_exit(exit_efs_fs)
static
efs_block_t
efs_validate_vh
(
struct
volume_header
*
vh
)
{
int
i
;
unsigned
int
cs
,
csum
,
*
ui
;
__be32
cs
,
*
ui
;
int
csum
;
efs_block_t
sblock
=
0
;
/* shuts up gcc */
struct
pt_types
*
pt_entry
;
int
pt_type
,
slice
=
-
1
;
...
...
@@ -135,8 +136,8 @@ static efs_block_t efs_validate_vh(struct volume_header *vh) {
return
0
;
}
ui
=
((
unsigned
int
*
)
(
vh
+
1
))
-
1
;
for
(
csum
=
0
;
ui
>=
((
unsigned
int
*
)
vh
);)
{
ui
=
((
__be32
*
)
(
vh
+
1
))
-
1
;
for
(
csum
=
0
;
ui
>=
((
__be32
*
)
vh
);)
{
cs
=
*
ui
--
;
csum
+=
be32_to_cpu
(
cs
);
}
...
...
fs/ext3/acl.h
View file @
95ca0bf3
...
...
@@ -10,18 +10,18 @@
#define EXT3_ACL_MAX_ENTRIES 32
typedef
struct
{
__
u
16
e_tag
;
__
u
16
e_perm
;
__
u
32
e_id
;
__
le
16
e_tag
;
__
le
16
e_perm
;
__
le
32
e_id
;
}
ext3_acl_entry
;
typedef
struct
{
__
u
16
e_tag
;
__
u
16
e_perm
;
__
le
16
e_tag
;
__
le
16
e_perm
;
}
ext3_acl_entry_short
;
typedef
struct
{
__
u
32
a_version
;
__
le
32
a_version
;
}
ext3_acl_header
;
static
inline
size_t
ext3_acl_size
(
int
count
)
...
...
fs/ext3/balloc.c
View file @
95ca0bf3
...
...
@@ -91,8 +91,8 @@ read_block_bitmap(struct super_block *sb, unsigned int block_group)
if
(
!
bh
)
ext3_error
(
sb
,
"read_block_bitmap"
,
"Cannot read block bitmap - "
"block_group = %d, block_bitmap = %
l
u"
,
block_group
,
(
unsigned
long
)
desc
->
bg_block_bitmap
);
"block_group = %d, block_bitmap = %u"
,
block_group
,
le32_to_cpu
(
desc
->
bg_block_bitmap
)
);
error_out:
return
bh
;
}
...
...
fs/ext3/ialloc.c
View file @
95ca0bf3
...
...
@@ -64,8 +64,8 @@ read_inode_bitmap(struct super_block * sb, unsigned long block_group)
if
(
!
bh
)
ext3_error
(
sb
,
"read_inode_bitmap"
,
"Cannot read inode bitmap - "
"block_group = %lu, inode_bitmap = %
l
u"
,
block_group
,
(
unsigned
long
)
desc
->
bg_inode_bitmap
);
"block_group = %lu, inode_bitmap = %u"
,
block_group
,
le32_to_cpu
(
desc
->
bg_inode_bitmap
)
);
error_out:
return
bh
;
}
...
...
fs/ext3/inode.c
View file @
95ca0bf3
...
...
@@ -305,12 +305,12 @@ static int ext3_alloc_block (handle_t *handle,
typedef
struct
{
u
32
*
p
;
u
32
key
;
__le
32
*
p
;
__le
32
key
;
struct
buffer_head
*
bh
;
}
Indirect
;
static
inline
void
add_chain
(
Indirect
*
p
,
struct
buffer_head
*
bh
,
u
32
*
v
)
static
inline
void
add_chain
(
Indirect
*
p
,
struct
buffer_head
*
bh
,
__le
32
*
v
)
{
p
->
key
=
*
(
p
->
p
=
v
);
p
->
bh
=
bh
;
...
...
@@ -441,7 +441,7 @@ static Indirect *ext3_get_branch(struct inode *inode, int depth, int *offsets,
/* Reader: pointers */
if
(
!
verify_chain
(
chain
,
p
))
goto
changed
;
add_chain
(
++
p
,
bh
,
(
u
32
*
)
bh
->
b_data
+
*++
offsets
);
add_chain
(
++
p
,
bh
,
(
__le
32
*
)
bh
->
b_data
+
*++
offsets
);
/* Reader: end */
if
(
!
p
->
key
)
goto
no_block
;
...
...
@@ -482,8 +482,8 @@ static Indirect *ext3_get_branch(struct inode *inode, int depth, int *offsets,
static
unsigned
long
ext3_find_near
(
struct
inode
*
inode
,
Indirect
*
ind
)
{
struct
ext3_inode_info
*
ei
=
EXT3_I
(
inode
);
u32
*
start
=
ind
->
bh
?
(
u
32
*
)
ind
->
bh
->
b_data
:
ei
->
i_data
;
u
32
*
p
;
__le32
*
start
=
ind
->
bh
?
(
__le
32
*
)
ind
->
bh
->
b_data
:
ei
->
i_data
;
__le
32
*
p
;
unsigned
long
bg_start
;
unsigned
long
colour
;
...
...
@@ -611,7 +611,7 @@ static int ext3_alloc_branch(handle_t *handle, struct inode *inode,
}
memset
(
bh
->
b_data
,
0
,
blocksize
);
branch
[
n
].
p
=
(
u
32
*
)
bh
->
b_data
+
offsets
[
n
];
branch
[
n
].
p
=
(
__le
32
*
)
bh
->
b_data
+
offsets
[
n
];
*
branch
[
n
].
p
=
branch
[
n
].
key
;
BUFFER_TRACE
(
bh
,
"marking uptodate"
);
set_buffer_uptodate
(
bh
);
...
...
@@ -1767,7 +1767,7 @@ static int ext3_block_truncate_page(handle_t *handle, struct page *page,
* or memcmp with zero_page, whatever is better for particular architecture.
* Linus?
*/
static
inline
int
all_zeroes
(
u32
*
p
,
u
32
*
q
)
static
inline
int
all_zeroes
(
__le32
*
p
,
__le
32
*
q
)
{
while
(
p
<
q
)
if
(
*
p
++
)
...
...
@@ -1814,7 +1814,7 @@ static Indirect *ext3_find_shared(struct inode *inode,
int
depth
,
int
offsets
[
4
],
Indirect
chain
[
4
],
u
32
*
top
)
__le
32
*
top
)
{
Indirect
*
partial
,
*
p
;
int
k
,
err
;
...
...
@@ -1834,7 +1834,7 @@ static Indirect *ext3_find_shared(struct inode *inode,
if
(
!
partial
->
key
&&
*
partial
->
p
)
/* Writer: end */
goto
no_top
;
for
(
p
=
partial
;
p
>
chain
&&
all_zeroes
((
u
32
*
)
p
->
bh
->
b_data
,
p
->
p
);
p
--
)
for
(
p
=
partial
;
p
>
chain
&&
all_zeroes
((
__le
32
*
)
p
->
bh
->
b_data
,
p
->
p
);
p
--
)
;
/*
* OK, we've found the last block that must survive. The rest of our
...
...
@@ -1873,9 +1873,9 @@ static Indirect *ext3_find_shared(struct inode *inode,
static
void
ext3_clear_blocks
(
handle_t
*
handle
,
struct
inode
*
inode
,
struct
buffer_head
*
bh
,
unsigned
long
block_to_free
,
unsigned
long
count
,
u32
*
first
,
u
32
*
last
)
__le32
*
first
,
__le
32
*
last
)
{
u
32
*
p
;
__le
32
*
p
;
if
(
try_to_extend_transaction
(
handle
,
inode
))
{
if
(
bh
)
{
BUFFER_TRACE
(
bh
,
"call ext3_journal_dirty_metadata"
);
...
...
@@ -1931,15 +1931,16 @@ ext3_clear_blocks(handle_t *handle, struct inode *inode, struct buffer_head *bh,
* block pointers.
*/
static
void
ext3_free_data
(
handle_t
*
handle
,
struct
inode
*
inode
,
struct
buffer_head
*
this_bh
,
u32
*
first
,
u32
*
last
)
struct
buffer_head
*
this_bh
,
__le32
*
first
,
__le32
*
last
)
{
unsigned
long
block_to_free
=
0
;
/* Starting block # of a run */
unsigned
long
count
=
0
;
/* Number of blocks in the run */
u
32
*
block_to_free_p
=
NULL
;
/* Pointer into inode/ind
__le
32
*
block_to_free_p
=
NULL
;
/* Pointer into inode/ind
corresponding to
block_to_free */
unsigned
long
nr
;
/* Current block # */
u32
*
p
;
/* Pointer into inode/ind
__le32
*
p
;
/* Pointer into inode/ind
for current block */
int
err
;
...
...
@@ -1998,10 +1999,10 @@ static void ext3_free_data(handle_t *handle, struct inode *inode,
*/
static
void
ext3_free_branches
(
handle_t
*
handle
,
struct
inode
*
inode
,
struct
buffer_head
*
parent_bh
,
u32
*
first
,
u
32
*
last
,
int
depth
)
__le32
*
first
,
__le
32
*
last
,
int
depth
)
{
unsigned
long
nr
;
u
32
*
p
;
__le
32
*
p
;
if
(
is_handle_aborted
(
handle
))
return
;
...
...
@@ -2031,8 +2032,9 @@ static void ext3_free_branches(handle_t *handle, struct inode *inode,
/* This zaps the entire block. Bottom up. */
BUFFER_TRACE
(
bh
,
"free child branches"
);
ext3_free_branches
(
handle
,
inode
,
bh
,
(
u32
*
)
bh
->
b_data
,
(
u32
*
)
bh
->
b_data
+
addr_per_block
,
ext3_free_branches
(
handle
,
inode
,
bh
,
(
__le32
*
)
bh
->
b_data
,
(
__le32
*
)
bh
->
b_data
+
addr_per_block
,
depth
);
/*
...
...
@@ -2137,13 +2139,13 @@ void ext3_truncate(struct inode * inode)
{
handle_t
*
handle
;
struct
ext3_inode_info
*
ei
=
EXT3_I
(
inode
);
u
32
*
i_data
=
ei
->
i_data
;
__le
32
*
i_data
=
ei
->
i_data
;
int
addr_per_block
=
EXT3_ADDR_PER_BLOCK
(
inode
->
i_sb
);
struct
address_space
*
mapping
=
inode
->
i_mapping
;
int
offsets
[
4
];
Indirect
chain
[
4
];
Indirect
*
partial
;
int
nr
=
0
;
__le32
nr
=
0
;
int
n
;
long
last_block
;
unsigned
blocksize
=
inode
->
i_sb
->
s_blocksize
;
...
...
@@ -2250,7 +2252,7 @@ void ext3_truncate(struct inode * inode)
/* Clear the ends of indirect blocks on the shared branch */
while
(
partial
>
chain
)
{
ext3_free_branches
(
handle
,
inode
,
partial
->
bh
,
partial
->
p
+
1
,
(
u32
*
)
partial
->
bh
->
b_data
+
addr_per_block
,
(
__le32
*
)
partial
->
bh
->
b_data
+
addr_per_block
,
(
chain
+
n
-
1
)
-
partial
);
BUFFER_TRACE
(
partial
->
bh
,
"call brelse"
);
brelse
(
partial
->
bh
);
...
...
fs/ext3/namei.c
View file @
95ca0bf3
...
...
@@ -71,9 +71,6 @@ static struct buffer_head *ext3_append(handle_t *handle,
#define swap(x, y) do { typeof(x) z = x; x = y; y = z; } while (0)
#endif
typedef
struct
{
u32
v
;
}
le_u32
;
typedef
struct
{
u16
v
;
}
le_u16
;
#ifdef DX_DEBUG
#define dxtrace(command) command
#else
...
...
@@ -82,22 +79,22 @@ typedef struct { u16 v; } le_u16;
struct
fake_dirent
{
/*le*/
u
32
inode
;
/*le*/
u
16
rec_len
;
__le
32
inode
;
__le
16
rec_len
;
u8
name_len
;
u8
file_type
;
};
struct
dx_countlimit
{
le_u
16
limit
;
le_u
16
count
;
__le
16
limit
;
__le
16
count
;
};
struct
dx_entry
{
le_u
32
hash
;
le_u
32
block
;
__le
32
hash
;
__le
32
block
;
};
/*
...
...
@@ -114,7 +111,7 @@ struct dx_root
char
dotdot_name
[
4
];
struct
dx_root_info
{
le_u
32
reserved_zero
;
__le
32
reserved_zero
;
u8
hash_version
;
u8
info_length
;
/* 8 */
u8
indirect_levels
;
...
...
@@ -184,42 +181,42 @@ static int ext3_dx_add_entry(handle_t *handle, struct dentry *dentry,
static
inline
unsigned
dx_get_block
(
struct
dx_entry
*
entry
)
{
return
le32_to_cpu
(
entry
->
block
.
v
)
&
0x00ffffff
;
return
le32_to_cpu
(
entry
->
block
)
&
0x00ffffff
;
}
static
inline
void
dx_set_block
(
struct
dx_entry
*
entry
,
unsigned
value
)
{
entry
->
block
.
v
=
cpu_to_le32
(
value
);
entry
->
block
=
cpu_to_le32
(
value
);
}
static
inline
unsigned
dx_get_hash
(
struct
dx_entry
*
entry
)
{
return
le32_to_cpu
(
entry
->
hash
.
v
);
return
le32_to_cpu
(
entry
->
hash
);
}
static
inline
void
dx_set_hash
(
struct
dx_entry
*
entry
,
unsigned
value
)
{
entry
->
hash
.
v
=
cpu_to_le32
(
value
);
entry
->
hash
=
cpu_to_le32
(
value
);
}
static
inline
unsigned
dx_get_count
(
struct
dx_entry
*
entries
)
{
return
le16_to_cpu
(((
struct
dx_countlimit
*
)
entries
)
->
count
.
v
);
return
le16_to_cpu
(((
struct
dx_countlimit
*
)
entries
)
->
count
);
}
static
inline
unsigned
dx_get_limit
(
struct
dx_entry
*
entries
)
{
return
le16_to_cpu
(((
struct
dx_countlimit
*
)
entries
)
->
limit
.
v
);
return
le16_to_cpu
(((
struct
dx_countlimit
*
)
entries
)
->
limit
);
}
static
inline
void
dx_set_count
(
struct
dx_entry
*
entries
,
unsigned
value
)
{
((
struct
dx_countlimit
*
)
entries
)
->
count
.
v
=
cpu_to_le16
(
value
);
((
struct
dx_countlimit
*
)
entries
)
->
count
=
cpu_to_le16
(
value
);
}
static
inline
void
dx_set_limit
(
struct
dx_entry
*
entries
,
unsigned
value
)
{
((
struct
dx_countlimit
*
)
entries
)
->
limit
.
v
=
cpu_to_le16
(
value
);
((
struct
dx_countlimit
*
)
entries
)
->
limit
=
cpu_to_le16
(
value
);
}
static
inline
unsigned
dx_root_limit
(
struct
inode
*
dir
,
unsigned
infosize
)
...
...
@@ -2258,7 +2255,7 @@ static int ext3_rename (struct inode * old_dir, struct dentry *old_dentry,
}
else
{
BUFFER_TRACE
(
new_bh
,
"get write access"
);
ext3_journal_get_write_access
(
handle
,
new_bh
);
new_de
->
inode
=
le32_to_cpu
(
old_inode
->
i_ino
);
new_de
->
inode
=
cpu_to_le32
(
old_inode
->
i_ino
);
if
(
EXT3_HAS_INCOMPAT_FEATURE
(
new_dir
->
i_sb
,
EXT3_FEATURE_INCOMPAT_FILETYPE
))
new_de
->
file_type
=
old_de
->
file_type
;
...
...
@@ -2313,7 +2310,7 @@ static int ext3_rename (struct inode * old_dir, struct dentry *old_dentry,
if
(
dir_bh
)
{
BUFFER_TRACE
(
dir_bh
,
"get_write_access"
);
ext3_journal_get_write_access
(
handle
,
dir_bh
);
PARENT_INO
(
dir_bh
->
b_data
)
=
le32_to_cpu
(
new_dir
->
i_ino
);
PARENT_INO
(
dir_bh
->
b_data
)
=
cpu_to_le32
(
new_dir
->
i_ino
);
BUFFER_TRACE
(
dir_bh
,
"call ext3_journal_dirty_metadata"
);
ext3_journal_dirty_metadata
(
handle
,
dir_bh
);
old_dir
->
i_nlink
--
;
...
...
fs/ext3/super.c
View file @
95ca0bf3
...
...
@@ -138,7 +138,7 @@ static void ext3_handle_error(struct super_block *sb)
struct
ext3_super_block
*
es
=
EXT3_SB
(
sb
)
->
s_es
;
EXT3_SB
(
sb
)
->
s_mount_state
|=
EXT3_ERROR_FS
;
es
->
s_state
|=
cpu_to_le
32
(
EXT3_ERROR_FS
);
es
->
s_state
|=
cpu_to_le
16
(
EXT3_ERROR_FS
);
if
(
sb
->
s_flags
&
MS_RDONLY
)
return
;
...
...
@@ -377,7 +377,7 @@ static void dump_orphan_list(struct super_block *sb, struct ext3_sb_info *sbi)
"inode %s:%ld at %p: mode %o, nlink %d, next %d
\n
"
,
inode
->
i_sb
->
s_id
,
inode
->
i_ino
,
inode
,
inode
->
i_mode
,
inode
->
i_nlink
,
le32_to_cpu
(
NEXT_ORPHAN
(
inode
)
));
NEXT_ORPHAN
(
inode
));
}
}
...
...
@@ -391,7 +391,7 @@ void ext3_put_super (struct super_block * sb)
journal_destroy
(
sbi
->
s_journal
);
if
(
!
(
sb
->
s_flags
&
MS_RDONLY
))
{
EXT3_CLEAR_INCOMPAT_FEATURE
(
sb
,
EXT3_FEATURE_INCOMPAT_RECOVER
);
es
->
s_state
=
le16_to_cpu
(
sbi
->
s_mount_state
);
es
->
s_state
=
cpu_to_le16
(
sbi
->
s_mount_state
);
BUFFER_TRACE
(
sbi
->
s_sbh
,
"marking dirty"
);
mark_buffer_dirty
(
sbi
->
s_sbh
);
ext3_commit_super
(
sb
,
es
,
1
);
...
...
@@ -964,8 +964,7 @@ static int ext3_setup_super(struct super_block *sb, struct ext3_super_block *es,
es->s_state = cpu_to_le16(le16_to_cpu(es->s_state) & ~EXT3_VALID_FS);
#endif
if
(
!
(
__s16
)
le16_to_cpu
(
es
->
s_max_mnt_count
))
es
->
s_max_mnt_count
=
(
__s16
)
cpu_to_le16
(
EXT3_DFL_MAX_MNT_COUNT
);
es
->
s_max_mnt_count
=
cpu_to_le16
(
EXT3_DFL_MAX_MNT_COUNT
);
es
->
s_mnt_count
=
cpu_to_le16
(
le16_to_cpu
(
es
->
s_mnt_count
)
+
1
);
es
->
s_mtime
=
cpu_to_le32
(
get_seconds
());
ext3_update_dynamic_rev
(
sb
);
...
...
@@ -1221,6 +1220,7 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent)
int
db_count
;
int
i
;
int
needs_recovery
;
__le32
features
;
sbi
=
kmalloc
(
sizeof
(
*
sbi
),
GFP_KERNEL
);
if
(
!
sbi
)
...
...
@@ -1313,17 +1313,18 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent)
* previously didn't change the revision level when setting the flags,
* so there is a chance incompat flags are set on a rev 0 filesystem.
*/
if
((
i
=
EXT3_HAS_INCOMPAT_FEATURE
(
sb
,
~
EXT3_FEATURE_INCOMPAT_SUPP
)))
{
features
=
EXT3_HAS_INCOMPAT_FEATURE
(
sb
,
~
EXT3_FEATURE_INCOMPAT_SUPP
);
if
(
features
)
{
printk
(
KERN_ERR
"EXT3-fs: %s: couldn't mount because of "
"unsupported optional features (%x).
\n
"
,
sb
->
s_id
,
i
);
sb
->
s_id
,
le32_to_cpu
(
features
)
);
goto
failed_mount
;
}
if
(
!
(
sb
->
s_flags
&
MS_RDONLY
)
&&
(
i
=
EXT3_HAS_RO_COMPAT_FEATURE
(
sb
,
~
EXT3_FEATURE_RO_COMPAT_SUPP
)))
{
features
=
EXT3_HAS_RO_COMPAT_FEATURE
(
sb
,
~
EXT3_FEATURE_RO_COMPAT_SUPP
);
if
(
!
(
sb
->
s_flags
&
MS_RDONLY
)
&&
features
)
{
printk
(
KERN_ERR
"EXT3-fs: %s: couldn't mount RDWR because of "
"unsupported optional features (%x).
\n
"
,
sb
->
s_id
,
i
);
sb
->
s_id
,
le32_to_cpu
(
features
)
);
goto
failed_mount
;
}
blocksize
=
BLOCK_SIZE
<<
le32_to_cpu
(
es
->
s_log_block_size
);
...
...
@@ -1360,7 +1361,7 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent)
}
es
=
(
struct
ext3_super_block
*
)(((
char
*
)
bh
->
b_data
)
+
offset
);
sbi
->
s_es
=
es
;
if
(
es
->
s_magic
!=
le16_to_cpu
(
EXT3_SUPER_MAGIC
))
{
if
(
es
->
s_magic
!=
cpu_to_le16
(
EXT3_SUPER_MAGIC
))
{
printk
(
KERN_ERR
"EXT3-fs: Magic mismatch, very weird !
\n
"
);
goto
failed_mount
;
...
...
@@ -1737,10 +1738,10 @@ static journal_t *ext3_get_dev_journal(struct super_block *sb,
printk
(
KERN_ERR
"EXT3-fs: I/O error on journal device
\n
"
);
goto
out_journal
;
}
if
(
ntohl
(
journal
->
j_superblock
->
s_nr_users
)
!=
1
)
{
if
(
be32_to_cpu
(
journal
->
j_superblock
->
s_nr_users
)
!=
1
)
{
printk
(
KERN_ERR
"EXT3-fs: External journal has more than one "
"user (unsupported) - %d
\n
"
,
ntohl
(
journal
->
j_superblock
->
s_nr_users
));
be32_to_cpu
(
journal
->
j_superblock
->
s_nr_users
));
goto
out_journal
;
}
EXT3_SB
(
sb
)
->
journal_bdev
=
bdev
;
...
...
@@ -2065,13 +2066,13 @@ int ext3_remount (struct super_block * sb, int * flags, char * data)
ext3_mark_recovery_complete
(
sb
,
es
);
}
else
{
int
ret
;
__le32
ret
;
if
((
ret
=
EXT3_HAS_RO_COMPAT_FEATURE
(
sb
,
~
EXT3_FEATURE_RO_COMPAT_SUPP
)))
{
printk
(
KERN_WARNING
"EXT3-fs: %s: couldn't "
"remount RDWR because of unsupported "
"optional features (%x).
\n
"
,
sb
->
s_id
,
ret
);
sb
->
s_id
,
le32_to_cpu
(
ret
)
);
return
-
EROFS
;
}
/*
...
...
fs/ext3/xattr.c
View file @
95ca0bf3
...
...
@@ -1130,7 +1130,7 @@ static inline void ext3_xattr_hash_entry(struct ext3_xattr_header *header,
}
if
(
entry
->
e_value_block
==
0
&&
entry
->
e_value_size
!=
0
)
{
__
u32
*
value
=
(
__u
32
*
)((
char
*
)
header
+
__
le32
*
value
=
(
__le
32
*
)((
char
*
)
header
+
le16_to_cpu
(
entry
->
e_value_offs
));
for
(
n
=
(
le32_to_cpu
(
entry
->
e_value_size
)
+
EXT3_XATTR_ROUND
)
>>
EXT3_XATTR_PAD_BITS
;
n
;
n
--
)
{
...
...
fs/ext3/xattr.h
View file @
95ca0bf3
...
...
@@ -25,20 +25,20 @@
#define EXT3_XATTR_INDEX_SECURITY 6
struct
ext3_xattr_header
{
__
u
32
h_magic
;
/* magic number for identification */
__
u
32
h_refcount
;
/* reference count */
__
u
32
h_blocks
;
/* number of disk blocks used */
__
u
32
h_hash
;
/* hash value of all attributes */
__
le
32
h_magic
;
/* magic number for identification */
__
le
32
h_refcount
;
/* reference count */
__
le
32
h_blocks
;
/* number of disk blocks used */
__
le
32
h_hash
;
/* hash value of all attributes */
__u32
h_reserved
[
4
];
/* zero right now */
};
struct
ext3_xattr_entry
{
__u8
e_name_len
;
/* length of name */
__u8
e_name_index
;
/* attribute name index */
__
u
16
e_value_offs
;
/* offset in disk block of value */
__
u
32
e_value_block
;
/* disk block attribute is stored on (n/i) */
__
u
32
e_value_size
;
/* size of attribute value */
__
u
32
e_hash
;
/* hash value of name and value */
__
le
16
e_value_offs
;
/* offset in disk block of value */
__
le
32
e_value_block
;
/* disk block attribute is stored on (n/i) */
__
le
32
e_value_size
;
/* size of attribute value */
__
le
32
e_hash
;
/* hash value of name and value */
char
e_name
[
0
];
/* attribute name */
};
...
...
fs/fat/cache.c
View file @
95ca0bf3
...
...
@@ -45,13 +45,13 @@ int __fat_access(struct super_block *sb, int nr, int new_value)
}
if
(
sbi
->
fat_bits
==
32
)
{
p_first
=
p_last
=
NULL
;
/* GCC needs that stuff */
next
=
CF_LE_L
(((
__
u
32
*
)
bh
->
b_data
)[(
first
&
next
=
CF_LE_L
(((
__
le
32
*
)
bh
->
b_data
)[(
first
&
(
sb
->
s_blocksize
-
1
))
>>
2
]);
/* Fscking Microsoft marketing department. Their "32" is 28. */
next
&=
0x0fffffff
;
}
else
if
(
sbi
->
fat_bits
==
16
)
{
p_first
=
p_last
=
NULL
;
/* GCC needs that stuff */
next
=
CF_LE_W
(((
__
u
16
*
)
bh
->
b_data
)[(
first
&
next
=
CF_LE_W
(((
__
le
16
*
)
bh
->
b_data
)[(
first
&
(
sb
->
s_blocksize
-
1
))
>>
1
]);
}
else
{
p_first
=
&
((
__u8
*
)
bh
->
b_data
)[
first
&
(
sb
->
s_blocksize
-
1
)];
...
...
@@ -63,10 +63,10 @@ int __fat_access(struct super_block *sb, int nr, int new_value)
}
if
(
new_value
!=
-
1
)
{
if
(
sbi
->
fat_bits
==
32
)
{
((
__
u
32
*
)
bh
->
b_data
)[(
first
&
(
sb
->
s_blocksize
-
1
))
>>
2
]
((
__
le
32
*
)
bh
->
b_data
)[(
first
&
(
sb
->
s_blocksize
-
1
))
>>
2
]
=
CT_LE_L
(
new_value
);
}
else
if
(
sbi
->
fat_bits
==
16
)
{
((
__
u
16
*
)
bh
->
b_data
)[(
first
&
(
sb
->
s_blocksize
-
1
))
>>
1
]
((
__
le
16
*
)
bh
->
b_data
)[(
first
&
(
sb
->
s_blocksize
-
1
))
>>
1
]
=
CT_LE_W
(
new_value
);
}
else
{
if
(
nr
&
1
)
{
...
...
fs/fat/dir.c
View file @
95ca0bf3
...
...
@@ -714,7 +714,7 @@ int fat_new_dir(struct inode *dir, struct inode *parent, int is_vfat)
{
struct
buffer_head
*
bh
;
struct
msdos_dir_entry
*
de
;
__
u
16
date
,
time
;
__
le
16
date
,
time
;
bh
=
fat_extend_dir
(
dir
);
if
(
IS_ERR
(
bh
))
...
...
fs/fat/inode.c
View file @
95ca0bf3
...
...
@@ -857,7 +857,7 @@ int fat_fill_super(struct super_block *sb, void *data, int silent,
brelse
(
bh
);
goto
out_invalid
;
}
logical_sector_size
=
CF_LE_W
(
get_unaligned
((
u
16
*
)
&
b
->
sector_size
));
logical_sector_size
=
CF_LE_W
(
get_unaligned
((
__le
16
*
)
&
b
->
sector_size
));
if
(
!
logical_sector_size
||
(
logical_sector_size
&
(
logical_sector_size
-
1
))
||
(
logical_sector_size
<
512
)
...
...
@@ -957,7 +957,7 @@ int fat_fill_super(struct super_block *sb, void *data, int silent,
sbi
->
dir_per_block_bits
=
ffs
(
sbi
->
dir_per_block
)
-
1
;
sbi
->
dir_start
=
sbi
->
fat_start
+
sbi
->
fats
*
sbi
->
fat_length
;
sbi
->
dir_entries
=
CF_LE_W
(
get_unaligned
((
u
16
*
)
&
b
->
dir_entries
));
sbi
->
dir_entries
=
CF_LE_W
(
get_unaligned
((
__le
16
*
)
&
b
->
dir_entries
));
if
(
sbi
->
dir_entries
&
(
sbi
->
dir_per_block
-
1
))
{
if
(
!
silent
)
printk
(
KERN_ERR
"FAT: bogus directroy-entries per block"
...
...
@@ -969,7 +969,7 @@ int fat_fill_super(struct super_block *sb, void *data, int silent,
rootdir_sectors
=
sbi
->
dir_entries
*
sizeof
(
struct
msdos_dir_entry
)
/
sb
->
s_blocksize
;
sbi
->
data_start
=
sbi
->
dir_start
+
rootdir_sectors
;
total_sectors
=
CF_LE_W
(
get_unaligned
((
u
16
*
)
&
b
->
sectors
));
total_sectors
=
CF_LE_W
(
get_unaligned
((
__le
16
*
)
&
b
->
sectors
));
if
(
total_sectors
==
0
)
total_sectors
=
CF_LE_L
(
b
->
total_sect
);
...
...
fs/fat/misc.c
View file @
95ca0bf3
...
...
@@ -73,9 +73,9 @@ void fat_clusters_flush(struct super_block *sb)
sbi
->
fsinfo_sector
);
}
else
{
if
(
sbi
->
free_clusters
!=
-
1
)
fsinfo
->
free_clusters
=
CF_LE_L
(
sbi
->
free_clusters
);
fsinfo
->
free_clusters
=
cpu_to_le32
(
sbi
->
free_clusters
);
if
(
sbi
->
prev_free
!=
-
1
)
fsinfo
->
next_cluster
=
CF_LE_L
(
sbi
->
prev_free
);
fsinfo
->
next_cluster
=
cpu_to_le32
(
sbi
->
prev_free
);
mark_buffer_dirty
(
bh
);
}
brelse
(
bh
);
...
...
@@ -243,8 +243,7 @@ int date_dos2unix(unsigned short time,unsigned short date)
/* Convert linear UNIX date to a MS-DOS time/date pair. */
void
fat_date_unix2dos
(
int
unix_date
,
unsigned
short
*
time
,
unsigned
short
*
date
)
void
fat_date_unix2dos
(
int
unix_date
,
__le16
*
time
,
__le16
*
date
)
{
int
day
,
year
,
nl_day
,
month
;
...
...
fs/jbd/commit.c
View file @
95ca0bf3
...
...
@@ -405,9 +405,9 @@ void journal_commit_transaction(journal_t *journal)
jbd_debug
(
4
,
"JBD: got buffer %llu (%p)
\n
"
,
(
unsigned
long
long
)
bh
->
b_blocknr
,
bh
->
b_data
);
header
=
(
journal_header_t
*
)
&
bh
->
b_data
[
0
];
header
->
h_magic
=
htonl
(
JFS_MAGIC_NUMBER
);
header
->
h_blocktype
=
htonl
(
JFS_DESCRIPTOR_BLOCK
);
header
->
h_sequence
=
htonl
(
commit_transaction
->
t_tid
);
header
->
h_magic
=
cpu_to_be32
(
JFS_MAGIC_NUMBER
);
header
->
h_blocktype
=
cpu_to_be32
(
JFS_DESCRIPTOR_BLOCK
);
header
->
h_sequence
=
cpu_to_be32
(
commit_transaction
->
t_tid
);
tagp
=
&
bh
->
b_data
[
sizeof
(
journal_header_t
)];
space_left
=
bh
->
b_size
-
sizeof
(
journal_header_t
);
...
...
@@ -473,8 +473,8 @@ void journal_commit_transaction(journal_t *journal)
tag_flag
|=
JFS_FLAG_SAME_UUID
;
tag
=
(
journal_block_tag_t
*
)
tagp
;
tag
->
t_blocknr
=
htonl
(
jh2bh
(
jh
)
->
b_blocknr
);
tag
->
t_flags
=
htonl
(
tag_flag
);
tag
->
t_blocknr
=
cpu_to_be32
(
jh2bh
(
jh
)
->
b_blocknr
);
tag
->
t_flags
=
cpu_to_be32
(
tag_flag
);
tagp
+=
sizeof
(
journal_block_tag_t
);
space_left
-=
sizeof
(
journal_block_tag_t
);
...
...
@@ -498,7 +498,7 @@ void journal_commit_transaction(journal_t *journal)
submitting the IOs. "tag" still points to
the last tag we set up. */
tag
->
t_flags
|=
htonl
(
JFS_FLAG_LAST_TAG
);
tag
->
t_flags
|=
cpu_to_be32
(
JFS_FLAG_LAST_TAG
);
start_journal_io:
for
(
i
=
0
;
i
<
bufs
;
i
++
)
{
...
...
@@ -631,9 +631,9 @@ void journal_commit_transaction(journal_t *journal)
for
(
i
=
0
;
i
<
jh2bh
(
descriptor
)
->
b_size
;
i
+=
512
)
{
journal_header_t
*
tmp
=
(
journal_header_t
*
)
jh2bh
(
descriptor
)
->
b_data
;
tmp
->
h_magic
=
htonl
(
JFS_MAGIC_NUMBER
);
tmp
->
h_blocktype
=
htonl
(
JFS_COMMIT_BLOCK
);
tmp
->
h_sequence
=
htonl
(
commit_transaction
->
t_tid
);
tmp
->
h_magic
=
cpu_to_be32
(
JFS_MAGIC_NUMBER
);
tmp
->
h_blocktype
=
cpu_to_be32
(
JFS_COMMIT_BLOCK
);
tmp
->
h_sequence
=
cpu_to_be32
(
commit_transaction
->
t_tid
);
}
JBUFFER_TRACE
(
descriptor
,
"write commit block"
);
...
...
fs/jbd/journal.c
View file @
95ca0bf3
...
...
@@ -326,8 +326,8 @@ int journal_write_metadata_buffer(transaction_t *transaction,
/*
* Check for escaping
*/
if
(
*
((
unsigned
int
*
)(
mapped_data
+
new_offset
))
==
htonl
(
JFS_MAGIC_NUMBER
))
{
if
(
*
((
__be32
*
)(
mapped_data
+
new_offset
))
==
cpu_to_be32
(
JFS_MAGIC_NUMBER
))
{
need_copy_out
=
1
;
do_escape
=
1
;
}
...
...
@@ -809,8 +809,8 @@ static int journal_reset(journal_t *journal)
journal_superblock_t
*
sb
=
journal
->
j_superblock
;
unsigned
int
first
,
last
;
first
=
ntohl
(
sb
->
s_first
);
last
=
ntohl
(
sb
->
s_maxlen
);
first
=
be32_to_cpu
(
sb
->
s_first
);
last
=
be32_to_cpu
(
sb
->
s_maxlen
);
journal
->
j_first
=
first
;
journal
->
j_last
=
last
;
...
...
@@ -887,12 +887,12 @@ int journal_create(journal_t *journal)
/* OK, fill in the initial static fields in the new superblock */
sb
=
journal
->
j_superblock
;
sb
->
s_header
.
h_magic
=
htonl
(
JFS_MAGIC_NUMBER
);
sb
->
s_header
.
h_blocktype
=
htonl
(
JFS_SUPERBLOCK_V2
);
sb
->
s_header
.
h_magic
=
cpu_to_be32
(
JFS_MAGIC_NUMBER
);
sb
->
s_header
.
h_blocktype
=
cpu_to_be32
(
JFS_SUPERBLOCK_V2
);
sb
->
s_blocksize
=
htonl
(
journal
->
j_blocksize
);
sb
->
s_maxlen
=
htonl
(
journal
->
j_maxlen
);
sb
->
s_first
=
htonl
(
1
);
sb
->
s_blocksize
=
cpu_to_be32
(
journal
->
j_blocksize
);
sb
->
s_maxlen
=
cpu_to_be32
(
journal
->
j_maxlen
);
sb
->
s_first
=
cpu_to_be32
(
1
);
journal
->
j_transaction_sequence
=
1
;
...
...
@@ -935,9 +935,9 @@ void journal_update_superblock(journal_t *journal, int wait)
jbd_debug
(
1
,
"JBD: updating superblock (start %ld, seq %d, errno %d)
\n
"
,
journal
->
j_tail
,
journal
->
j_tail_sequence
,
journal
->
j_errno
);
sb
->
s_sequence
=
htonl
(
journal
->
j_tail_sequence
);
sb
->
s_start
=
htonl
(
journal
->
j_tail
);
sb
->
s_errno
=
htonl
(
journal
->
j_errno
);
sb
->
s_sequence
=
cpu_to_be32
(
journal
->
j_tail_sequence
);
sb
->
s_start
=
cpu_to_be32
(
journal
->
j_tail
);
sb
->
s_errno
=
cpu_to_be32
(
journal
->
j_errno
);
spin_unlock
(
&
journal
->
j_state_lock
);
BUFFER_TRACE
(
bh
,
"marking dirty"
);
...
...
@@ -988,13 +988,13 @@ static int journal_get_superblock(journal_t *journal)
err
=
-
EINVAL
;
if
(
sb
->
s_header
.
h_magic
!=
htonl
(
JFS_MAGIC_NUMBER
)
||
sb
->
s_blocksize
!=
htonl
(
journal
->
j_blocksize
))
{
if
(
sb
->
s_header
.
h_magic
!=
cpu_to_be32
(
JFS_MAGIC_NUMBER
)
||
sb
->
s_blocksize
!=
cpu_to_be32
(
journal
->
j_blocksize
))
{
printk
(
KERN_WARNING
"JBD: no valid journal superblock found
\n
"
);
goto
out
;
}
switch
(
ntohl
(
sb
->
s_header
.
h_blocktype
))
{
switch
(
be32_to_cpu
(
sb
->
s_header
.
h_blocktype
))
{
case
JFS_SUPERBLOCK_V1
:
journal
->
j_format_version
=
1
;
break
;
...
...
@@ -1006,9 +1006,9 @@ static int journal_get_superblock(journal_t *journal)
goto
out
;
}
if
(
ntohl
(
sb
->
s_maxlen
)
<
journal
->
j_maxlen
)
journal
->
j_maxlen
=
ntohl
(
sb
->
s_maxlen
);
else
if
(
ntohl
(
sb
->
s_maxlen
)
>
journal
->
j_maxlen
)
{
if
(
be32_to_cpu
(
sb
->
s_maxlen
)
<
journal
->
j_maxlen
)
journal
->
j_maxlen
=
be32_to_cpu
(
sb
->
s_maxlen
);
else
if
(
be32_to_cpu
(
sb
->
s_maxlen
)
>
journal
->
j_maxlen
)
{
printk
(
KERN_WARNING
"JBD: journal file too short
\n
"
);
goto
out
;
}
...
...
@@ -1036,11 +1036,11 @@ static int load_superblock(journal_t *journal)
sb
=
journal
->
j_superblock
;
journal
->
j_tail_sequence
=
ntohl
(
sb
->
s_sequence
);
journal
->
j_tail
=
ntohl
(
sb
->
s_start
);
journal
->
j_first
=
ntohl
(
sb
->
s_first
);
journal
->
j_last
=
ntohl
(
sb
->
s_maxlen
);
journal
->
j_errno
=
ntohl
(
sb
->
s_errno
);
journal
->
j_tail_sequence
=
be32_to_cpu
(
sb
->
s_sequence
);
journal
->
j_tail
=
be32_to_cpu
(
sb
->
s_start
);
journal
->
j_first
=
be32_to_cpu
(
sb
->
s_first
);
journal
->
j_last
=
be32_to_cpu
(
sb
->
s_maxlen
);
journal
->
j_errno
=
be32_to_cpu
(
sb
->
s_errno
);
return
0
;
}
...
...
@@ -1253,7 +1253,7 @@ int journal_update_format (journal_t *journal)
sb
=
journal
->
j_superblock
;
switch
(
ntohl
(
sb
->
s_header
.
h_blocktype
))
{
switch
(
be32_to_cpu
(
sb
->
s_header
.
h_blocktype
))
{
case
JFS_SUPERBLOCK_V2
:
return
0
;
case
JFS_SUPERBLOCK_V1
:
...
...
@@ -1275,7 +1275,7 @@ static int journal_convert_superblock_v1(journal_t *journal,
/* Pre-initialise new fields to zero */
offset
=
((
char
*
)
&
(
sb
->
s_feature_compat
))
-
((
char
*
)
sb
);
blocksize
=
ntohl
(
sb
->
s_blocksize
);
blocksize
=
be32_to_cpu
(
sb
->
s_blocksize
);
memset
(
&
sb
->
s_feature_compat
,
0
,
blocksize
-
offset
);
sb
->
s_nr_users
=
cpu_to_be32
(
1
);
...
...
fs/jbd/recovery.c
View file @
95ca0bf3
...
...
@@ -191,10 +191,10 @@ static int count_tags(struct buffer_head *bh, int size)
nr
++
;
tagp
+=
sizeof
(
journal_block_tag_t
);
if
(
!
(
tag
->
t_flags
&
htonl
(
JFS_FLAG_SAME_UUID
)))
if
(
!
(
tag
->
t_flags
&
cpu_to_be32
(
JFS_FLAG_SAME_UUID
)))
tagp
+=
16
;
if
(
tag
->
t_flags
&
htonl
(
JFS_FLAG_LAST_TAG
))
if
(
tag
->
t_flags
&
cpu_to_be32
(
JFS_FLAG_LAST_TAG
))
break
;
}
...
...
@@ -239,8 +239,8 @@ int journal_recover(journal_t *journal)
if
(
!
sb
->
s_start
)
{
jbd_debug
(
1
,
"No recovery required, last transaction %d
\n
"
,
ntohl
(
sb
->
s_sequence
));
journal
->
j_transaction_sequence
=
ntohl
(
sb
->
s_sequence
)
+
1
;
be32_to_cpu
(
sb
->
s_sequence
));
journal
->
j_transaction_sequence
=
be32_to_cpu
(
sb
->
s_sequence
)
+
1
;
return
0
;
}
...
...
@@ -295,7 +295,7 @@ int journal_skip_recovery(journal_t *journal)
++
journal
->
j_transaction_sequence
;
}
else
{
#ifdef CONFIG_JBD_DEBUG
int
dropped
=
info
.
end_transaction
-
ntohl
(
sb
->
s_sequence
);
int
dropped
=
info
.
end_transaction
-
be32_to_cpu
(
sb
->
s_sequence
);
#endif
jbd_debug
(
0
,
"JBD: ignoring %d transaction%s from the journal.
\n
"
,
...
...
@@ -331,8 +331,8 @@ static int do_one_pass(journal_t *journal,
*/
sb
=
journal
->
j_superblock
;
next_commit_ID
=
ntohl
(
sb
->
s_sequence
);
next_log_block
=
ntohl
(
sb
->
s_start
);
next_commit_ID
=
be32_to_cpu
(
sb
->
s_sequence
);
next_log_block
=
be32_to_cpu
(
sb
->
s_start
);
first_commit_ID
=
next_commit_ID
;
if
(
pass
==
PASS_SCAN
)
...
...
@@ -385,13 +385,13 @@ static int do_one_pass(journal_t *journal,
tmp
=
(
journal_header_t
*
)
bh
->
b_data
;
if
(
tmp
->
h_magic
!=
htonl
(
JFS_MAGIC_NUMBER
))
{
if
(
tmp
->
h_magic
!=
cpu_to_be32
(
JFS_MAGIC_NUMBER
))
{
brelse
(
bh
);
break
;
}
blocktype
=
ntohl
(
tmp
->
h_blocktype
);
sequence
=
ntohl
(
tmp
->
h_sequence
);
blocktype
=
be32_to_cpu
(
tmp
->
h_blocktype
);
sequence
=
be32_to_cpu
(
tmp
->
h_sequence
);
jbd_debug
(
3
,
"Found magic %d, sequence %d
\n
"
,
blocktype
,
sequence
);
...
...
@@ -427,7 +427,7 @@ static int do_one_pass(journal_t *journal,
unsigned
long
io_block
;
tag
=
(
journal_block_tag_t
*
)
tagp
;
flags
=
ntohl
(
tag
->
t_flags
);
flags
=
be32_to_cpu
(
tag
->
t_flags
);
io_block
=
next_log_block
++
;
wrap
(
journal
,
next_log_block
);
...
...
@@ -444,7 +444,7 @@ static int do_one_pass(journal_t *journal,
unsigned
long
blocknr
;
J_ASSERT
(
obh
!=
NULL
);
blocknr
=
ntohl
(
tag
->
t_blocknr
);
blocknr
=
be32_to_cpu
(
tag
->
t_blocknr
);
/* If the block has been
* revoked, then we're all done
...
...
@@ -476,8 +476,8 @@ static int do_one_pass(journal_t *journal,
memcpy
(
nbh
->
b_data
,
obh
->
b_data
,
journal
->
j_blocksize
);
if
(
flags
&
JFS_FLAG_ESCAPE
)
{
*
((
unsigned
int
*
)
bh
->
b_data
)
=
htonl
(
JFS_MAGIC_NUMBER
);
*
((
__be32
*
)
bh
->
b_data
)
=
cpu_to_be32
(
JFS_MAGIC_NUMBER
);
}
BUFFER_TRACE
(
nbh
,
"marking dirty"
);
...
...
@@ -572,13 +572,13 @@ static int scan_revoke_records(journal_t *journal, struct buffer_head *bh,
header
=
(
journal_revoke_header_t
*
)
bh
->
b_data
;
offset
=
sizeof
(
journal_revoke_header_t
);
max
=
ntohl
(
header
->
r_count
);
max
=
be32_to_cpu
(
header
->
r_count
);
while
(
offset
<
max
)
{
unsigned
long
blocknr
;
int
err
;
blocknr
=
ntohl
(
*
((
unsigned
int
*
)
(
bh
->
b_data
+
offset
)));
blocknr
=
be32_to_cpu
(
*
((
__be32
*
)
(
bh
->
b_data
+
offset
)));
offset
+=
4
;
err
=
journal_set_revoke
(
journal
,
blocknr
,
sequence
);
if
(
err
)
...
...
fs/jbd/revoke.c
View file @
95ca0bf3
...
...
@@ -566,9 +566,9 @@ static void write_one_revoke_record(journal_t *journal,
if
(
!
descriptor
)
return
;
header
=
(
journal_header_t
*
)
&
jh2bh
(
descriptor
)
->
b_data
[
0
];
header
->
h_magic
=
htonl
(
JFS_MAGIC_NUMBER
);
header
->
h_blocktype
=
htonl
(
JFS_REVOKE_BLOCK
);
header
->
h_sequence
=
htonl
(
transaction
->
t_tid
);
header
->
h_magic
=
cpu_to_be32
(
JFS_MAGIC_NUMBER
);
header
->
h_blocktype
=
cpu_to_be32
(
JFS_REVOKE_BLOCK
);
header
->
h_sequence
=
cpu_to_be32
(
transaction
->
t_tid
);
/* Record it so that we can wait for IO completion later */
JBUFFER_TRACE
(
descriptor
,
"file as BJ_LogCtl"
);
...
...
@@ -578,8 +578,8 @@ static void write_one_revoke_record(journal_t *journal,
*
descriptorp
=
descriptor
;
}
*
((
unsigned
int
*
)(
&
jh2bh
(
descriptor
)
->
b_data
[
offset
]))
=
htonl
(
record
->
blocknr
);
*
((
__be32
*
)(
&
jh2bh
(
descriptor
)
->
b_data
[
offset
]))
=
cpu_to_be32
(
record
->
blocknr
);
offset
+=
4
;
*
offsetp
=
offset
;
}
...
...
@@ -604,7 +604,7 @@ static void flush_descriptor(journal_t *journal,
}
header
=
(
journal_revoke_header_t
*
)
jh2bh
(
descriptor
)
->
b_data
;
header
->
r_count
=
htonl
(
offset
);
header
->
r_count
=
cpu_to_be32
(
offset
);
set_buffer_jwrite
(
bh
);
BUFFER_TRACE
(
bh
,
"write"
);
set_buffer_dirty
(
bh
);
...
...
fs/sysv/balloc.c
View file @
95ca0bf3
...
...
@@ -27,23 +27,23 @@
sb->sv_sbd2->s_tfree = *sb->sv_free_blocks
but we nevertheless keep it up to date. */
static
inline
u32
*
get_chunk
(
struct
super_block
*
sb
,
struct
buffer_head
*
bh
)
static
inline
sysv_zone_t
*
get_chunk
(
struct
super_block
*
sb
,
struct
buffer_head
*
bh
)
{
char
*
bh_data
=
bh
->
b_data
;
if
(
SYSV_SB
(
sb
)
->
s_type
==
FSTYPE_SYSV4
)
return
(
u32
*
)(
bh_data
+
4
);
return
(
sysv_zone_t
*
)(
bh_data
+
4
);
else
return
(
u32
*
)(
bh_data
+
2
);
return
(
sysv_zone_t
*
)(
bh_data
+
2
);
}
/* NOTE NOTE NOTE: nr is a block number _as_ _stored_ _on_ _disk_ */
void
sysv_free_block
(
struct
super_block
*
sb
,
u32
nr
)
void
sysv_free_block
(
struct
super_block
*
sb
,
sysv_zone_t
nr
)
{
struct
sysv_sb_info
*
sbi
=
SYSV_SB
(
sb
);
struct
buffer_head
*
bh
;
u32
*
blocks
=
sbi
->
s_bcache
;
sysv_zone_t
*
blocks
=
sbi
->
s_bcache
;
unsigned
count
;
unsigned
block
=
fs32_to_cpu
(
sbi
,
nr
);
...
...
@@ -81,7 +81,7 @@ void sysv_free_block(struct super_block * sb, u32 nr)
return
;
}
memset
(
bh
->
b_data
,
0
,
sb
->
s_blocksize
);
*
(
u
16
*
)
bh
->
b_data
=
cpu_to_fs16
(
sbi
,
count
);
*
(
__fs
16
*
)
bh
->
b_data
=
cpu_to_fs16
(
sbi
,
count
);
memcpy
(
get_chunk
(
sb
,
bh
),
blocks
,
count
*
sizeof
(
sysv_zone_t
));
mark_buffer_dirty
(
bh
);
set_buffer_uptodate
(
bh
);
...
...
@@ -96,11 +96,11 @@ void sysv_free_block(struct super_block * sb, u32 nr)
unlock_super
(
sb
);
}
u32
sysv_new_block
(
struct
super_block
*
sb
)
sysv_zone_t
sysv_new_block
(
struct
super_block
*
sb
)
{
struct
sysv_sb_info
*
sbi
=
SYSV_SB
(
sb
);
unsigned
int
block
;
u32
nr
;
sysv_zone_t
nr
;
struct
buffer_head
*
bh
;
unsigned
count
;
...
...
@@ -133,7 +133,7 @@ u32 sysv_new_block(struct super_block * sb)
*
sbi
->
s_bcache_count
=
cpu_to_fs16
(
sbi
,
1
);
goto
Enospc
;
}
count
=
fs16_to_cpu
(
sbi
,
*
(
u
16
*
)
bh
->
b_data
);
count
=
fs16_to_cpu
(
sbi
,
*
(
__fs
16
*
)
bh
->
b_data
);
if
(
count
>
sbi
->
s_flc_size
)
{
printk
(
"sysv_new_block: free-list block with >flc_size entries
\n
"
);
brelse
(
bh
);
...
...
@@ -161,7 +161,7 @@ unsigned long sysv_count_free_blocks(struct super_block * sb)
int
sb_count
;
int
count
;
struct
buffer_head
*
bh
=
NULL
;
u32
*
blocks
;
sysv_zone_t
*
blocks
;
unsigned
block
;
int
n
;
...
...
@@ -184,15 +184,16 @@ unsigned long sysv_count_free_blocks(struct super_block * sb)
n
=
fs16_to_cpu
(
sbi
,
*
sbi
->
s_bcache_count
);
blocks
=
sbi
->
s_bcache
;
while
(
1
)
{
sysv_zone_t
zone
;
if
(
n
>
sbi
->
s_flc_size
)
goto
E2big
;
block
=
0
;
while
(
n
&&
(
block
=
blocks
[
--
n
])
!=
0
)
zone
=
0
;
while
(
n
&&
(
zone
=
blocks
[
--
n
])
!=
0
)
count
++
;
if
(
block
==
0
)
if
(
zone
==
0
)
break
;
block
=
fs32_to_cpu
(
sbi
,
block
);
block
=
fs32_to_cpu
(
sbi
,
zone
);
if
(
bh
)
brelse
(
bh
);
...
...
@@ -202,7 +203,7 @@ unsigned long sysv_count_free_blocks(struct super_block * sb)
bh
=
sb_bread
(
sb
,
block
);
if
(
!
bh
)
goto
Eio
;
n
=
fs16_to_cpu
(
sbi
,
*
(
u
16
*
)
bh
->
b_data
);
n
=
fs16_to_cpu
(
sbi
,
*
(
__fs
16
*
)
bh
->
b_data
);
blocks
=
get_chunk
(
sb
,
bh
);
}
if
(
bh
)
...
...
fs/sysv/ialloc.c
View file @
95ca0bf3
...
...
@@ -137,7 +137,7 @@ struct inode * sysv_new_inode(const struct inode * dir, mode_t mode)
struct
super_block
*
sb
=
dir
->
i_sb
;
struct
sysv_sb_info
*
sbi
=
SYSV_SB
(
sb
);
struct
inode
*
inode
;
u16
ino
;
sysv_ino_t
ino
;
unsigned
count
;
inode
=
new_inode
(
sb
);
...
...
fs/sysv/itree.c
View file @
95ca0bf3
...
...
@@ -50,20 +50,20 @@ static int block_to_path(struct inode *inode, long block, int offsets[DEPTH])
return
n
;
}
static
inline
int
block_to_cpu
(
struct
sysv_sb_info
*
sbi
,
u32
nr
)
static
inline
int
block_to_cpu
(
struct
sysv_sb_info
*
sbi
,
sysv_zone_t
nr
)
{
return
sbi
->
s_block_base
+
fs32_to_cpu
(
sbi
,
nr
);
}
typedef
struct
{
u32
*
p
;
u32
key
;
sysv_zone_t
*
p
;
sysv_zone_t
key
;
struct
buffer_head
*
bh
;
}
Indirect
;
static
rwlock_t
pointers_lock
=
RW_LOCK_UNLOCKED
;
static
inline
void
add_chain
(
Indirect
*
p
,
struct
buffer_head
*
bh
,
u32
*
v
)
static
inline
void
add_chain
(
Indirect
*
p
,
struct
buffer_head
*
bh
,
sysv_zone_t
*
v
)
{
p
->
key
=
*
(
p
->
p
=
v
);
p
->
bh
=
bh
;
...
...
@@ -76,9 +76,9 @@ static inline int verify_chain(Indirect *from, Indirect *to)
return
(
from
>
to
);
}
static
inline
u32
*
block_end
(
struct
buffer_head
*
bh
)
static
inline
sysv_zone_t
*
block_end
(
struct
buffer_head
*
bh
)
{
return
(
u32
*
)((
char
*
)
bh
->
b_data
+
bh
->
b_size
);
return
(
sysv_zone_t
*
)((
char
*
)
bh
->
b_data
+
bh
->
b_size
);
}
/*
...
...
@@ -105,7 +105,7 @@ static Indirect *get_branch(struct inode *inode,
goto
failure
;
if
(
!
verify_chain
(
chain
,
p
))
goto
changed
;
add_chain
(
++
p
,
bh
,
(
u32
*
)
bh
->
b_data
+
*++
offsets
);
add_chain
(
++
p
,
bh
,
(
sysv_zone_t
*
)
bh
->
b_data
+
*++
offsets
);
if
(
!
p
->
key
)
goto
no_block
;
}
...
...
@@ -147,7 +147,7 @@ static int alloc_branch(struct inode *inode,
lock_buffer
(
bh
);
memset
(
bh
->
b_data
,
0
,
blocksize
);
branch
[
n
].
bh
=
bh
;
branch
[
n
].
p
=
(
u32
*
)
bh
->
b_data
+
offsets
[
n
];
branch
[
n
].
p
=
(
sysv_zone_t
*
)
bh
->
b_data
+
offsets
[
n
];
*
branch
[
n
].
p
=
branch
[
n
].
key
;
set_buffer_uptodate
(
bh
);
unlock_buffer
(
bh
);
...
...
@@ -265,7 +265,7 @@ static int get_block(struct inode *inode, sector_t iblock, struct buffer_head *b
goto
reread
;
}
static
inline
int
all_zeroes
(
u32
*
p
,
u32
*
q
)
static
inline
int
all_zeroes
(
sysv_zone_t
*
p
,
sysv_zone_t
*
q
)
{
while
(
p
<
q
)
if
(
*
p
++
)
...
...
@@ -277,7 +277,7 @@ static Indirect *find_shared(struct inode *inode,
int
depth
,
int
offsets
[],
Indirect
chain
[],
u32
*
top
)
sysv_zone_t
*
top
)
{
Indirect
*
partial
,
*
p
;
int
k
,
err
;
...
...
@@ -298,7 +298,7 @@ static Indirect *find_shared(struct inode *inode,
write_unlock
(
&
pointers_lock
);
goto
no_top
;
}
for
(
p
=
partial
;
p
>
chain
&&
all_zeroes
((
u32
*
)
p
->
bh
->
b_data
,
p
->
p
);
p
--
)
for
(
p
=
partial
;
p
>
chain
&&
all_zeroes
((
sysv_zone_t
*
)
p
->
bh
->
b_data
,
p
->
p
);
p
--
)
;
/*
* OK, we've found the last block that must survive. The rest of our
...
...
@@ -322,10 +322,10 @@ static Indirect *find_shared(struct inode *inode,
return
partial
;
}
static
inline
void
free_data
(
struct
inode
*
inode
,
u32
*
p
,
u32
*
q
)
static
inline
void
free_data
(
struct
inode
*
inode
,
sysv_zone_t
*
p
,
sysv_zone_t
*
q
)
{
for
(
;
p
<
q
;
p
++
)
{
u32
nr
=
*
p
;
sysv_zone_t
nr
=
*
p
;
if
(
nr
)
{
*
p
=
0
;
sysv_free_block
(
inode
->
i_sb
,
nr
);
...
...
@@ -334,7 +334,7 @@ static inline void free_data(struct inode *inode, u32 *p, u32 *q)
}
}
static
void
free_branches
(
struct
inode
*
inode
,
u32
*
p
,
u32
*
q
,
int
depth
)
static
void
free_branches
(
struct
inode
*
inode
,
sysv_zone_t
*
p
,
sysv_zone_t
*
q
,
int
depth
)
{
struct
buffer_head
*
bh
;
struct
super_block
*
sb
=
inode
->
i_sb
;
...
...
@@ -342,7 +342,7 @@ static void free_branches(struct inode *inode, u32 *p, u32 *q, int depth)
if
(
depth
--
)
{
for
(
;
p
<
q
;
p
++
)
{
int
block
;
u32
nr
=
*
p
;
sysv_zone_t
nr
=
*
p
;
if
(
!
nr
)
continue
;
*
p
=
0
;
...
...
@@ -350,7 +350,7 @@ static void free_branches(struct inode *inode, u32 *p, u32 *q, int depth)
bh
=
sb_bread
(
sb
,
block
);
if
(
!
bh
)
continue
;
free_branches
(
inode
,
(
u32
*
)
bh
->
b_data
,
free_branches
(
inode
,
(
sysv_zone_t
*
)
bh
->
b_data
,
block_end
(
bh
),
depth
);
bforget
(
bh
);
sysv_free_block
(
sb
,
nr
);
...
...
@@ -362,11 +362,11 @@ static void free_branches(struct inode *inode, u32 *p, u32 *q, int depth)
void
sysv_truncate
(
struct
inode
*
inode
)
{
u32
*
i_data
=
SYSV_I
(
inode
)
->
i_data
;
sysv_zone_t
*
i_data
=
SYSV_I
(
inode
)
->
i_data
;
int
offsets
[
DEPTH
];
Indirect
chain
[
DEPTH
];
Indirect
*
partial
;
in
t
nr
=
0
;
sysv_zone_
t
nr
=
0
;
int
n
;
long
iblock
;
unsigned
blocksize
;
...
...
fs/sysv/super.c
View file @
95ca0bf3
...
...
@@ -178,16 +178,22 @@ static void detected_v7(struct sysv_sb_info *sbi)
static
int
detect_xenix
(
struct
sysv_sb_info
*
sbi
,
struct
buffer_head
*
bh
)
{
struct
xenix_super_block
*
sbd
=
(
struct
xenix_super_block
*
)
bh
->
b_data
;
if
(
sbd
->
s_magic
==
cpu_to_le32
(
0x2b5544
))
if
(
*
(
__le32
*
)
&
sbd
->
s_magic
==
cpu_to_le32
(
0x2b5544
))
sbi
->
s_bytesex
=
BYTESEX_LE
;
else
if
(
sbd
->
s_magic
==
cpu_to_be32
(
0x2b5544
))
else
if
(
*
(
__be32
*
)
&
sbd
->
s_magic
==
cpu_to_be32
(
0x2b5544
))
sbi
->
s_bytesex
=
BYTESEX_BE
;
else
return
0
;
if
(
sbd
->
s_type
>
2
||
sbd
->
s_type
<
1
)
return
0
;
switch
(
fs32_to_cpu
(
sbi
,
sbd
->
s_type
))
{
case
1
:
sbi
->
s_type
=
FSTYPE_XENIX
;
return
1
;
case
2
:
sbi
->
s_type
=
FSTYPE_XENIX
;
return
sbd
->
s_type
;
return
2
;
default:
return
0
;
}
}
static
int
detect_sysv
(
struct
sysv_sb_info
*
sbi
,
struct
buffer_head
*
bh
)
...
...
@@ -195,15 +201,18 @@ static int detect_sysv(struct sysv_sb_info *sbi, struct buffer_head *bh)
struct
super_block
*
sb
=
sbi
->
s_sb
;
/* All relevant fields are at the same offsets in R2 and R4 */
struct
sysv4_super_block
*
sbd
;
u32
type
;
sbd
=
(
struct
sysv4_super_block
*
)
(
bh
->
b_data
+
BLOCK_SIZE
/
2
);
if
(
sbd
->
s_magic
==
cpu_to_le32
(
0xfd187e20
))
if
(
*
(
__le32
*
)
&
sbd
->
s_magic
==
cpu_to_le32
(
0xfd187e20
))
sbi
->
s_bytesex
=
BYTESEX_LE
;
else
if
(
sbd
->
s_magic
==
cpu_to_be32
(
0xfd187e20
))
else
if
(
*
(
__be32
*
)
&
sbd
->
s_magic
==
cpu_to_be32
(
0xfd187e20
))
sbi
->
s_bytesex
=
BYTESEX_BE
;
else
return
0
;
type
=
fs32_to_cpu
(
sbi
,
sbd
->
s_type
);
if
(
fs16_to_cpu
(
sbi
,
sbd
->
s_nfree
)
==
0xffff
)
{
sbi
->
s_type
=
FSTYPE_AFS
;
sbi
->
s_forced_ro
=
1
;
...
...
@@ -212,18 +221,17 @@ static int detect_sysv(struct sysv_sb_info *sbi, struct buffer_head *bh)
"forcing read-only mode.
\n
"
,
sb
->
s_id
);
}
return
sbd
->
s_
type
;
return
type
;
}
if
(
fs32_to_cpu
(
sbi
,
sbd
->
s_time
)
<
JAN_1_1980
)
{
/* this is likely to happen on SystemV2 FS */
if
(
sbd
->
s_type
>
3
||
sbd
->
s_
type
<
1
)
if
(
type
>
3
||
type
<
1
)
return
0
;
sbi
->
s_type
=
FSTYPE_SYSV2
;
return
sbd
->
s_
type
;
return
type
;
}
if
((
sbd
->
s_type
>
3
||
sbd
->
s_type
<
1
)
&&
(
sbd
->
s_type
>
0x30
||
sbd
->
s_type
<
0x10
))
if
((
type
>
3
||
type
<
1
)
&&
(
type
>
0x30
||
type
<
0x10
))
return
0
;
/* On Interactive Unix (ISC) Version 4.0/3.x s_type field = 0x10,
...
...
@@ -231,14 +239,14 @@ static int detect_sysv(struct sysv_sb_info *sbi, struct buffer_head *bh)
filename limit is gone. Due to lack of information about this
feature read-only mode seems to be a reasonable approach... -KGB */
if
(
sbd
->
s_
type
>=
0x10
)
{
if
(
type
>=
0x10
)
{
printk
(
"SysV FS: can't handle long file names on %s, "
"forcing read-only mode.
\n
"
,
sb
->
s_id
);
sbi
->
s_forced_ro
=
1
;
}
sbi
->
s_type
=
FSTYPE_SYSV4
;
return
sbd
->
s_type
>=
0x10
?
(
sbd
->
s_type
>>
4
)
:
sbd
->
s_
type
;
return
type
>=
0x10
?
type
>>
4
:
type
;
}
static
int
detect_coherent
(
struct
sysv_sb_info
*
sbi
,
struct
buffer_head
*
bh
)
...
...
fs/sysv/sysv.h
View file @
95ca0bf3
...
...
@@ -2,6 +2,10 @@
#define _SYSV_H
#include <linux/buffer_head.h>
typedef
__u16
__bitwise
__fs16
;
typedef
__u32
__bitwise
__fs32
;
#include <linux/sysv_fs.h>
/*
...
...
@@ -38,14 +42,14 @@ struct sysv_sb_info {
different superblock layout. */
char
*
s_sbd1
;
/* entire superblock data, for part 1 */
char
*
s_sbd2
;
/* entire superblock data, for part 2 */
u16
*
s_sb_fic_count
;
/* pointer to s_sbd->s_ninode */
u16
*
s_sb_fic_inodes
;
/* pointer to s_sbd->s_inode */
u16
*
s_sb_total_free_inodes
;
/* pointer to s_sbd->s_tinode */
u16
*
s_bcache_count
;
/* pointer to s_sbd->s_nfree */
u32
*
s_bcache
;
/* pointer to s_sbd->s_free */
u32
*
s_free_blocks
;
/* pointer to s_sbd->s_tfree */
u32
*
s_sb_time
;
/* pointer to s_sbd->s_time */
u32
*
s_sb_state
;
/* pointer to s_sbd->s_state, only FSTYPE_SYSV */
__fs16
*
s_sb_fic_count
;
/* pointer to s_sbd->s_ninode */
sysv_ino_t
*
s_sb_fic_inodes
;
/* pointer to s_sbd->s_inode */
__fs16
*
s_sb_total_free_inodes
;
/* pointer to s_sbd->s_tinode */
__fs16
*
s_bcache_count
;
/* pointer to s_sbd->s_nfree */
sysv_zone_t
*
s_bcache
;
/* pointer to s_sbd->s_free */
__fs32
*
s_free_blocks
;
/* pointer to s_sbd->s_tfree */
__fs32
*
s_sb_time
;
/* pointer to s_sbd->s_time */
__fs32
*
s_sb_state
;
/* pointer to s_sbd->s_state, only FSTYPE_SYSV */
/* We keep those superblock entities that don't change here;
this saves us an indirection and perhaps a conversion. */
u32
s_firstinodezone
;
/* index of first inode zone */
...
...
@@ -61,7 +65,7 @@ struct sysv_sb_info {
* SystemV/V7/Coherent FS inode data in memory
*/
struct
sysv_inode_info
{
u
32
i_data
[
13
];
__fs
32
i_data
[
13
];
u32
i_dir_start_lookup
;
struct
inode
vfs_inode
;
};
...
...
@@ -126,8 +130,8 @@ extern void sysv_free_inode(struct inode *);
extern
unsigned
long
sysv_count_free_inodes
(
struct
super_block
*
);
/* balloc.c */
extern
u32
sysv_new_block
(
struct
super_block
*
);
extern
void
sysv_free_block
(
struct
super_block
*
,
u32
);
extern
sysv_zone_t
sysv_new_block
(
struct
super_block
*
);
extern
void
sysv_free_block
(
struct
super_block
*
,
sysv_zone_t
);
extern
unsigned
long
sysv_count_free_blocks
(
struct
super_block
*
);
/* itree.c */
...
...
@@ -181,58 +185,60 @@ static inline u32 PDP_swab(u32 x)
#endif
}
static
inline
u32
fs32_to_cpu
(
struct
sysv_sb_info
*
sbi
,
u
32
n
)
static
inline
__u32
fs32_to_cpu
(
struct
sysv_sb_info
*
sbi
,
__fs
32
n
)
{
if
(
sbi
->
s_bytesex
==
BYTESEX_PDP
)
return
PDP_swab
(
n
);
return
PDP_swab
(
(
__force
__u32
)
n
);
else
if
(
sbi
->
s_bytesex
==
BYTESEX_LE
)
return
le32_to_cpu
(
n
);
return
le32_to_cpu
(
(
__force
__le32
)
n
);
else
return
be32_to_cpu
(
n
);
return
be32_to_cpu
(
(
__force
__be32
)
n
);
}
static
inline
u32
cpu_to_fs32
(
struct
sysv_sb_info
*
sbi
,
u32
n
)
static
inline
__fs32
cpu_to_fs32
(
struct
sysv_sb_info
*
sbi
,
__
u32
n
)
{
if
(
sbi
->
s_bytesex
==
BYTESEX_PDP
)
return
PDP_swab
(
n
);
return
(
__force
__fs32
)
PDP_swab
(
n
);
else
if
(
sbi
->
s_bytesex
==
BYTESEX_LE
)
return
cpu_to_le32
(
n
);
return
(
__force
__fs32
)
cpu_to_le32
(
n
);
else
return
cpu_to_be32
(
n
);
return
(
__force
__fs32
)
cpu_to_be32
(
n
);
}
static
inline
u32
fs32_add
(
struct
sysv_sb_info
*
sbi
,
u
32
*
n
,
int
d
)
static
inline
__fs32
fs32_add
(
struct
sysv_sb_info
*
sbi
,
__fs
32
*
n
,
int
d
)
{
if
(
sbi
->
s_bytesex
==
BYTESEX_PDP
)
return
*
n
=
PDP_swab
(
PDP_swab
(
*
n
)
+
d
);
*
(
__u32
*
)
n
=
PDP_swab
(
PDP_swab
(
*
(
__u32
*
)
n
)
+
d
);
else
if
(
sbi
->
s_bytesex
==
BYTESEX_LE
)
return
*
n
=
cpu_to_le32
(
le32_to_cpu
(
*
n
)
+
d
);
*
(
__le32
*
)
n
=
cpu_to_le32
(
le32_to_cpu
(
*
(
__le32
*
)
n
)
+
d
);
else
return
*
n
=
cpu_to_be32
(
be32_to_cpu
(
*
n
)
+
d
);
*
(
__be32
*
)
n
=
cpu_to_be32
(
be32_to_cpu
(
*
(
__be32
*
)
n
)
+
d
);
return
*
n
;
}
static
inline
u16
fs16_to_cpu
(
struct
sysv_sb_info
*
sbi
,
u
16
n
)
static
inline
__u16
fs16_to_cpu
(
struct
sysv_sb_info
*
sbi
,
__fs
16
n
)
{
if
(
sbi
->
s_bytesex
!=
BYTESEX_BE
)
return
le16_to_cpu
(
n
);
return
le16_to_cpu
(
(
__force
__le16
)
n
);
else
return
be16_to_cpu
(
n
);
return
be16_to_cpu
(
(
__force
__be16
)
n
);
}
static
inline
u16
cpu_to_fs16
(
struct
sysv_sb_info
*
sbi
,
u16
n
)
static
inline
__fs16
cpu_to_fs16
(
struct
sysv_sb_info
*
sbi
,
__
u16
n
)
{
if
(
sbi
->
s_bytesex
!=
BYTESEX_BE
)
return
cpu_to_le16
(
n
);
return
(
__force
__fs16
)
cpu_to_le16
(
n
);
else
return
cpu_to_be16
(
n
);
return
(
__force
__fs16
)
cpu_to_be16
(
n
);
}
static
inline
u16
fs16_add
(
struct
sysv_sb_info
*
sbi
,
u
16
*
n
,
int
d
)
static
inline
__fs16
fs16_add
(
struct
sysv_sb_info
*
sbi
,
__fs
16
*
n
,
int
d
)
{
if
(
sbi
->
s_bytesex
!=
BYTESEX_BE
)
return
*
n
=
cpu_to_le16
(
le16_to_cpu
(
*
n
)
+
d
);
*
(
__le16
*
)
n
=
cpu_to_le16
(
le16_to_cpu
(
*
(
__le16
*
)
n
)
+
d
);
else
return
*
n
=
cpu_to_be16
(
be16_to_cpu
(
*
n
)
+
d
);
*
(
__be16
*
)
n
=
cpu_to_be16
(
be16_to_cpu
(
*
(
__be16
*
)
n
)
+
d
);
return
*
n
;
}
#endif
/* _SYSV_H */
fs/vfat/namei.c
View file @
95ca0bf3
...
...
@@ -677,7 +677,8 @@ static int vfat_build_slots(struct inode *dir, const unsigned char *name,
de
->
attr
=
is_dir
?
ATTR_DIR
:
ATTR_ARCH
;
de
->
lcase
=
lcase
;
de
->
adate
=
de
->
cdate
=
de
->
date
=
0
;
de
->
ctime_ms
=
de
->
ctime
=
de
->
time
=
0
;
de
->
ctime
=
de
->
time
=
0
;
de
->
ctime_ms
=
0
;
de
->
start
=
0
;
de
->
starthi
=
0
;
de
->
size
=
0
;
...
...
@@ -1046,8 +1047,8 @@ static int vfat_rename(struct inode *old_dir, struct dentry *old_dentry,
if
(
is_dir
)
{
int
start
=
MSDOS_I
(
new_dir
)
->
i_logstart
;
dotdot_de
->
start
=
CT_LE_W
(
start
);
dotdot_de
->
starthi
=
CT_LE_W
(
start
>>
16
);
dotdot_de
->
start
=
cpu_to_le16
(
start
);
dotdot_de
->
starthi
=
cpu_to_le16
(
start
>>
16
);
mark_buffer_dirty
(
dotdot_bh
);
old_dir
->
i_nlink
--
;
if
(
new_inode
)
{
...
...
include/linux/efs_dir.h
View file @
95ca0bf3
...
...
@@ -11,7 +11,7 @@
#define EFS_DIRBSIZE (1 << EFS_DIRBSIZE_BITS)
struct
efs_dentry
{
unsigned
int
inode
;
__be32
inode
;
unsigned
char
namelen
;
char
name
[
3
];
};
...
...
@@ -23,7 +23,7 @@ struct efs_dentry {
#define EFS_DIRBLK_MAGIC 0xbeef
/* moo */
struct
efs_dir
{
unsigned
short
magic
;
__be16
magic
;
unsigned
char
firstused
;
unsigned
char
slots
;
...
...
include/linux/efs_fs_i.h
View file @
95ca0bf3
...
...
@@ -28,8 +28,8 @@ typedef union extent_u {
}
efs_extent
;
typedef
struct
edevs
{
short
odev
;
unsigned
int
ndev
;
__be16
odev
;
__be32
ndev
;
}
efs_devs
;
/*
...
...
@@ -37,16 +37,16 @@ typedef struct edevs {
* is exactly 128 bytes long.
*/
struct
efs_dinode
{
u_short
di_mode
;
/* mode and type of file */
short
di_nlink
;
/* number of links to file */
u_short
di_uid
;
/* owner's user id */
u_short
di_gid
;
/* owner's group id */
int32_t
di_size
;
/* number of bytes in file */
int32_t
di_atime
;
/* time last accessed */
int32_t
di_mtime
;
/* time last modified */
int32_t
di_ctime
;
/* time created */
uint32_t
di_gen
;
/* generation number */
short
di_numextents
;
/* # of extents */
__be16
di_mode
;
/* mode and type of file */
__be16
di_nlink
;
/* number of links to file */
__be16
di_uid
;
/* owner's user id */
__be16
di_gid
;
/* owner's group id */
__be32
di_size
;
/* number of bytes in file */
__be32
di_atime
;
/* time last accessed */
__be32
di_mtime
;
/* time last modified */
__be32
di_ctime
;
/* time created */
__be32
di_gen
;
/* generation number */
__be16
di_numextents
;
/* # of extents */
u_char
di_version
;
/* version of inode */
u_char
di_spare
;
/* spare - used by AFS */
union
di_addr
{
...
...
include/linux/efs_fs_sb.h
View file @
95ca0bf3
...
...
@@ -23,39 +23,39 @@
/* efs superblock on disk */
struct
efs_super
{
int32_t
fs_size
;
/* size of filesystem, in sectors */
int32_t
fs_firstcg
;
/* bb offset to first cg */
int32_t
fs_cgfsize
;
/* size of cylinder group in bb's */
short
fs_cgisize
;
/* bb's of inodes per cylinder group */
short
fs_sectors
;
/* sectors per track */
short
fs_heads
;
/* heads per cylinder */
short
fs_ncg
;
/* # of cylinder groups in filesystem */
short
fs_dirty
;
/* fs needs to be fsck'd */
int32_t
fs_time
;
/* last super-block update */
int32_t
fs_magic
;
/* magic number */
__be32
fs_size
;
/* size of filesystem, in sectors */
__be32
fs_firstcg
;
/* bb offset to first cg */
__be32
fs_cgfsize
;
/* size of cylinder group in bb's */
__be16
fs_cgisize
;
/* bb's of inodes per cylinder group */
__be16
fs_sectors
;
/* sectors per track */
__be16
fs_heads
;
/* heads per cylinder */
__be16
fs_ncg
;
/* # of cylinder groups in filesystem */
__be16
fs_dirty
;
/* fs needs to be fsck'd */
__be32
fs_time
;
/* last super-block update */
__be32
fs_magic
;
/* magic number */
char
fs_fname
[
6
];
/* file system name */
char
fs_fpack
[
6
];
/* file system pack name */
int32_t
fs_bmsize
;
/* size of bitmap in bytes */
int32_t
fs_tfree
;
/* total free data blocks */
int32_t
fs_tinode
;
/* total free inodes */
int32_t
fs_bmblock
;
/* bitmap location. */
int32_t
fs_replsb
;
/* Location of replicated superblock. */
int32_t
fs_lastialloc
;
/* last allocated inode */
__be32
fs_bmsize
;
/* size of bitmap in bytes */
__be32
fs_tfree
;
/* total free data blocks */
__be32
fs_tinode
;
/* total free inodes */
__be32
fs_bmblock
;
/* bitmap location. */
__be32
fs_replsb
;
/* Location of replicated superblock. */
__be32
fs_lastialloc
;
/* last allocated inode */
char
fs_spare
[
20
];
/* space for expansion - MUST BE ZERO */
int32_t
fs_checksum
;
/* checksum of volume portion of fs */
__be32
fs_checksum
;
/* checksum of volume portion of fs */
};
/* efs superblock information in memory */
struct
efs_sb_info
{
int32_t
fs_magic
;
/* superblock magic number */
int32_t
fs_start
;
/* first block of filesystem */
int32_t
first_block
;
/* first data block in filesystem */
int32_t
total_blocks
;
/* total number of blocks in filesystem */
int32_t
group_size
;
/* # of blocks a group consists of */
int32_t
data_free
;
/* # of free data blocks */
int32_t
inode_free
;
/* # of free inodes */
short
inode_blocks
;
/* # of blocks used for inodes in every grp */
short
total_groups
;
/* # of groups */
__u32
fs_magic
;
/* superblock magic number */
__u32
fs_start
;
/* first block of filesystem */
__u32
first_block
;
/* first data block in filesystem */
__u32
total_blocks
;
/* total number of blocks in filesystem */
__u32
group_size
;
/* # of blocks a group consists of */
__u32
data_free
;
/* # of free data blocks */
__u32
inode_free
;
/* # of free inodes */
__u16
inode_blocks
;
/* # of blocks used for inodes in every grp */
__u16
total_groups
;
/* # of groups */
};
#endif
/* __EFS_FS_SB_H__ */
...
...
include/linux/efs_vh.h
View file @
95ca0bf3
...
...
@@ -17,26 +17,26 @@
struct
volume_directory
{
char
vd_name
[
VDNAMESIZE
];
/* name */
int
vd_lbn
;
/* logical block number */
int
vd_nbytes
;
/* file length in bytes */
__be32
vd_lbn
;
/* logical block number */
__be32
vd_nbytes
;
/* file length in bytes */
};
struct
partition_table
{
/* one per logical partition */
int
pt_nblks
;
/* # of logical blks in partition */
int
pt_firstlbn
;
/* first lbn of partition */
int
pt_type
;
/* use of partition */
__be32
pt_nblks
;
/* # of logical blks in partition */
__be32
pt_firstlbn
;
/* first lbn of partition */
__be32
pt_type
;
/* use of partition */
};
struct
volume_header
{
int
vh_magic
;
/* identifies volume header */
short
vh_rootpt
;
/* root partition number */
short
vh_swappt
;
/* swap partition number */
__be32
vh_magic
;
/* identifies volume header */
__be16
vh_rootpt
;
/* root partition number */
__be16
vh_swappt
;
/* swap partition number */
char
vh_bootfile
[
BFNAMESIZE
];
/* name of file to boot */
char
pad
[
48
];
/* device param space */
struct
volume_directory
vh_vd
[
NVDIR
];
/* other vol hdr contents */
struct
partition_table
vh_pt
[
NPARTAB
];
/* device partition layout */
int
vh_csum
;
/* volume header checksum */
int
vh_fill
;
/* fill out to 512 bytes */
__be32
vh_csum
;
/* volume header checksum */
__be32
vh_fill
;
/* fill out to 512 bytes */
};
/* partition type sysv is used for EFS format CD-ROM partitions */
...
...
include/linux/ext3_fs.h
View file @
95ca0bf3
...
...
@@ -129,14 +129,14 @@ struct statfs;
*/
struct
ext3_group_desc
{
__
u
32
bg_block_bitmap
;
/* Blocks bitmap block */
__
u
32
bg_inode_bitmap
;
/* Inodes bitmap block */
__
u
32
bg_inode_table
;
/* Inodes table block */
__
u
16
bg_free_blocks_count
;
/* Free blocks count */
__
u
16
bg_free_inodes_count
;
/* Free inodes count */
__
u
16
bg_used_dirs_count
;
/* Directories count */
__
le
32
bg_block_bitmap
;
/* Blocks bitmap block */
__
le
32
bg_inode_bitmap
;
/* Inodes bitmap block */
__
le
32
bg_inode_table
;
/* Inodes table block */
__
le
16
bg_free_blocks_count
;
/* Free blocks count */
__
le
16
bg_free_inodes_count
;
/* Free inodes count */
__
le
16
bg_used_dirs_count
;
/* Directories count */
__u16
bg_pad
;
__
u
32
bg_reserved
[
3
];
__
le
32
bg_reserved
[
3
];
};
/*
...
...
@@ -213,17 +213,17 @@ struct ext3_group_desc
* Structure of an inode on the disk
*/
struct
ext3_inode
{
__
u
16
i_mode
;
/* File mode */
__
u
16
i_uid
;
/* Low 16 bits of Owner Uid */
__
u
32
i_size
;
/* Size in bytes */
__
u
32
i_atime
;
/* Access time */
__
u
32
i_ctime
;
/* Creation time */
__
u
32
i_mtime
;
/* Modification time */
__
u
32
i_dtime
;
/* Deletion Time */
__
u
16
i_gid
;
/* Low 16 bits of Group Id */
__
u
16
i_links_count
;
/* Links count */
__
u
32
i_blocks
;
/* Blocks count */
__
u
32
i_flags
;
/* File flags */
__
le
16
i_mode
;
/* File mode */
__
le
16
i_uid
;
/* Low 16 bits of Owner Uid */
__
le
32
i_size
;
/* Size in bytes */
__
le
32
i_atime
;
/* Access time */
__
le
32
i_ctime
;
/* Creation time */
__
le
32
i_mtime
;
/* Modification time */
__
le
32
i_dtime
;
/* Deletion Time */
__
le
16
i_gid
;
/* Low 16 bits of Group Id */
__
le
16
i_links_count
;
/* Links count */
__
le
32
i_blocks
;
/* Blocks count */
__
le
32
i_flags
;
/* File flags */
union
{
struct
{
__u32
l_i_reserved1
;
...
...
@@ -235,18 +235,18 @@ struct ext3_inode {
__u32
m_i_reserved1
;
}
masix1
;
}
osd1
;
/* OS dependent 1 */
__
u
32
i_block
[
EXT3_N_BLOCKS
];
/* Pointers to blocks */
__
u
32
i_generation
;
/* File version (for NFS) */
__
u
32
i_file_acl
;
/* File ACL */
__
u
32
i_dir_acl
;
/* Directory ACL */
__
u
32
i_faddr
;
/* Fragment address */
__
le
32
i_block
[
EXT3_N_BLOCKS
];
/* Pointers to blocks */
__
le
32
i_generation
;
/* File version (for NFS) */
__
le
32
i_file_acl
;
/* File ACL */
__
le
32
i_dir_acl
;
/* Directory ACL */
__
le
32
i_faddr
;
/* Fragment address */
union
{
struct
{
__u8
l_i_frag
;
/* Fragment number */
__u8
l_i_fsize
;
/* Fragment size */
__u16
i_pad1
;
__
u
16
l_i_uid_high
;
/* these 2 fields */
__
u
16
l_i_gid_high
;
/* were reserved2[0] */
__
le
16
l_i_uid_high
;
/* these 2 fields */
__
le
16
l_i_gid_high
;
/* were reserved2[0] */
__u32
l_i_reserved2
;
}
linux2
;
struct
{
...
...
@@ -364,31 +364,31 @@ struct ext3_inode {
* Structure of the super block
*/
struct
ext3_super_block
{
/*00*/
__
u
32
s_inodes_count
;
/* Inodes count */
__
u
32
s_blocks_count
;
/* Blocks count */
__
u
32
s_r_blocks_count
;
/* Reserved blocks count */
__
u
32
s_free_blocks_count
;
/* Free blocks count */
/*10*/
__
u
32
s_free_inodes_count
;
/* Free inodes count */
__
u
32
s_first_data_block
;
/* First Data Block */
__
u
32
s_log_block_size
;
/* Block size */
__
s
32
s_log_frag_size
;
/* Fragment size */
/*20*/
__
u
32
s_blocks_per_group
;
/* # Blocks per group */
__
u
32
s_frags_per_group
;
/* # Fragments per group */
__
u
32
s_inodes_per_group
;
/* # Inodes per group */
__
u
32
s_mtime
;
/* Mount time */
/*30*/
__
u
32
s_wtime
;
/* Write time */
__
u
16
s_mnt_count
;
/* Mount count */
__
s
16
s_max_mnt_count
;
/* Maximal mount count */
__
u
16
s_magic
;
/* Magic signature */
__
u
16
s_state
;
/* File system state */
__
u
16
s_errors
;
/* Behaviour when detecting errors */
__
u
16
s_minor_rev_level
;
/* minor revision level */
/*40*/
__
u
32
s_lastcheck
;
/* time of last check */
__
u
32
s_checkinterval
;
/* max. time between checks */
__
u
32
s_creator_os
;
/* OS */
__
u
32
s_rev_level
;
/* Revision level */
/*50*/
__
u
16
s_def_resuid
;
/* Default uid for reserved blocks */
__
u
16
s_def_resgid
;
/* Default gid for reserved blocks */
/*00*/
__
le
32
s_inodes_count
;
/* Inodes count */
__
le
32
s_blocks_count
;
/* Blocks count */
__
le
32
s_r_blocks_count
;
/* Reserved blocks count */
__
le
32
s_free_blocks_count
;
/* Free blocks count */
/*10*/
__
le
32
s_free_inodes_count
;
/* Free inodes count */
__
le
32
s_first_data_block
;
/* First Data Block */
__
le
32
s_log_block_size
;
/* Block size */
__
le
32
s_log_frag_size
;
/* Fragment size */
/*20*/
__
le
32
s_blocks_per_group
;
/* # Blocks per group */
__
le
32
s_frags_per_group
;
/* # Fragments per group */
__
le
32
s_inodes_per_group
;
/* # Inodes per group */
__
le
32
s_mtime
;
/* Mount time */
/*30*/
__
le
32
s_wtime
;
/* Write time */
__
le
16
s_mnt_count
;
/* Mount count */
__
le
16
s_max_mnt_count
;
/* Maximal mount count */
__
le
16
s_magic
;
/* Magic signature */
__
le
16
s_state
;
/* File system state */
__
le
16
s_errors
;
/* Behaviour when detecting errors */
__
le
16
s_minor_rev_level
;
/* minor revision level */
/*40*/
__
le
32
s_lastcheck
;
/* time of last check */
__
le
32
s_checkinterval
;
/* max. time between checks */
__
le
32
s_creator_os
;
/* OS */
__
le
32
s_rev_level
;
/* Revision level */
/*50*/
__
le
16
s_def_resuid
;
/* Default uid for reserved blocks */
__
le
16
s_def_resgid
;
/* Default gid for reserved blocks */
/*
* These fields are for EXT3_DYNAMIC_REV superblocks only.
*
...
...
@@ -402,16 +402,16 @@ struct ext3_super_block {
* feature set, it must abort and not try to meddle with
* things it doesn't understand...
*/
__
u
32
s_first_ino
;
/* First non-reserved inode */
__
u
16
s_inode_size
;
/* size of inode structure */
__
u
16
s_block_group_nr
;
/* block group # of this superblock */
__
u
32
s_feature_compat
;
/* compatible feature set */
/*60*/
__
u
32
s_feature_incompat
;
/* incompatible feature set */
__
u
32
s_feature_ro_compat
;
/* readonly-compatible feature set */
__
le
32
s_first_ino
;
/* First non-reserved inode */
__
le
16
s_inode_size
;
/* size of inode structure */
__
le
16
s_block_group_nr
;
/* block group # of this superblock */
__
le
32
s_feature_compat
;
/* compatible feature set */
/*60*/
__
le
32
s_feature_incompat
;
/* incompatible feature set */
__
le
32
s_feature_ro_compat
;
/* readonly-compatible feature set */
/*68*/
__u8
s_uuid
[
16
];
/* 128-bit uuid for volume */
/*78*/
char
s_volume_name
[
16
];
/* volume name */
/*88*/
char
s_last_mounted
[
64
];
/* directory where last mounted */
/*C8*/
__
u
32
s_algorithm_usage_bitmap
;
/* For compression */
/*C8*/
__
le
32
s_algorithm_usage_bitmap
;
/* For compression */
/*
* Performance hints. Directory preallocation should only
* happen if the EXT3_FEATURE_COMPAT_DIR_PREALLOC flag is on.
...
...
@@ -423,15 +423,15 @@ struct ext3_super_block {
* Journaling support valid if EXT3_FEATURE_COMPAT_HAS_JOURNAL set.
*/
/*D0*/
__u8
s_journal_uuid
[
16
];
/* uuid of journal superblock */
/*E0*/
__
u
32
s_journal_inum
;
/* inode number of journal file */
__
u
32
s_journal_dev
;
/* device number of journal file */
__
u
32
s_last_orphan
;
/* start of list of inodes to delete */
__
u
32
s_hash_seed
[
4
];
/* HTREE hash seed */
/*E0*/
__
le
32
s_journal_inum
;
/* inode number of journal file */
__
le
32
s_journal_dev
;
/* device number of journal file */
__
le
32
s_last_orphan
;
/* start of list of inodes to delete */
__
le
32
s_hash_seed
[
4
];
/* HTREE hash seed */
__u8
s_def_hash_version
;
/* Default hash version to use */
__u8
s_reserved_char_pad
;
__u16
s_reserved_word_pad
;
__
u
32
s_default_mount_opts
;
__
u
32
s_first_meta_bg
;
/* First metablock block group */
__
le
32
s_default_mount_opts
;
__
le
32
s_first_meta_bg
;
/* First metablock block group */
__u32
s_reserved
[
190
];
/* Padding to the end of the block */
};
...
...
@@ -546,9 +546,9 @@ static inline struct ext3_inode_info *EXT3_I(struct inode *inode)
#define EXT3_NAME_LEN 255
struct
ext3_dir_entry
{
__
u
32
inode
;
/* Inode number */
__
u
16
rec_len
;
/* Directory entry length */
__
u
16
name_len
;
/* Name length */
__
le
32
inode
;
/* Inode number */
__
le
16
rec_len
;
/* Directory entry length */
__
le
16
name_len
;
/* Name length */
char
name
[
EXT3_NAME_LEN
];
/* File name */
};
...
...
@@ -559,8 +559,8 @@ struct ext3_dir_entry {
* file_type field.
*/
struct
ext3_dir_entry_2
{
__
u
32
inode
;
/* Inode number */
__
u
16
rec_len
;
/* Directory entry length */
__
le
32
inode
;
/* Inode number */
__
le
16
rec_len
;
/* Directory entry length */
__u8
name_len
;
/* Name length */
__u8
file_type
;
char
name
[
EXT3_NAME_LEN
];
/* File name */
...
...
include/linux/ext3_fs_i.h
View file @
95ca0bf3
...
...
@@ -22,7 +22,7 @@
* second extended file system inode data in memory
*/
struct
ext3_inode_info
{
__
u32
i_data
[
15
];
__
le32
i_data
[
15
];
/* unconverted */
__u32
i_flags
;
#ifdef EXT3_FRAGMENTS
__u32
i_faddr
;
...
...
include/linux/jbd.h
View file @
95ca0bf3
...
...
@@ -137,9 +137,9 @@ typedef struct journal_s journal_t; /* Journal control structure */
*/
typedef
struct
journal_header_s
{
__
u
32
h_magic
;
__
u
32
h_blocktype
;
__
u
32
h_sequence
;
__
be
32
h_magic
;
__
be
32
h_blocktype
;
__
be
32
h_sequence
;
}
journal_header_t
;
...
...
@@ -148,8 +148,8 @@ typedef struct journal_header_s
*/
typedef
struct
journal_block_tag_s
{
__
u
32
t_blocknr
;
/* The on-disk block number */
__
u
32
t_flags
;
/* See below */
__
be
32
t_blocknr
;
/* The on-disk block number */
__
be
32
t_flags
;
/* See below */
}
journal_block_tag_t
;
/*
...
...
@@ -159,7 +159,7 @@ typedef struct journal_block_tag_s
typedef
struct
journal_revoke_header_s
{
journal_header_t
r_header
;
int
r_count
;
/* Count of bytes used in the block */
__be32
r_count
;
/* Count of bytes used in the block */
}
journal_revoke_header_t
;
...
...
@@ -180,35 +180,35 @@ typedef struct journal_superblock_s
/* 0x000C */
/* Static information describing the journal */
__
u
32
s_blocksize
;
/* journal device blocksize */
__
u
32
s_maxlen
;
/* total blocks in journal file */
__
u
32
s_first
;
/* first block of log information */
__
be
32
s_blocksize
;
/* journal device blocksize */
__
be
32
s_maxlen
;
/* total blocks in journal file */
__
be
32
s_first
;
/* first block of log information */
/* 0x0018 */
/* Dynamic information describing the current state of the log */
__
u
32
s_sequence
;
/* first commit ID expected in log */
__
u
32
s_start
;
/* blocknr of start of log */
__
be
32
s_sequence
;
/* first commit ID expected in log */
__
be
32
s_start
;
/* blocknr of start of log */
/* 0x0020 */
/* Error value, as set by journal_abort(). */
__
s
32
s_errno
;
__
be
32
s_errno
;
/* 0x0024 */
/* Remaining fields are only valid in a version-2 superblock */
__
u
32
s_feature_compat
;
/* compatible feature set */
__
u
32
s_feature_incompat
;
/* incompatible feature set */
__
u
32
s_feature_ro_compat
;
/* readonly-compatible feature set */
__
be
32
s_feature_compat
;
/* compatible feature set */
__
be
32
s_feature_incompat
;
/* incompatible feature set */
__
be
32
s_feature_ro_compat
;
/* readonly-compatible feature set */
/* 0x0030 */
__u8
s_uuid
[
16
];
/* 128-bit uuid for journal */
/* 0x0040 */
__
u
32
s_nr_users
;
/* Nr of filesystems sharing log */
__
be
32
s_nr_users
;
/* Nr of filesystems sharing log */
__
u
32
s_dynsuper
;
/* Blocknr of dynamic superblock copy*/
__
be
32
s_dynsuper
;
/* Blocknr of dynamic superblock copy*/
/* 0x0048 */
__
u
32
s_max_transaction
;
/* Limit of journal blocks per trans.*/
__
u
32
s_max_trans_data
;
/* Limit of data blocks per trans. */
__
be
32
s_max_transaction
;
/* Limit of journal blocks per trans.*/
__
be
32
s_max_trans_data
;
/* Limit of data blocks per trans. */
/* 0x0050 */
__u32
s_padding
[
44
];
...
...
include/linux/msdos_fs.h
View file @
95ca0bf3
...
...
@@ -123,34 +123,34 @@ struct fat_boot_sector {
partition manager volumes */
__u8
sector_size
[
2
];
/* bytes per logical sector */
__u8
sec_per_clus
;
/* sectors/cluster */
__
u
16
reserved
;
/* reserved sectors */
__
le
16
reserved
;
/* reserved sectors */
__u8
fats
;
/* number of FATs */
__u8
dir_entries
[
2
];
/* root directory entries */
__u8
sectors
[
2
];
/* number of sectors */
__u8
media
;
/* media code */
__
u
16
fat_length
;
/* sectors/FAT */
__
u
16
secs_track
;
/* sectors per track */
__
u
16
heads
;
/* number of heads */
__
u
32
hidden
;
/* hidden sectors (unused) */
__
u
32
total_sect
;
/* number of sectors (if sectors == 0) */
__
le
16
fat_length
;
/* sectors/FAT */
__
le
16
secs_track
;
/* sectors per track */
__
le
16
heads
;
/* number of heads */
__
le
32
hidden
;
/* hidden sectors (unused) */
__
le
32
total_sect
;
/* number of sectors (if sectors == 0) */
/* The following fields are only used by FAT32 */
__
u
32
fat32_length
;
/* sectors/FAT */
__
u
16
flags
;
/* bit 8: fat mirroring, low 4: active fat */
__
le
32
fat32_length
;
/* sectors/FAT */
__
le
16
flags
;
/* bit 8: fat mirroring, low 4: active fat */
__u8
version
[
2
];
/* major, minor filesystem version */
__
u
32
root_cluster
;
/* first cluster in root directory */
__
u
16
info_sector
;
/* filesystem info sector */
__
u
16
backup_boot
;
/* backup boot sector */
__
u
16
reserved2
[
6
];
/* Unused */
__
le
32
root_cluster
;
/* first cluster in root directory */
__
le
16
info_sector
;
/* filesystem info sector */
__
le
16
backup_boot
;
/* backup boot sector */
__
le
16
reserved2
[
6
];
/* Unused */
};
struct
fat_boot_fsinfo
{
__
u
32
signature1
;
/* 0x41615252L */
__
u
32
reserved1
[
120
];
/* Nothing as far as I can tell */
__
u
32
signature2
;
/* 0x61417272L */
__
u
32
free_clusters
;
/* Free cluster count. -1 if unknown */
__
u
32
next_cluster
;
/* Most recently allocated cluster */
__
u
32
reserved2
[
4
];
__
le
32
signature1
;
/* 0x41615252L */
__
le
32
reserved1
[
120
];
/* Nothing as far as I can tell */
__
le
32
signature2
;
/* 0x61417272L */
__
le
32
free_clusters
;
/* Free cluster count. -1 if unknown */
__
le
32
next_cluster
;
/* Most recently allocated cluster */
__
le
32
reserved2
[
4
];
};
struct
msdos_dir_entry
{
...
...
@@ -158,12 +158,12 @@ struct msdos_dir_entry {
__u8
attr
;
/* attribute bits */
__u8
lcase
;
/* Case for base and extension */
__u8
ctime_ms
;
/* Creation time, milliseconds */
__
u
16
ctime
;
/* Creation time */
__
u
16
cdate
;
/* Creation date */
__
u
16
adate
;
/* Last access date */
__
u
16
starthi
;
/* High 16 bits of cluster in FAT32 */
__
u
16
time
,
date
,
start
;
/* time, date and first cluster */
__
u
32
size
;
/* file size (in bytes) */
__
le
16
ctime
;
/* Creation time */
__
le
16
cdate
;
/* Creation date */
__
le
16
adate
;
/* Last access date */
__
le
16
starthi
;
/* High 16 bits of cluster in FAT32 */
__
le
16
time
,
date
,
start
;
/* time, date and first cluster */
__
le
32
size
;
/* file size (in bytes) */
};
/* Up to 13 characters of the name */
...
...
@@ -174,7 +174,7 @@ struct msdos_dir_slot {
__u8
reserved
;
/* always 0 */
__u8
alias_checksum
;
/* checksum for 8.3 alias */
__u8
name5_10
[
12
];
/* 6 more characters in name */
__
u
16
start
;
/* starting cluster number, 0 in long slots */
__
le
16
start
;
/* starting cluster number, 0 in long slots */
__u8
name11_12
[
4
];
/* last 2 characters in name */
};
...
...
@@ -287,8 +287,7 @@ extern void fat_clusters_flush(struct super_block *sb);
extern
int
fat_add_cluster
(
struct
inode
*
inode
);
extern
struct
buffer_head
*
fat_extend_dir
(
struct
inode
*
inode
);
extern
int
date_dos2unix
(
unsigned
short
time
,
unsigned
short
date
);
extern
void
fat_date_unix2dos
(
int
unix_date
,
unsigned
short
*
time
,
unsigned
short
*
date
);
extern
void
fat_date_unix2dos
(
int
unix_date
,
__le16
*
time
,
__le16
*
date
);
extern
int
fat__get_entry
(
struct
inode
*
dir
,
loff_t
*
pos
,
struct
buffer_head
**
bh
,
struct
msdos_dir_entry
**
de
,
loff_t
*
i_pos
);
...
...
include/linux/sysv_fs.h
View file @
95ca0bf3
...
...
@@ -8,13 +8,18 @@
#endif
#ifndef __KERNEL__
typedef
u16
__fs16
;
typedef
u32
__fs16
;
#endif
/* inode numbers are 16 bit */
typedef
u
16
sysv_ino_t
;
typedef
__fs
16
sysv_ino_t
;
/* Block numbers are 24 bit, sometimes stored in 32 bit.
On Coherent FS, they are always stored in PDP-11 manner: the least
significant 16 bits come last. */
typedef
u
32
sysv_zone_t
;
typedef
__fs
32
sysv_zone_t
;
/* 0 is non-existent */
#define SYSV_BADBL_INO 1
/* inode of bad blocks file */
...
...
@@ -25,29 +30,29 @@ typedef u32 sysv_zone_t;
#define XENIX_NICINOD 100
/* number of inode cache entries */
#define XENIX_NICFREE 100
/* number of free block list chunk entries */
struct
xenix_super_block
{
u
16
s_isize
;
/* index of first data zone */
u
32
s_fsize
__packed2__
;
/* total number of zones of this fs */
__fs
16
s_isize
;
/* index of first data zone */
__fs
32
s_fsize
__packed2__
;
/* total number of zones of this fs */
/* the start of the free block list: */
u
16
s_nfree
;
/* number of free blocks in s_free, <= XENIX_NICFREE */
u32
s_free
[
XENIX_NICFREE
];
/* first free block list chunk */
__fs
16
s_nfree
;
/* number of free blocks in s_free, <= XENIX_NICFREE */
sysv_zone_t
s_free
[
XENIX_NICFREE
];
/* first free block list chunk */
/* the cache of free inodes: */
u
16
s_ninode
;
/* number of free inodes in s_inode, <= XENIX_NICINOD */
__fs
16
s_ninode
;
/* number of free inodes in s_inode, <= XENIX_NICINOD */
sysv_ino_t
s_inode
[
XENIX_NICINOD
];
/* some free inodes */
/* locks, not used by Linux: */
char
s_flock
;
/* lock during free block list manipulation */
char
s_ilock
;
/* lock during inode cache manipulation */
char
s_fmod
;
/* super-block modified flag */
char
s_ronly
;
/* flag whether fs is mounted read-only */
u
32
s_time
__packed2__
;
/* time of last super block update */
u
32
s_tfree
__packed2__
;
/* total number of free zones */
u
16
s_tinode
;
/* total number of free inodes */
s16
s_dinfo
[
4
];
/* device information ?? */
__fs
32
s_time
__packed2__
;
/* time of last super block update */
__fs
32
s_tfree
__packed2__
;
/* total number of free zones */
__fs
16
s_tinode
;
/* total number of free inodes */
__f
s16
s_dinfo
[
4
];
/* device information ?? */
char
s_fname
[
6
];
/* file system volume name */
char
s_fpack
[
6
];
/* file system pack name */
char
s_clean
;
/* set to 0x46 when filesystem is properly unmounted */
char
s_fill
[
371
];
s32
s_magic
;
/* version of file system */
s32
s_type
;
/* type of file system: 1 for 512 byte blocks
__f
s32
s_type
;
/* type of file system: 1 for 512 byte blocks
2 for 1024 byte blocks
3 for 2048 byte blocks */
...
...
@@ -63,15 +68,15 @@ struct xenix_super_block {
/* SystemV4 super-block data on disk */
struct
sysv4_super_block
{
u
16
s_isize
;
/* index of first data zone */
__fs
16
s_isize
;
/* index of first data zone */
u16
s_pad0
;
u
32
s_fsize
;
/* total number of zones of this fs */
__fs
32
s_fsize
;
/* total number of zones of this fs */
/* the start of the free block list: */
u
16
s_nfree
;
/* number of free blocks in s_free, <= SYSV_NICFREE */
__fs
16
s_nfree
;
/* number of free blocks in s_free, <= SYSV_NICFREE */
u16
s_pad1
;
u32
s_free
[
SYSV_NICFREE
];
/* first free block list chunk */
sysv_zone_t
s_free
[
SYSV_NICFREE
];
/* first free block list chunk */
/* the cache of free inodes: */
u
16
s_ninode
;
/* number of free inodes in s_inode, <= SYSV_NICINOD */
__fs
16
s_ninode
;
/* number of free inodes in s_inode, <= SYSV_NICINOD */
u16
s_pad2
;
sysv_ino_t
s_inode
[
SYSV_NICINOD
];
/* some free inodes */
/* locks, not used by Linux: */
...
...
@@ -79,45 +84,45 @@ struct sysv4_super_block {
char
s_ilock
;
/* lock during inode cache manipulation */
char
s_fmod
;
/* super-block modified flag */
char
s_ronly
;
/* flag whether fs is mounted read-only */
u
32
s_time
;
/* time of last super block update */
s16
s_dinfo
[
4
];
/* device information ?? */
u
32
s_tfree
;
/* total number of free zones */
u
16
s_tinode
;
/* total number of free inodes */
__fs
32
s_time
;
/* time of last super block update */
__f
s16
s_dinfo
[
4
];
/* device information ?? */
__fs
32
s_tfree
;
/* total number of free zones */
__fs
16
s_tinode
;
/* total number of free inodes */
u16
s_pad3
;
char
s_fname
[
6
];
/* file system volume name */
char
s_fpack
[
6
];
/* file system pack name */
s32
s_fill
[
12
];
s32
s_state
;
/* file system state: 0x7c269d38-s_time means clean */
__f
s32
s_state
;
/* file system state: 0x7c269d38-s_time means clean */
s32
s_magic
;
/* version of file system */
s32
s_type
;
/* type of file system: 1 for 512 byte blocks
__f
s32
s_type
;
/* type of file system: 1 for 512 byte blocks
2 for 1024 byte blocks */
};
/* SystemV2 super-block data on disk */
struct
sysv2_super_block
{
u
16
s_isize
;
/* index of first data zone */
u
32
s_fsize
__packed2__
;
/* total number of zones of this fs */
__fs
16
s_isize
;
/* index of first data zone */
__fs
32
s_fsize
__packed2__
;
/* total number of zones of this fs */
/* the start of the free block list: */
u
16
s_nfree
;
/* number of free blocks in s_free, <= SYSV_NICFREE */
u32
s_free
[
SYSV_NICFREE
];
/* first free block list chunk */
__fs
16
s_nfree
;
/* number of free blocks in s_free, <= SYSV_NICFREE */
sysv_zone_t
s_free
[
SYSV_NICFREE
];
/* first free block list chunk */
/* the cache of free inodes: */
u
16
s_ninode
;
/* number of free inodes in s_inode, <= SYSV_NICINOD */
__fs
16
s_ninode
;
/* number of free inodes in s_inode, <= SYSV_NICINOD */
sysv_ino_t
s_inode
[
SYSV_NICINOD
];
/* some free inodes */
/* locks, not used by Linux: */
char
s_flock
;
/* lock during free block list manipulation */
char
s_ilock
;
/* lock during inode cache manipulation */
char
s_fmod
;
/* super-block modified flag */
char
s_ronly
;
/* flag whether fs is mounted read-only */
u
32
s_time
__packed2__
;
/* time of last super block update */
s16
s_dinfo
[
4
];
/* device information ?? */
u
32
s_tfree
__packed2__
;
/* total number of free zones */
u
16
s_tinode
;
/* total number of free inodes */
__fs
32
s_time
__packed2__
;
/* time of last super block update */
__f
s16
s_dinfo
[
4
];
/* device information ?? */
__fs
32
s_tfree
__packed2__
;
/* total number of free zones */
__fs
16
s_tinode
;
/* total number of free inodes */
char
s_fname
[
6
];
/* file system volume name */
char
s_fpack
[
6
];
/* file system pack name */
s32
s_fill
[
14
];
s32
s_state
;
/* file system state: 0xcb096f43 means clean */
__f
s32
s_state
;
/* file system state: 0xcb096f43 means clean */
s32
s_magic
;
/* version of file system */
s32
s_type
;
/* type of file system: 1 for 512 byte blocks
__f
s32
s_type
;
/* type of file system: 1 for 512 byte blocks
2 for 1024 byte blocks */
};
...
...
@@ -125,25 +130,25 @@ struct sysv2_super_block {
#define V7_NICINOD 100
/* number of inode cache entries */
#define V7_NICFREE 50
/* number of free block list chunk entries */
struct
v7_super_block
{
u16
s_isize
;
/* index of first data zone */
u32
s_fsize
__packed2__
;
/* total number of zones of this fs */
__fs16
s_isize
;
/* index of first data zone */
__fs32
s_fsize
__packed2__
;
/* total number of zones of this fs */
/* the start of the free block list: */
u16
s_nfree
;
/* number of free blocks in s_free, <= V7_NICFREE */
u32
s_free
[
V7_NICFREE
];
/* first free block list chunk */
__fs16
s_nfree
;
/* number of free blocks in s_free, <= V7_NICFREE */
sysv_zone_t
s_free
[
V7_NICFREE
];
/* first free block list chunk */
/* the cache of free inodes: */
u16
s_ninode
;
/* number of free inodes in s_inode, <= V7_NICINOD */
__fs16
s_ninode
;
/* number of free inodes in s_inode, <= V7_NICINOD */
sysv_ino_t
s_inode
[
V7_NICINOD
];
/* some free inodes */
/* locks, not used by Linux or V7: */
char
s_flock
;
/* lock during free block list manipulation */
char
s_ilock
;
/* lock during inode cache manipulation */
char
s_fmod
;
/* super-block modified flag */
char
s_ronly
;
/* flag whether fs is mounted read-only */
u32
s_time
__packed2__
;
/* time of last super block update */
__fs32
s_time
__packed2__
;
/* time of last super block update */
/* the following fields are not maintained by V7: */
u32
s_tfree
__packed2__
;
/* total number of free zones */
u16
s_tinode
;
/* total number of free inodes */
u16
s_m
;
/* interleave factor */
u16
s_n
;
/* interleave factor */
__fs32
s_tfree
__packed2__
;
/* total number of free zones */
__fs16
s_tinode
;
/* total number of free inodes */
__fs16
s_m
;
/* interleave factor */
__fs16
s_n
;
/* interleave factor */
char
s_fname
[
6
];
/* file system name */
char
s_fpack
[
6
];
/* file system pack name */
};
...
...
@@ -152,41 +157,41 @@ struct v7_super_block {
#define COH_NICINOD 100
/* number of inode cache entries */
#define COH_NICFREE 64
/* number of free block list chunk entries */
struct
coh_super_block
{
u
16
s_isize
;
/* index of first data zone */
u
32
s_fsize
__packed2__
;
/* total number of zones of this fs */
__fs
16
s_isize
;
/* index of first data zone */
__fs
32
s_fsize
__packed2__
;
/* total number of zones of this fs */
/* the start of the free block list: */
u
16
s_nfree
;
/* number of free blocks in s_free, <= COH_NICFREE */
u32
s_free
[
COH_NICFREE
]
__packed2__
;
/* first free block list chunk */
__fs
16
s_nfree
;
/* number of free blocks in s_free, <= COH_NICFREE */
sysv_zone_t
s_free
[
COH_NICFREE
]
__packed2__
;
/* first free block list chunk */
/* the cache of free inodes: */
u
16
s_ninode
;
/* number of free inodes in s_inode, <= COH_NICINOD */
__fs
16
s_ninode
;
/* number of free inodes in s_inode, <= COH_NICINOD */
sysv_ino_t
s_inode
[
COH_NICINOD
];
/* some free inodes */
/* locks, not used by Linux: */
char
s_flock
;
/* lock during free block list manipulation */
char
s_ilock
;
/* lock during inode cache manipulation */
char
s_fmod
;
/* super-block modified flag */
char
s_ronly
;
/* flag whether fs is mounted read-only */
u
32
s_time
__packed2__
;
/* time of last super block update */
u
32
s_tfree
__packed2__
;
/* total number of free zones */
u
16
s_tinode
;
/* total number of free inodes */
u
16
s_interleave_m
;
/* interleave factor */
u
16
s_interleave_n
;
__fs
32
s_time
__packed2__
;
/* time of last super block update */
__fs
32
s_tfree
__packed2__
;
/* total number of free zones */
__fs
16
s_tinode
;
/* total number of free inodes */
__fs
16
s_interleave_m
;
/* interleave factor */
__fs
16
s_interleave_n
;
char
s_fname
[
6
];
/* file system volume name */
char
s_fpack
[
6
];
/* file system pack name */
u
32
s_unique
;
/* zero, not used */
__fs
32
s_unique
;
/* zero, not used */
};
/* SystemV/Coherent inode data on disk */
struct
sysv_inode
{
u
16
i_mode
;
u
16
i_nlink
;
u
16
i_uid
;
u
16
i_gid
;
u
32
i_size
;
__fs
16
i_mode
;
__fs
16
i_nlink
;
__fs
16
i_uid
;
__fs
16
i_gid
;
__fs
32
i_size
;
u8
i_data
[
3
*
(
10
+
1
+
1
+
1
)];
u8
i_gen
;
u
32
i_atime
;
/* time of last access */
u
32
i_mtime
;
/* time of last modification */
u
32
i_ctime
;
/* time of creation */
__fs
32
i_atime
;
/* time of last access */
__fs
32
i_mtime
;
/* time of last modification */
__fs
32
i_ctime
;
/* time of creation */
};
/* SystemV/Coherent directory entry on disk */
...
...
include/rxrpc/call.h
View file @
95ca0bf3
...
...
@@ -67,8 +67,8 @@ struct rxrpc_call
wait_queue_head_t
waitq
;
/* wait queue for events to happen */
struct
list_head
link
;
/* general internal list link */
struct
list_head
call_link
;
/* master call list link */
uint32_t
chan_ix
;
/* connection channel index (net order)
*/
uint32_t
call_id
;
/* call ID on connection (net order)
*/
__be32
chan_ix
;
/* connection channel index
*/
__be32
call_id
;
/* call ID on connection
*/
unsigned
long
cjif
;
/* jiffies at call creation */
unsigned
long
flags
;
/* control flags */
#define RXRPC_CALL_ACKS_TIMO 0x00000001
/* ACKS timeout reached */
...
...
@@ -97,7 +97,7 @@ struct rxrpc_call
rxrpc_seq_t
ackr_win_bot
;
/* bottom of ACK window */
rxrpc_seq_t
ackr_win_top
;
/* top of ACK window */
rxrpc_seq_t
ackr_high_seq
;
/* highest seqno yet received */
rxrpc_seq_t
ackr_prev_seq
;
/* previous seqno received */
rxrpc_seq_
net_
t
ackr_prev_seq
;
/* previous seqno received */
unsigned
ackr_pend_cnt
;
/* number of pending ACKs */
struct
timer_list
ackr_dfr_timo
;
/* timeout on deferred ACK */
char
ackr_dfr_perm
;
/* request for deferred ACKs permitted */
...
...
include/rxrpc/connection.h
View file @
95ca0bf3
...
...
@@ -45,18 +45,18 @@ struct rxrpc_connection
rxrpc_serial_t
serial_counter
;
/* packet serial number counter */
/* the following should all be in net order */
uint32_t
in_epoch
;
/* peer's epoch */
uint32_t
out_epoch
;
/* my epoch */
uint32_t
conn_id
;
/* connection ID, appropriately shifted */
uint16_t
service_id
;
/* service ID */
__be32
in_epoch
;
/* peer's epoch */
__be32
out_epoch
;
/* my epoch */
__be32
conn_id
;
/* connection ID, appropriately shifted */
__be16
service_id
;
/* service ID */
uint8_t
security_ix
;
/* security ID */
uint8_t
in_clientflag
;
/* RXRPC_CLIENT_INITIATED if we are server */
uint8_t
out_clientflag
;
/* RXRPC_CLIENT_INITIATED if we are client */
};
extern
int
rxrpc_create_connection
(
struct
rxrpc_transport
*
trans
,
uint16_t
port
,
uint32_t
addr
,
__be16
port
,
__be32
addr
,
uint16_t
service_id
,
void
*
security
,
struct
rxrpc_connection
**
_conn
);
...
...
include/rxrpc/packet.h
View file @
95ca0bf3
...
...
@@ -27,19 +27,19 @@ extern size_t RXRPC_MAX_PACKET_SIZE;
*/
struct
rxrpc_header
{
uint32_t
epoch
;
/* client boot timestamp */
__be32
epoch
;
/* client boot timestamp */
uint32_t
cid
;
/* connection and channel ID */
__be32
cid
;
/* connection and channel ID */
#define RXRPC_MAXCALLS 4
/* max active calls per conn */
#define RXRPC_CHANNELMASK (RXRPC_MAXCALLS-1)
/* mask for channel ID */
#define RXRPC_CIDMASK (~RXRPC_CHANNELMASK)
/* mask for connection ID */
#define RXRPC_CIDSHIFT 2
/* shift for connection ID */
uint32_t
callNumber
;
/* call ID (0 for connection-level packets) */
__be32
callNumber
;
/* call ID (0 for connection-level packets) */
#define RXRPC_PROCESS_MAXCALLS (1<<2)
/* maximum number of active calls per conn (power of 2) */
uint32_t
seq
;
/* sequence number of pkt in call stream */
uint32_t
serial
;
/* serial number of pkt sent to network */
__be32
seq
;
/* sequence number of pkt in call stream */
__be32
serial
;
/* serial number of pkt sent to network */
uint8_t
type
;
/* packet type */
#define RXRPC_PACKET_TYPE_DATA 1
/* data */
...
...
@@ -62,8 +62,8 @@ struct rxrpc_header
uint8_t
userStatus
;
/* app-layer defined status */
uint8_t
securityIndex
;
/* security protocol ID */
uint16_t
_rsvd
;
/* reserved (used by kerberos security as cksum) */
uint16_t
serviceId
;
/* service ID */
__be16
_rsvd
;
/* reserved (used by kerberos security as cksum) */
__be16
serviceId
;
/* service ID */
}
__attribute__
((
packed
));
...
...
@@ -85,7 +85,7 @@ struct rxrpc_jumbo_header
{
uint8_t
flags
;
/* packet flags (as per rxrpc_header) */
uint8_t
pad
;
uint16_t
_rsvd
;
/* reserved (used by kerberos security as cksum) */
__be16
_rsvd
;
/* reserved (used by kerberos security as cksum) */
};
#define RXRPC_JUMBO_DATALEN 1412
/* non-terminal jumbo packet data length */
...
...
@@ -97,12 +97,12 @@ struct rxrpc_jumbo_header
*/
struct
rxrpc_ackpacket
{
uint16_t
bufferSpace
;
/* number of packet buffers available */
uint16_t
maxSkew
;
/* diff between serno being ACK'd and highest serial no
__be16
bufferSpace
;
/* number of packet buffers available */
__be16
maxSkew
;
/* diff between serno being ACK'd and highest serial no
* received */
uint32_t
firstPacket
;
/* sequence no of first ACK'd packet in attached list */
uint32_t
previousPacket
;
/* sequence no of previous packet received */
uint32_t
serial
;
/* serial no of packet that prompted this ACK */
__be32
firstPacket
;
/* sequence no of first ACK'd packet in attached list */
__be32
previousPacket
;
/* sequence no of previous packet received */
__be32
serial
;
/* serial no of packet that prompted this ACK */
uint8_t
reason
;
/* reason for ACK */
#define RXRPC_ACK_REQUESTED 1
/* ACK was requested on packet */
...
...
include/rxrpc/peer.h
View file @
95ca0bf3
...
...
@@ -67,7 +67,7 @@ struct rxrpc_peer
extern
int
rxrpc_peer_lookup
(
struct
rxrpc_transport
*
trans
,
u
32
addr
,
__be
32
addr
,
struct
rxrpc_peer
**
_peer
);
static
inline
void
rxrpc_get_peer
(
struct
rxrpc_peer
*
peer
)
...
...
include/rxrpc/rxrpc.h
View file @
95ca0bf3
...
...
@@ -14,7 +14,7 @@
#ifdef __KERNEL__
extern
uint32_t
rxrpc_epoch
;
extern
__be32
rxrpc_epoch
;
#ifdef CONFIG_SYSCTL
extern
int
rxrpc_ktrace
;
...
...
include/rxrpc/types.h
View file @
95ca0bf3
...
...
@@ -21,6 +21,8 @@
typedef
uint32_t
rxrpc_seq_t
;
/* Rx message sequence number */
typedef
uint32_t
rxrpc_serial_t
;
/* Rx message serial number */
typedef
__be32
rxrpc_seq_net_t
;
/* on-the-wire Rx message sequence number */
typedef
__be32
rxrpc_serial_net_t
;
/* on-the-wire Rx message serial number */
struct
rxrpc_call
;
struct
rxrpc_connection
;
...
...
net/rxrpc/call.c
View file @
95ca0bf3
...
...
@@ -472,7 +472,7 @@ static inline int __rxrpc_call_gen_normal_ACK(struct rxrpc_call *call,
{
struct
rxrpc_message
*
msg
;
struct
kvec
diov
[
3
];
unsigned
aux
[
4
];
__be32
aux
[
4
];
int
delta
,
ret
;
/* ACKs default to DELAY */
...
...
@@ -840,7 +840,7 @@ static int __rxrpc_call_abort(struct rxrpc_call *call, int errno)
struct
rxrpc_message
*
msg
;
struct
kvec
diov
[
1
];
int
ret
;
u
32
_error
;
__be
32
_error
;
_enter
(
"%p{%08x},%p{%d},%d"
,
conn
,
ntohl
(
conn
->
conn_id
),
call
,
ntohl
(
call
->
call_id
),
errno
);
...
...
@@ -986,7 +986,7 @@ static void rxrpc_call_receive_packet(struct rxrpc_call *call)
/* deal with abort packets */
case
RXRPC_PACKET_TYPE_ABORT
:
{
uint32_t
_dbuf
,
*
dp
;
__be32
_dbuf
,
*
dp
;
dp
=
skb_header_pointer
(
msg
->
pkt
,
msg
->
offset
,
sizeof
(
_dbuf
),
&
_dbuf
);
...
...
@@ -1048,7 +1048,7 @@ static void rxrpc_call_receive_data_packet(struct rxrpc_call *call,
struct
rxrpc_message
*
pmsg
;
struct
list_head
*
_p
;
int
ret
,
lo
,
hi
,
rmtimo
;
u
32
opid
;
__be
32
opid
;
_enter
(
"%p{%u},%p{%u}"
,
call
,
ntohl
(
call
->
call_id
),
msg
,
msg
->
seq
);
...
...
@@ -1270,7 +1270,7 @@ static void rxrpc_call_receive_ack_packet(struct rxrpc_call *call,
struct
rxrpc_message
*
msg
)
{
struct
rxrpc_ackpacket
_ack
,
*
ap
;
rxrpc_serial_t
serial
;
rxrpc_serial_
net_
t
serial
;
rxrpc_seq_t
seq
;
int
ret
;
...
...
net/rxrpc/connection.c
View file @
95ca0bf3
...
...
@@ -88,8 +88,8 @@ static inline int __rxrpc_create_connection(struct rxrpc_peer *peer,
* create a new connection record for outgoing connections
*/
int
rxrpc_create_connection
(
struct
rxrpc_transport
*
trans
,
uint16_t
port
,
uint32_t
addr
,
__be16
port
,
__be32
addr
,
uint16_t
service_id
,
void
*
security
,
struct
rxrpc_connection
**
_conn
)
...
...
@@ -97,7 +97,7 @@ int rxrpc_create_connection(struct rxrpc_transport *trans,
struct
rxrpc_connection
*
candidate
,
*
conn
;
struct
rxrpc_peer
*
peer
;
struct
list_head
*
_p
;
uint32_t
connid
;
__be32
connid
;
int
ret
;
_enter
(
"%p{%hu},%u,%hu"
,
trans
,
trans
->
port
,
ntohs
(
port
),
service_id
);
...
...
@@ -169,7 +169,7 @@ int rxrpc_create_connection(struct rxrpc_transport *trans,
spin_unlock
(
&
peer
->
conn_gylock
);
/* pick the new candidate */
_debug
(
"created connection: {%08x} [out]"
,
hton
l
(
candidate
->
conn_id
));
_debug
(
"created connection: {%08x} [out]"
,
ntoh
l
(
candidate
->
conn_id
));
atomic_inc
(
&
peer
->
conn_count
);
conn
=
candidate
;
candidate
=
NULL
;
...
...
@@ -199,7 +199,7 @@ int rxrpc_create_connection(struct rxrpc_transport *trans,
/* handle resurrecting a connection from the graveyard */
found_in_graveyard:
_debug
(
"resurrecting connection: {%08x} [out]"
,
hton
l
(
conn
->
conn_id
));
_debug
(
"resurrecting connection: {%08x} [out]"
,
ntoh
l
(
conn
->
conn_id
));
rxrpc_get_connection
(
conn
);
rxrpc_krxtimod_del_timer
(
&
conn
->
timeout
);
list_del_init
(
&
conn
->
link
);
...
...
@@ -219,8 +219,9 @@ int rxrpc_connection_lookup(struct rxrpc_peer *peer,
struct
rxrpc_connection
*
conn
,
*
candidate
=
NULL
;
struct
list_head
*
_p
;
int
ret
,
fresh
=
0
;
u32
x_epoch
,
x_connid
;
u16
x_port
,
x_secix
,
x_servid
;
__be32
x_epoch
,
x_connid
;
__be16
x_port
,
x_servid
;
__u32
x_secix
;
u8
x_clflag
;
_enter
(
"%p{{%hu}},%u,%hu"
,
...
...
@@ -310,7 +311,7 @@ int rxrpc_connection_lookup(struct rxrpc_peer *peer,
}
/* we can now add the new candidate to the list */
_debug
(
"created connection: {%08x} [in]"
,
hton
l
(
candidate
->
conn_id
));
_debug
(
"created connection: {%08x} [in]"
,
ntoh
l
(
candidate
->
conn_id
));
rxrpc_get_peer
(
peer
);
conn
=
candidate
;
candidate
=
NULL
;
...
...
@@ -351,7 +352,7 @@ int rxrpc_connection_lookup(struct rxrpc_peer *peer,
/* handle resurrecting a connection from the graveyard */
found_in_graveyard:
_debug
(
"resurrecting connection: {%08x} [in]"
,
hton
l
(
conn
->
conn_id
));
_debug
(
"resurrecting connection: {%08x} [in]"
,
ntoh
l
(
conn
->
conn_id
));
rxrpc_get_peer
(
peer
);
rxrpc_get_connection
(
conn
);
rxrpc_krxtimod_del_timer
(
&
conn
->
timeout
);
...
...
@@ -397,7 +398,7 @@ void rxrpc_put_connection(struct rxrpc_connection *conn)
}
/* move to graveyard queue */
_debug
(
"burying connection: {%08x}"
,
hton
l
(
conn
->
conn_id
));
_debug
(
"burying connection: {%08x}"
,
ntoh
l
(
conn
->
conn_id
));
list_del
(
&
conn
->
link
);
list_add_tail
(
&
conn
->
link
,
&
peer
->
conn_graveyard
);
...
...
@@ -442,7 +443,7 @@ void rxrpc_conn_do_timeout(struct rxrpc_connection *conn)
}
_debug
(
"--- Destroying Connection %p{%08x} ---"
,
conn
,
hton
l
(
conn
->
conn_id
));
conn
,
ntoh
l
(
conn
->
conn_id
));
down_write
(
&
rxrpc_conns_sem
);
list_del
(
&
conn
->
proc_link
);
...
...
@@ -640,8 +641,8 @@ int rxrpc_conn_sendmsg(struct rxrpc_connection *conn,
_net
(
"Sending message type %d of %Zd bytes to %08x:%d"
,
msg
->
hdr
.
type
,
msg
->
dsize
,
hton
l
(
conn
->
addr
.
sin_addr
.
s_addr
),
hton
s
(
conn
->
addr
.
sin_port
));
ntoh
l
(
conn
->
addr
.
sin_addr
.
s_addr
),
ntoh
s
(
conn
->
addr
.
sin_port
));
/* send the message */
ret
=
kernel_sendmsg
(
conn
->
trans
->
socket
,
&
msghdr
,
...
...
@@ -699,11 +700,11 @@ int rxrpc_conn_receive_call_packet(struct rxrpc_connection *conn,
}
_proto
(
"Received packet %%%u [%u] on call %hu:%u:%u"
,
hton
l
(
msg
->
hdr
.
serial
),
hton
l
(
msg
->
hdr
.
seq
),
hton
s
(
msg
->
hdr
.
serviceId
),
hton
l
(
conn
->
conn_id
),
hton
l
(
call
->
call_id
));
ntoh
l
(
msg
->
hdr
.
serial
),
ntoh
l
(
msg
->
hdr
.
seq
),
ntoh
s
(
msg
->
hdr
.
serviceId
),
ntoh
l
(
conn
->
conn_id
),
ntoh
l
(
call
->
call_id
));
call
->
pkt_rcv_count
++
;
...
...
net/rxrpc/main.c
View file @
95ca0bf3
...
...
@@ -32,7 +32,7 @@ MODULE_DESCRIPTION("Rx RPC implementation");
MODULE_AUTHOR
(
"Red Hat, Inc."
);
MODULE_LICENSE
(
"GPL"
);
uint32_t
rxrpc_epoch
;
__be32
rxrpc_epoch
;
/*****************************************************************************/
/*
...
...
net/rxrpc/peer.c
View file @
95ca0bf3
...
...
@@ -48,7 +48,7 @@ static const struct rxrpc_timer_ops rxrpc_peer_timer_ops = {
/*
* create a peer record
*/
static
int
__rxrpc_create_peer
(
struct
rxrpc_transport
*
trans
,
uint32_t
addr
,
static
int
__rxrpc_create_peer
(
struct
rxrpc_transport
*
trans
,
__be32
addr
,
struct
rxrpc_peer
**
_peer
)
{
struct
rxrpc_peer
*
peer
;
...
...
@@ -96,7 +96,7 @@ static int __rxrpc_create_peer(struct rxrpc_transport *trans, uint32_t addr,
* - returns (if successful) with peer record usage incremented
* - resurrects it from the graveyard if found there
*/
int
rxrpc_peer_lookup
(
struct
rxrpc_transport
*
trans
,
uint32_t
addr
,
int
rxrpc_peer_lookup
(
struct
rxrpc_transport
*
trans
,
__be32
addr
,
struct
rxrpc_peer
**
_peer
)
{
struct
rxrpc_peer
*
peer
,
*
candidate
=
NULL
;
...
...
net/rxrpc/transport.c
View file @
95ca0bf3
...
...
@@ -457,8 +457,8 @@ void rxrpc_trans_receive_packet(struct rxrpc_transport *trans)
struct
rxrpc_peer
*
peer
;
struct
sk_buff
*
pkt
;
int
ret
;
u
32
addr
;
u
16
port
;
__be
32
addr
;
__be
16
port
;
LIST_HEAD
(
msgq
);
...
...
@@ -612,7 +612,7 @@ int rxrpc_trans_immediate_abort(struct rxrpc_transport *trans,
struct
sockaddr_in
sin
;
struct
msghdr
msghdr
;
struct
kvec
iov
[
2
];
uint32_t
_error
;
__be32
_error
;
int
len
,
ret
;
_enter
(
"%p,%p,%d"
,
trans
,
msg
,
error
);
...
...
@@ -655,8 +655,8 @@ int rxrpc_trans_immediate_abort(struct rxrpc_transport *trans,
_net
(
"Sending message type %d of %d bytes to %08x:%d"
,
ahdr
.
type
,
len
,
hton
l
(
sin
.
sin_addr
.
s_addr
),
hton
s
(
sin
.
sin_port
));
ntoh
l
(
sin
.
sin_addr
.
s_addr
),
ntoh
s
(
sin
.
sin_port
));
/* send the message */
ret
=
kernel_sendmsg
(
trans
->
socket
,
&
msghdr
,
iov
,
2
,
len
);
...
...
@@ -678,7 +678,7 @@ static void rxrpc_trans_receive_error_report(struct rxrpc_transport *trans)
struct
list_head
connq
,
*
_p
;
struct
errormsg
emsg
;
struct
msghdr
msg
;
uint16_t
port
;
__be16
port
;
int
local
,
err
;
_enter
(
"%p"
,
trans
);
...
...
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