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
Kirill Smelkov
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
Show 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 @@
...
@@ -38,7 +38,7 @@
static
int
cfi_staa_read
(
struct
mtd_info
*
,
loff_t
,
size_t
,
size_t
*
,
u_char
*
);
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_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
);
unsigned
long
count
,
loff_t
to
,
size_t
*
retlen
);
static
int
cfi_staa_erase_varsize
(
struct
mtd_info
*
,
struct
erase_info
*
);
static
int
cfi_staa_erase_varsize
(
struct
mtd_info
*
,
struct
erase_info
*
);
static
void
cfi_staa_sync
(
struct
mtd_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,
...
@@ -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_DIV(x) ((x) & ~(ECCBUF_SIZE - 1))
#define ECCBUF_MOD(x) ((x) & (ECCBUF_SIZE - 1))
#define ECCBUF_MOD(x) ((x) & (ECCBUF_SIZE - 1))
static
int
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
count
,
loff_t
to
,
size_t
*
retlen
)
{
{
unsigned
long
i
;
unsigned
long
i
;
...
...
drivers/mtd/mtdcore.c
View file @
b706f5fa
...
@@ -232,7 +232,7 @@ void put_mtd_device(struct mtd_info *mtd)
...
@@ -232,7 +232,7 @@ void put_mtd_device(struct mtd_info *mtd)
* dont implement their own
* 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
count
,
loff_t
to
,
size_t
*
retlen
)
{
{
unsigned
long
i
;
unsigned
long
i
;
...
@@ -262,7 +262,7 @@ int default_mtd_writev(struct mtd_info *mtd, const struct iovec *vecs,
...
@@ -262,7 +262,7 @@ int default_mtd_writev(struct mtd_info *mtd, const struct iovec *vecs,
* implement their own
* 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
count
,
loff_t
from
,
size_t
*
retlen
)
{
{
unsigned
long
i
;
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
...
@@ -182,7 +182,7 @@ static int part_write_user_prot_reg (struct mtd_info *mtd, loff_t from, size_t l
len
,
retlen
,
buf
);
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
)
unsigned
long
count
,
loff_t
to
,
size_t
*
retlen
)
{
{
struct
mtd_part
*
part
=
PART
(
mtd
);
struct
mtd_part
*
part
=
PART
(
mtd
);
...
@@ -197,7 +197,7 @@ static int part_writev (struct mtd_info *mtd, const struct iovec *vecs,
...
@@ -197,7 +197,7 @@ static int part_writev (struct mtd_info *mtd, const struct iovec *vecs,
NULL
,
&
mtd
->
oobinfo
);
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
)
unsigned
long
count
,
loff_t
from
,
size_t
*
retlen
)
{
{
struct
mtd_part
*
part
=
PART
(
mtd
);
struct
mtd_part
*
part
=
PART
(
mtd
);
...
@@ -210,7 +210,7 @@ static int part_readv (struct mtd_info *mtd, struct iovec *vecs,
...
@@ -210,7 +210,7 @@ static int part_readv (struct mtd_info *mtd, struct iovec *vecs,
NULL
,
&
mtd
->
oobinfo
);
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
,
unsigned
long
count
,
loff_t
to
,
size_t
*
retlen
,
u_char
*
eccbuf
,
struct
nand_oobinfo
*
oobsel
)
u_char
*
eccbuf
,
struct
nand_oobinfo
*
oobsel
)
{
{
...
@@ -224,7 +224,7 @@ static int part_writev_ecc (struct mtd_info *mtd, const struct iovec *vecs,
...
@@ -224,7 +224,7 @@ static int part_writev_ecc (struct mtd_info *mtd, const struct iovec *vecs,
eccbuf
,
oobsel
);
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
,
unsigned
long
count
,
loff_t
from
,
size_t
*
retlen
,
u_char
*
eccbuf
,
struct
nand_oobinfo
*
oobsel
)
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
...
@@ -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
,
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
);
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_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
);
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
);
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
int
nand_erase
(
struct
mtd_info
*
mtd
,
struct
erase_info
*
instr
);
static
void
nand_sync
(
struct
mtd_info
*
mtd
);
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 *
...
@@ -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
)
loff_t
to
,
size_t
*
retlen
)
{
{
return
(
nand_writev_ecc
(
mtd
,
vecs
,
count
,
to
,
retlen
,
NULL
,
0
));
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
)
loff_t
to
,
size_t
*
retlen
,
u_char
*
eccbuf
,
struct
nand_oobinfo
*
oobsel
)
{
{
int
i
,
page
,
len
,
total_len
,
ret
=
0
,
written
=
0
;
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
...
@@ -1016,7 +1016,7 @@ static int nand_writev_ecc (struct mtd_info *mtd, const struct iovec *vecs, unsi
goto
out
;
goto
out
;
}
}
/* Loop until all
iovecs
' data has been written */
/* Loop until all
kvec
' data has been written */
len
=
0
;
len
=
0
;
while
(
count
)
{
while
(
count
)
{
/*
/*
...
@@ -1025,7 +1025,7 @@ static int nand_writev_ecc (struct mtd_info *mtd, const struct iovec *vecs, unsi
...
@@ -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.
* else we have to copy into data_buf.
*/
*/
if
((
vecs
->
iov_len
-
len
)
>=
mtd
->
oobblock
)
{
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
;
this
->
data_poi
+=
len
;
len
+=
mtd
->
oobblock
;
len
+=
mtd
->
oobblock
;
/* Check, if we have to switch to the next tuple */
/* 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,
...
@@ -209,7 +209,7 @@ flash_safe_write(struct mtd_info *mtd, loff_t to,
static
int
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
)
unsigned
long
iovec_cnt
,
loff_t
to
)
{
{
size_t
retlen
,
retlen_a
;
size_t
retlen
,
retlen_a
;
...
@@ -1740,7 +1740,7 @@ jffs_write_node(struct jffs_control *c, struct jffs_node *node,
...
@@ -1740,7 +1740,7 @@ jffs_write_node(struct jffs_control *c, struct jffs_node *node,
{
{
struct
jffs_fmcontrol
*
fmc
=
c
->
fmc
;
struct
jffs_fmcontrol
*
fmc
=
c
->
fmc
;
struct
jffs_fm
*
fm
;
struct
jffs_fm
*
fm
;
struct
io
vec
node_iovec
[
4
];
struct
k
vec
node_iovec
[
4
];
unsigned
long
iovec_cnt
;
unsigned
long
iovec_cnt
;
__u32
pos
;
__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)
...
@@ -132,8 +132,9 @@ static inline void jffs2_init_inode_info(struct jffs2_inode_info *f)
#define jffs2_wbuf_dirty(c) (!!(c)->wbuf_len)
#define jffs2_wbuf_dirty(c) (!!(c)->wbuf_len)
struct
kstatfs
;
struct
kstatfs
;
struct
kvec
;
/* wbuf.c */
/* 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_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_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
);
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 *);
...
@@ -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
);
int
jffs2_do_fill_super
(
struct
super_block
*
sb
,
void
*
data
,
int
silent
);
/* writev.c */
/* 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
);
unsigned
long
count
,
loff_t
to
,
size_t
*
retlen
);
/* super.c */
/* super.c */
...
...
fs/jffs2/wbuf.c
View file @
b706f5fa
...
@@ -544,9 +544,9 @@ int jffs2_flush_wbuf_pad(struct jffs2_sb_info *c)
...
@@ -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_DIV(x) ( (x) & (~(c->wbuf_pagesize - 1)) )
#define PAGE_MOD(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
totlen
=
0
;
uint32_t
split_ofs
=
0
;
uint32_t
split_ofs
=
0
;
uint32_t
old_totlen
;
uint32_t
old_totlen
;
...
@@ -751,11 +751,11 @@ int jffs2_flash_writev(struct jffs2_sb_info *c, const struct iovec *invecs, unsi
...
@@ -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.
* 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
)
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
))
if
(
jffs2_can_mark_obsolete
(
c
))
return
c
->
mtd
->
write
(
c
->
mtd
,
ofs
,
len
,
retlen
,
buf
);
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
...
@@ -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_raw_node_ref
*
raw
;
struct
jffs2_full_dnode
*
fn
;
struct
jffs2_full_dnode
*
fn
;
size_t
retlen
;
size_t
retlen
;
struct
io
vec
vecs
[
2
];
struct
k
vec
vecs
[
2
];
int
ret
;
int
ret
;
int
retried
=
0
;
int
retried
=
0
;
unsigned
long
cnt
=
2
;
unsigned
long
cnt
=
2
;
...
@@ -233,7 +233,7 @@ struct jffs2_full_dirent *jffs2_write_dirent(struct jffs2_sb_info *c, struct jff
...
@@ -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_raw_node_ref
*
raw
;
struct
jffs2_full_dirent
*
fd
;
struct
jffs2_full_dirent
*
fd
;
size_t
retlen
;
size_t
retlen
;
struct
io
vec
vecs
[
2
];
struct
k
vec
vecs
[
2
];
int
retried
=
0
;
int
retried
=
0
;
int
ret
;
int
ret
;
...
...
fs/jffs2/writev.c
View file @
b706f5fa
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
/* This ought to be in core MTD code. All registered MTD devices
/* This ought to be in core MTD code. All registered MTD devices
without writev should have this put in place. Bug the MTD
without writev should have this put in place. Bug the MTD
maintainer */
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
count
,
loff_t
to
,
size_t
*
retlen
)
{
{
unsigned
long
i
;
unsigned
long
i
;
...
@@ -39,7 +39,7 @@ static inline int mtd_fake_writev(struct mtd_info *mtd, const struct iovec *vecs
...
@@ -39,7 +39,7 @@ static inline int mtd_fake_writev(struct mtd_info *mtd, const struct iovec *vecs
return
ret
;
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
)
unsigned
long
count
,
loff_t
to
,
size_t
*
retlen
)
{
{
if
(
c
->
mtd
->
writev
)
if
(
c
->
mtd
->
writev
)
...
...
include/linux/mtd/mtd.h
View file @
b706f5fa
...
@@ -12,6 +12,11 @@
...
@@ -12,6 +12,11 @@
#include <linux/module.h>
#include <linux/module.h>
#include <linux/uio.h>
#include <linux/uio.h>
struct
kvec
{
void
*
iov_base
;
/* and that should *never* hold a userland pointer */
size_t
iov_len
;
};
#endif
/* __KERNEL__ */
#endif
/* __KERNEL__ */
struct
erase_info_user
{
struct
erase_info_user
{
...
@@ -200,16 +205,16 @@ struct mtd_info {
...
@@ -200,16 +205,16 @@ struct mtd_info {
/* This function is not yet implemented */
/* 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
);
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.
with its limited number of write cycles per erase.
NB: The 'count' parameter is the number of _vectors_, each of
NB: The 'count' parameter is the number of _vectors_, each of
which contains an (ofs, len) tuple.
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
)
(
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
io
vec
*
vecs
,
unsigned
long
count
,
loff_t
from
,
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
);
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
)
(
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
io
vec
*
vecs
,
unsigned
long
count
,
loff_t
to
,
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
);
size_t
*
retlen
,
u_char
*
eccbuf
,
struct
nand_oobinfo
*
oobsel
);
/* Sync */
/* Sync */
...
@@ -250,10 +255,10 @@ struct mtd_notifier {
...
@@ -250,10 +255,10 @@ struct mtd_notifier {
extern
void
register_mtd_user
(
struct
mtd_notifier
*
new
);
extern
void
register_mtd_user
(
struct
mtd_notifier
*
new
);
extern
int
unregister_mtd_user
(
struct
mtd_notifier
*
old
);
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
);
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
);
unsigned
long
count
,
loff_t
from
,
size_t
*
retlen
);
#define MTD_ERASE(mtd, args...) (*(mtd->erase))(mtd, args)
#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