Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ff46d7b3 authored by Adrian Hunter's avatar Adrian Hunter Committed by Artem Bityutskiy
Browse files

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: default avatarAdrian Hunter <ext-adrian.hunter@nokia.com>
Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
parent 2fb42b11
Loading
Loading
Loading
Loading
+14 −0
Original line number Original line Diff line number Diff line
@@ -53,6 +53,20 @@
#include <linux/crc32.h>
#include <linux/crc32.h>
#include "ubifs.h"
#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.
 * ubifs_check_node - check node.
 * @c: UBIFS file-system description object
 * @c: UBIFS file-system description object
+0 −14
Original line number Original line Diff line number Diff line
@@ -79,20 +79,6 @@ static inline struct ubifs_inode *ubifs_inode(const struct inode *inode)
	return container_of(inode, struct ubifs_inode, vfs_inode);
	return container_of(inode, struct ubifs_inode, vfs_inode);
}
}


/**
 * 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
 */
static inline 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_compr_present - check if compressor was compiled in.
 * ubifs_compr_present - check if compressor was compiled in.
 * @compr_type: compressor type to check
 * @compr_type: compressor type to check
+1 −0
Original line number Original line Diff line number Diff line
@@ -1346,6 +1346,7 @@ extern struct backing_dev_info ubifs_backing_dev_info;
extern struct ubifs_compressor *ubifs_compressors[UBIFS_COMPR_TYPES_CNT];
extern struct ubifs_compressor *ubifs_compressors[UBIFS_COMPR_TYPES_CNT];


/* io.c */
/* io.c */
void ubifs_ro_mode(struct ubifs_info *c, int err);
int ubifs_wbuf_write_nolock(struct ubifs_wbuf *wbuf, void *buf, int len);
int ubifs_wbuf_write_nolock(struct ubifs_wbuf *wbuf, void *buf, int len);
int ubifs_wbuf_seek_nolock(struct ubifs_wbuf *wbuf, int lnum, int offs,
int ubifs_wbuf_seek_nolock(struct ubifs_wbuf *wbuf, int lnum, int offs,
			   int dtype);
			   int dtype);