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
b706f5fa
Commit
b706f5fa
authored
Jul 10, 2004
by
Alexander Viro
Committed by
Linus Torvalds
Jul 10, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] sparse: removal of iovec use in mtd
mtd, jffs and jffs2 switched from iovec to kvec
parent
0fc78de9
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
40 additions
and
34 deletions
+40
-34
drivers/mtd/chips/cfi_cmdset_0020.c
drivers/mtd/chips/cfi_cmdset_0020.c
+2
-2
drivers/mtd/mtdcore.c
drivers/mtd/mtdcore.c
+2
-2
drivers/mtd/mtdpart.c
drivers/mtd/mtdpart.c
+4
-4
drivers/mtd/nand/nand.c
drivers/mtd/nand/nand.c
+7
-7
fs/jffs/intrep.c
fs/jffs/intrep.c
+2
-2
fs/jffs2/os-linux.h
fs/jffs2/os-linux.h
+3
-2
fs/jffs2/wbuf.c
fs/jffs2/wbuf.c
+4
-4
fs/jffs2/write.c
fs/jffs2/write.c
+2
-2
fs/jffs2/writev.c
fs/jffs2/writev.c
+2
-2
include/linux/mtd/mtd.h
include/linux/mtd/mtd.h
+12
-7
No files found.
drivers/mtd/chips/cfi_cmdset_0020.c
View file @
b706f5fa
...
...
@@ -38,7 +38,7 @@
static
int
cfi_staa_read
(
struct
mtd_info
*
,
loff_t
,
size_t
,
size_t
*
,
u_char
*
);
static
int
cfi_staa_write_buffers
(
struct
mtd_info
*
,
loff_t
,
size_t
,
size_t
*
,
const
u_char
*
);
static
int
cfi_staa_writev
(
struct
mtd_info
*
mtd
,
const
struct
io
vec
*
vecs
,
static
int
cfi_staa_writev
(
struct
mtd_info
*
mtd
,
const
struct
k
vec
*
vecs
,
unsigned
long
count
,
loff_t
to
,
size_t
*
retlen
);
static
int
cfi_staa_erase_varsize
(
struct
mtd_info
*
,
struct
erase_info
*
);
static
void
cfi_staa_sync
(
struct
mtd_info
*
);
...
...
@@ -700,7 +700,7 @@ static int cfi_staa_write_buffers (struct mtd_info *mtd, loff_t to,
#define ECCBUF_DIV(x) ((x) & ~(ECCBUF_SIZE - 1))
#define ECCBUF_MOD(x) ((x) & (ECCBUF_SIZE - 1))
static
int
cfi_staa_writev
(
struct
mtd_info
*
mtd
,
const
struct
io
vec
*
vecs
,
cfi_staa_writev
(
struct
mtd_info
*
mtd
,
const
struct
k
vec
*
vecs
,
unsigned
long
count
,
loff_t
to
,
size_t
*
retlen
)
{
unsigned
long
i
;
...
...
drivers/mtd/mtdcore.c
View file @
b706f5fa
...
...
@@ -232,7 +232,7 @@ void put_mtd_device(struct mtd_info *mtd)
* dont implement their own
*/
int
default_mtd_writev
(
struct
mtd_info
*
mtd
,
const
struct
io
vec
*
vecs
,
int
default_mtd_writev
(
struct
mtd_info
*
mtd
,
const
struct
k
vec
*
vecs
,
unsigned
long
count
,
loff_t
to
,
size_t
*
retlen
)
{
unsigned
long
i
;
...
...
@@ -262,7 +262,7 @@ int default_mtd_writev(struct mtd_info *mtd, const struct iovec *vecs,
* implement their own
*/
int
default_mtd_readv
(
struct
mtd_info
*
mtd
,
struct
io
vec
*
vecs
,
int
default_mtd_readv
(
struct
mtd_info
*
mtd
,
struct
k
vec
*
vecs
,
unsigned
long
count
,
loff_t
from
,
size_t
*
retlen
)
{
unsigned
long
i
;
...
...
drivers/mtd/mtdpart.c
View file @
b706f5fa
...
...
@@ -182,7 +182,7 @@ static int part_write_user_prot_reg (struct mtd_info *mtd, loff_t from, size_t l
len
,
retlen
,
buf
);
}
static
int
part_writev
(
struct
mtd_info
*
mtd
,
const
struct
io
vec
*
vecs
,
static
int
part_writev
(
struct
mtd_info
*
mtd
,
const
struct
k
vec
*
vecs
,
unsigned
long
count
,
loff_t
to
,
size_t
*
retlen
)
{
struct
mtd_part
*
part
=
PART
(
mtd
);
...
...
@@ -197,7 +197,7 @@ static int part_writev (struct mtd_info *mtd, const struct iovec *vecs,
NULL
,
&
mtd
->
oobinfo
);
}
static
int
part_readv
(
struct
mtd_info
*
mtd
,
struct
io
vec
*
vecs
,
static
int
part_readv
(
struct
mtd_info
*
mtd
,
struct
k
vec
*
vecs
,
unsigned
long
count
,
loff_t
from
,
size_t
*
retlen
)
{
struct
mtd_part
*
part
=
PART
(
mtd
);
...
...
@@ -210,7 +210,7 @@ static int part_readv (struct mtd_info *mtd, struct iovec *vecs,
NULL
,
&
mtd
->
oobinfo
);
}
static
int
part_writev_ecc
(
struct
mtd_info
*
mtd
,
const
struct
io
vec
*
vecs
,
static
int
part_writev_ecc
(
struct
mtd_info
*
mtd
,
const
struct
k
vec
*
vecs
,
unsigned
long
count
,
loff_t
to
,
size_t
*
retlen
,
u_char
*
eccbuf
,
struct
nand_oobinfo
*
oobsel
)
{
...
...
@@ -224,7 +224,7 @@ static int part_writev_ecc (struct mtd_info *mtd, const struct iovec *vecs,
eccbuf
,
oobsel
);
}
static
int
part_readv_ecc
(
struct
mtd_info
*
mtd
,
struct
io
vec
*
vecs
,
static
int
part_readv_ecc
(
struct
mtd_info
*
mtd
,
struct
k
vec
*
vecs
,
unsigned
long
count
,
loff_t
from
,
size_t
*
retlen
,
u_char
*
eccbuf
,
struct
nand_oobinfo
*
oobsel
)
{
...
...
drivers/mtd/nand/nand.c
View file @
b706f5fa
...
...
@@ -168,9 +168,9 @@ static int nand_write (struct mtd_info *mtd, loff_t to, size_t len, size_t * ret
static
int
nand_write_ecc
(
struct
mtd_info
*
mtd
,
loff_t
to
,
size_t
len
,
size_t
*
retlen
,
const
u_char
*
buf
,
u_char
*
eccbuf
,
struct
nand_oobinfo
*
oobsel
);
static
int
nand_write_oob
(
struct
mtd_info
*
mtd
,
loff_t
to
,
size_t
len
,
size_t
*
retlen
,
const
u_char
*
buf
);
static
int
nand_writev
(
struct
mtd_info
*
mtd
,
const
struct
io
vec
*
vecs
,
static
int
nand_writev
(
struct
mtd_info
*
mtd
,
const
struct
k
vec
*
vecs
,
unsigned
long
count
,
loff_t
to
,
size_t
*
retlen
);
static
int
nand_writev_ecc
(
struct
mtd_info
*
mtd
,
const
struct
io
vec
*
vecs
,
static
int
nand_writev_ecc
(
struct
mtd_info
*
mtd
,
const
struct
k
vec
*
vecs
,
unsigned
long
count
,
loff_t
to
,
size_t
*
retlen
,
u_char
*
eccbuf
,
struct
nand_oobinfo
*
oobsel
);
static
int
nand_erase
(
struct
mtd_info
*
mtd
,
struct
erase_info
*
instr
);
static
void
nand_sync
(
struct
mtd_info
*
mtd
);
...
...
@@ -961,15 +961,15 @@ static int nand_write_oob (struct mtd_info *mtd, loff_t to, size_t len, size_t *
/*
* NAND write with
io
vec
* NAND write with
k
vec
*/
static
int
nand_writev
(
struct
mtd_info
*
mtd
,
const
struct
io
vec
*
vecs
,
unsigned
long
count
,
static
int
nand_writev
(
struct
mtd_info
*
mtd
,
const
struct
k
vec
*
vecs
,
unsigned
long
count
,
loff_t
to
,
size_t
*
retlen
)
{
return
(
nand_writev_ecc
(
mtd
,
vecs
,
count
,
to
,
retlen
,
NULL
,
0
));
}
static
int
nand_writev_ecc
(
struct
mtd_info
*
mtd
,
const
struct
io
vec
*
vecs
,
unsigned
long
count
,
static
int
nand_writev_ecc
(
struct
mtd_info
*
mtd
,
const
struct
k
vec
*
vecs
,
unsigned
long
count
,
loff_t
to
,
size_t
*
retlen
,
u_char
*
eccbuf
,
struct
nand_oobinfo
*
oobsel
)
{
int
i
,
page
,
len
,
total_len
,
ret
=
0
,
written
=
0
;
...
...
@@ -1016,7 +1016,7 @@ static int nand_writev_ecc (struct mtd_info *mtd, const struct iovec *vecs, unsi
goto
out
;
}
/* Loop until all
iovecs
' data has been written */
/* Loop until all
kvec
' data has been written */
len
=
0
;
while
(
count
)
{
/*
...
...
@@ -1025,7 +1025,7 @@ static int nand_writev_ecc (struct mtd_info *mtd, const struct iovec *vecs, unsi
* else we have to copy into data_buf.
*/
if
((
vecs
->
iov_len
-
len
)
>=
mtd
->
oobblock
)
{
this
->
data_poi
=
(
u_char
*
)
vecs
->
iov_base
;
this
->
data_poi
=
vecs
->
iov_base
;
this
->
data_poi
+=
len
;
len
+=
mtd
->
oobblock
;
/* Check, if we have to switch to the next tuple */
...
...
fs/jffs/intrep.c
View file @
b706f5fa
...
...
@@ -209,7 +209,7 @@ flash_safe_write(struct mtd_info *mtd, loff_t to,
static
int
flash_safe_writev
(
struct
mtd_info
*
mtd
,
const
struct
io
vec
*
vecs
,
flash_safe_writev
(
struct
mtd_info
*
mtd
,
const
struct
k
vec
*
vecs
,
unsigned
long
iovec_cnt
,
loff_t
to
)
{
size_t
retlen
,
retlen_a
;
...
...
@@ -1740,7 +1740,7 @@ jffs_write_node(struct jffs_control *c, struct jffs_node *node,
{
struct
jffs_fmcontrol
*
fmc
=
c
->
fmc
;
struct
jffs_fm
*
fm
;
struct
io
vec
node_iovec
[
4
];
struct
k
vec
node_iovec
[
4
];
unsigned
long
iovec_cnt
;
__u32
pos
;
...
...
fs/jffs2/os-linux.h
View file @
b706f5fa
...
...
@@ -132,8 +132,9 @@ static inline void jffs2_init_inode_info(struct jffs2_inode_info *f)
#define jffs2_wbuf_dirty(c) (!!(c)->wbuf_len)
struct
kstatfs
;
struct
kvec
;
/* wbuf.c */
int
jffs2_flash_writev
(
struct
jffs2_sb_info
*
c
,
const
struct
io
vec
*
vecs
,
unsigned
long
count
,
loff_t
to
,
size_t
*
retlen
,
uint32_t
ino
);
int
jffs2_flash_writev
(
struct
jffs2_sb_info
*
c
,
const
struct
k
vec
*
vecs
,
unsigned
long
count
,
loff_t
to
,
size_t
*
retlen
,
uint32_t
ino
);
int
jffs2_flash_write
(
struct
jffs2_sb_info
*
c
,
loff_t
ofs
,
size_t
len
,
size_t
*
retlen
,
const
u_char
*
buf
);
int
jffs2_flash_read
(
struct
jffs2_sb_info
*
c
,
loff_t
ofs
,
size_t
len
,
size_t
*
retlen
,
u_char
*
buf
);
int
jffs2_check_oob_empty
(
struct
jffs2_sb_info
*
c
,
struct
jffs2_eraseblock
*
jeb
,
int
mode
);
...
...
@@ -185,7 +186,7 @@ int jffs2_remount_fs (struct super_block *, int *, char *);
int
jffs2_do_fill_super
(
struct
super_block
*
sb
,
void
*
data
,
int
silent
);
/* writev.c */
int
jffs2_flash_direct_writev
(
struct
jffs2_sb_info
*
c
,
const
struct
io
vec
*
vecs
,
int
jffs2_flash_direct_writev
(
struct
jffs2_sb_info
*
c
,
const
struct
k
vec
*
vecs
,
unsigned
long
count
,
loff_t
to
,
size_t
*
retlen
);
/* super.c */
...
...
fs/jffs2/wbuf.c
View file @
b706f5fa
...
...
@@ -544,9 +544,9 @@ int jffs2_flush_wbuf_pad(struct jffs2_sb_info *c)
#define PAGE_DIV(x) ( (x) & (~(c->wbuf_pagesize - 1)) )
#define PAGE_MOD(x) ( (x) & (c->wbuf_pagesize - 1) )
int
jffs2_flash_writev
(
struct
jffs2_sb_info
*
c
,
const
struct
io
vec
*
invecs
,
unsigned
long
count
,
loff_t
to
,
size_t
*
retlen
,
uint32_t
ino
)
int
jffs2_flash_writev
(
struct
jffs2_sb_info
*
c
,
const
struct
k
vec
*
invecs
,
unsigned
long
count
,
loff_t
to
,
size_t
*
retlen
,
uint32_t
ino
)
{
struct
io
vec
outvecs
[
3
];
struct
k
vec
outvecs
[
3
];
uint32_t
totlen
=
0
;
uint32_t
split_ofs
=
0
;
uint32_t
old_totlen
;
...
...
@@ -751,11 +751,11 @@ int jffs2_flash_writev(struct jffs2_sb_info *c, const struct iovec *invecs, unsi
/*
* This is the entry for flash write.
* Check, if we work on NAND FLASH, if so build an
io
vec and write it via vritev
* Check, if we work on NAND FLASH, if so build an
k
vec and write it via vritev
*/
int
jffs2_flash_write
(
struct
jffs2_sb_info
*
c
,
loff_t
ofs
,
size_t
len
,
size_t
*
retlen
,
const
u_char
*
buf
)
{
struct
io
vec
vecs
[
1
];
struct
k
vec
vecs
[
1
];
if
(
jffs2_can_mark_obsolete
(
c
))
return
c
->
mtd
->
write
(
c
->
mtd
,
ofs
,
len
,
retlen
,
buf
);
...
...
fs/jffs2/write.c
View file @
b706f5fa
...
...
@@ -92,7 +92,7 @@ struct jffs2_full_dnode *jffs2_write_dnode(struct jffs2_sb_info *c, struct jffs2
struct
jffs2_raw_node_ref
*
raw
;
struct
jffs2_full_dnode
*
fn
;
size_t
retlen
;
struct
io
vec
vecs
[
2
];
struct
k
vec
vecs
[
2
];
int
ret
;
int
retried
=
0
;
unsigned
long
cnt
=
2
;
...
...
@@ -233,7 +233,7 @@ struct jffs2_full_dirent *jffs2_write_dirent(struct jffs2_sb_info *c, struct jff
struct
jffs2_raw_node_ref
*
raw
;
struct
jffs2_full_dirent
*
fd
;
size_t
retlen
;
struct
io
vec
vecs
[
2
];
struct
k
vec
vecs
[
2
];
int
retried
=
0
;
int
ret
;
...
...
fs/jffs2/writev.c
View file @
b706f5fa
...
...
@@ -18,7 +18,7 @@
/* This ought to be in core MTD code. All registered MTD devices
without writev should have this put in place. Bug the MTD
maintainer */
static
inline
int
mtd_fake_writev
(
struct
mtd_info
*
mtd
,
const
struct
io
vec
*
vecs
,
static
inline
int
mtd_fake_writev
(
struct
mtd_info
*
mtd
,
const
struct
k
vec
*
vecs
,
unsigned
long
count
,
loff_t
to
,
size_t
*
retlen
)
{
unsigned
long
i
;
...
...
@@ -39,7 +39,7 @@ static inline int mtd_fake_writev(struct mtd_info *mtd, const struct iovec *vecs
return
ret
;
}
int
jffs2_flash_direct_writev
(
struct
jffs2_sb_info
*
c
,
const
struct
io
vec
*
vecs
,
int
jffs2_flash_direct_writev
(
struct
jffs2_sb_info
*
c
,
const
struct
k
vec
*
vecs
,
unsigned
long
count
,
loff_t
to
,
size_t
*
retlen
)
{
if
(
c
->
mtd
->
writev
)
...
...
include/linux/mtd/mtd.h
View file @
b706f5fa
...
...
@@ -12,6 +12,11 @@
#include <linux/module.h>
#include <linux/uio.h>
struct
kvec
{
void
*
iov_base
;
/* and that should *never* hold a userland pointer */
size_t
iov_len
;
};
#endif
/* __KERNEL__ */
struct
erase_info_user
{
...
...
@@ -200,16 +205,16 @@ struct mtd_info {
/* This function is not yet implemented */
int
(
*
write_user_prot_reg
)
(
struct
mtd_info
*
mtd
,
loff_t
from
,
size_t
len
,
size_t
*
retlen
,
u_char
*
buf
);
/*
io
vec-based read/write methods. We need these especially for NAND flash,
/*
k
vec-based read/write methods. We need these especially for NAND flash,
with its limited number of write cycles per erase.
NB: The 'count' parameter is the number of _vectors_, each of
which contains an (ofs, len) tuple.
*/
int
(
*
readv
)
(
struct
mtd_info
*
mtd
,
struct
io
vec
*
vecs
,
unsigned
long
count
,
loff_t
from
,
size_t
*
retlen
);
int
(
*
readv_ecc
)
(
struct
mtd_info
*
mtd
,
struct
io
vec
*
vecs
,
unsigned
long
count
,
loff_t
from
,
int
(
*
readv
)
(
struct
mtd_info
*
mtd
,
struct
k
vec
*
vecs
,
unsigned
long
count
,
loff_t
from
,
size_t
*
retlen
);
int
(
*
readv_ecc
)
(
struct
mtd_info
*
mtd
,
struct
k
vec
*
vecs
,
unsigned
long
count
,
loff_t
from
,
size_t
*
retlen
,
u_char
*
eccbuf
,
struct
nand_oobinfo
*
oobsel
);
int
(
*
writev
)
(
struct
mtd_info
*
mtd
,
const
struct
io
vec
*
vecs
,
unsigned
long
count
,
loff_t
to
,
size_t
*
retlen
);
int
(
*
writev_ecc
)
(
struct
mtd_info
*
mtd
,
const
struct
io
vec
*
vecs
,
unsigned
long
count
,
loff_t
to
,
int
(
*
writev
)
(
struct
mtd_info
*
mtd
,
const
struct
k
vec
*
vecs
,
unsigned
long
count
,
loff_t
to
,
size_t
*
retlen
);
int
(
*
writev_ecc
)
(
struct
mtd_info
*
mtd
,
const
struct
k
vec
*
vecs
,
unsigned
long
count
,
loff_t
to
,
size_t
*
retlen
,
u_char
*
eccbuf
,
struct
nand_oobinfo
*
oobsel
);
/* Sync */
...
...
@@ -250,10 +255,10 @@ struct mtd_notifier {
extern
void
register_mtd_user
(
struct
mtd_notifier
*
new
);
extern
int
unregister_mtd_user
(
struct
mtd_notifier
*
old
);
int
default_mtd_writev
(
struct
mtd_info
*
mtd
,
const
struct
io
vec
*
vecs
,
int
default_mtd_writev
(
struct
mtd_info
*
mtd
,
const
struct
k
vec
*
vecs
,
unsigned
long
count
,
loff_t
to
,
size_t
*
retlen
);
int
default_mtd_readv
(
struct
mtd_info
*
mtd
,
struct
io
vec
*
vecs
,
int
default_mtd_readv
(
struct
mtd_info
*
mtd
,
struct
k
vec
*
vecs
,
unsigned
long
count
,
loff_t
from
,
size_t
*
retlen
);
#define MTD_ERASE(mtd, args...) (*(mtd->erase))(mtd, args)
...
...
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