diff options
author | Adrian Hunter <ext-adrian.hunter@nokia.com> | 2008-07-21 14:39:05 +0200 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2008-08-13 10:24:26 +0200 |
commit | ff46d7b3e0870a70331b069372c36fbc43018c2d (patch) | |
tree | 8a650ad44c110e2ea3587cf5f8e86137b3bf32dd /fs/ubifs/io.c | |
parent | UBIFS: ensure UBIFS switches to read-only on error (diff) | |
download | linux-ff46d7b3e0870a70331b069372c36fbc43018c2d.tar.xz linux-ff46d7b3e0870a70331b069372c36fbc43018c2d.zip |
UBIFS: make ubifs_ro_mode() not inline
We use ubifs_ro_mode() quite a lot, and not in fast-path, so
there is no reason to blow the code up by having it inlined.
Also, we usually want R/O mode change to be seen to other
CPUs as soon as possible, so when we make this a function
call, we will automatically have a memory barrier.
Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'fs/ubifs/io.c')
-rw-r--r-- | fs/ubifs/io.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/ubifs/io.c b/fs/ubifs/io.c index 3374f91b6709..054363f2b207 100644 --- a/fs/ubifs/io.c +++ b/fs/ubifs/io.c @@ -54,6 +54,20 @@ #include "ubifs.h" /** + * ubifs_ro_mode - switch UBIFS to read read-only mode. + * @c: UBIFS file-system description object + * @err: error code which is the reason of switching to R/O mode + */ +void ubifs_ro_mode(struct ubifs_info *c, int err) +{ + if (!c->ro_media) { + c->ro_media = 1; + ubifs_warn("switched to read-only mode, error %d", err); + dbg_dump_stack(); + } +} + +/** * ubifs_check_node - check node. * @c: UBIFS file-system description object * @buf: node to check |