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
da134d6a
Commit
da134d6a
authored
Jun 25, 2003
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge master.kernel.org:/home/dwmw2/BK/mtd-forlinus-2.5
into home.osdl.org:/home/torvalds/v2.5/linux
parents
6295088c
f2e5e8b1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
16 deletions
+36
-16
drivers/mtd/chips/gen_probe.c
drivers/mtd/chips/gen_probe.c
+3
-2
drivers/mtd/inftlcore.c
drivers/mtd/inftlcore.c
+33
-14
No files found.
drivers/mtd/chips/gen_probe.c
View file @
da134d6a
/*
* Routines common to all CFI-type probes.
* (C) 2001
, 2001
Red Hat, Inc.
* (C) 2001
-2003
Red Hat, Inc.
* GPL'd
* $Id: gen_probe.c,v 1.1
1 2003/05/21 15:15:05
dwmw2 Exp $
* $Id: gen_probe.c,v 1.1
3 2003/06/25 11:50:37
dwmw2 Exp $
*/
#include <linux/kernel.h>
...
...
@@ -281,6 +281,7 @@ typedef struct mtd_info *cfi_cmdset_fn_t(struct map_info *, int);
extern
cfi_cmdset_fn_t
cfi_cmdset_0001
;
extern
cfi_cmdset_fn_t
cfi_cmdset_0002
;
extern
cfi_cmdset_fn_t
cfi_cmdset_0020
;
static
inline
struct
mtd_info
*
cfi_cmdset_unknown
(
struct
map_info
*
map
,
int
primary
)
...
...
drivers/mtd/inftlcore.c
View file @
da134d6a
...
...
@@ -7,7 +7,7 @@
* (c) 1999 Machine Vision Holdings, Inc.
* Author: David Woodhouse <dwmw2@infradead.org>
*
* $Id: inftlcore.c,v 1.1
1 2003/06/23 12:00:08
dwmw2 Exp $
* $Id: inftlcore.c,v 1.1
4 2003/06/26 08:28:26
dwmw2 Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
...
...
@@ -573,7 +573,7 @@ static void INFTL_trydeletechain(struct INFTLrecord *inftl, unsigned thisVUC)
{
unsigned
char
BlockUsed
[
MAX_SECTORS_PER_UNIT
];
unsigned
char
BlockDeleted
[
MAX_SECTORS_PER_UNIT
];
unsigned
int
thisEUN
,
prevEUN
,
status
;
unsigned
int
thisEUN
,
status
;
int
block
,
silly
;
struct
inftl_bci
bci
;
size_t
retlen
;
...
...
@@ -645,26 +645,45 @@ static void INFTL_trydeletechain(struct INFTLrecord *inftl, unsigned thisVUC)
DEBUG
(
MTD_DEBUG_LEVEL1
,
"INFTL: deleting empty VUC %d
\n
"
,
thisVUC
);
for
(;;)
{
u16
*
prevEUN
=
&
inftl
->
VUtable
[
thisVUC
];
thisEUN
=
*
prevEUN
;
/* If the chain is all gone already, we're done */
if
(
thisEUN
==
BLOCK_NIL
)
{
DEBUG
(
MTD_DEBUG_LEVEL2
,
"INFTL: Empty VUC %d for deletion was already absent
\n
"
,
thisEUN
);
return
;
}
/* Find oldest unit in chain. */
thisEUN
=
inftl
->
VUtable
[
thisVUC
];
prevEUN
=
BLOCK_NIL
;
while
(
inftl
->
PUtable
[
thisEUN
]
!=
BLOCK_NIL
)
{
prevEUN
=
thisEUN
;
thisEUN
=
inftl
->
PUtable
[
thisEUN
];
BUG_ON
(
thisEUN
>=
inftl
->
nb_blocks
);
prevEUN
=
&
inftl
->
PUtable
[
thisEUN
];
thisEUN
=
*
prevEUN
;
}
DEBUG
(
MTD_DEBUG_LEVEL3
,
"Deleting EUN %d from VUC %d
\n
"
,
thisEUN
,
thisVUC
);
if
(
INFTL_formatblock
(
inftl
,
thisEUN
)
<
0
)
{
/*
* Could not erase : mark block as reserved.
* FixMe: Update Bad Unit Table on
disk
.
* FixMe: Update Bad Unit Table on
medium
.
*/
inftl
->
PUtable
[
thisEUN
]
=
BLOCK_RESERVED
;
}
else
{
/* Correctly erased : mark it as free */
inftl
->
PUtable
[
thisEUN
]
=
BLOCK_FREE
;
inftl
->
PUtable
[
prevEUN
]
=
BLOCK_NIL
;
inftl
->
numfreeEUNs
++
;
}
}
/* Now sort out whatever was pointing to it... */
*
prevEUN
=
BLOCK_NIL
;
/* Ideally we'd actually be responsive to new
requests while we're doing this -- if there's
free space why should others be made to wait? */
cond_resched
();
}
inftl
->
VUtable
[
thisVUC
]
=
BLOCK_NIL
;
...
...
@@ -837,11 +856,11 @@ static int inftl_readblock(struct mtd_blktrans_dev *mbd, unsigned long block,
static
int
inftl_getgeo
(
struct
mtd_blktrans_dev
*
dev
,
struct
hd_geometry
*
geo
)
{
struct
NFTLrecord
*
nftl
=
(
void
*
)
dev
;
struct
INFTLrecord
*
i
nftl
=
(
void
*
)
dev
;
geo
->
heads
=
nftl
->
heads
;
geo
->
sectors
=
nftl
->
sectors
;
geo
->
cylinders
=
nftl
->
cylinders
;
geo
->
heads
=
i
nftl
->
heads
;
geo
->
sectors
=
i
nftl
->
sectors
;
geo
->
cylinders
=
i
nftl
->
cylinders
;
return
0
;
}
...
...
@@ -862,7 +881,7 @@ extern char inftlmountrev[];
int
__init
init_inftl
(
void
)
{
printk
(
KERN_INFO
"INFTL: inftlcore.c $Revision: 1.1
1
$, "
printk
(
KERN_INFO
"INFTL: inftlcore.c $Revision: 1.1
4
$, "
"inftlmount.c %s
\n
"
,
inftlmountrev
);
return
register_mtd_blktrans
(
&
inftl_tr
);
...
...
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