From: Artem Bityutskiy <dedekind@infradead.org>
To: linux-fsdevel@vger.kernel.org
Cc: Adrian Hunter <ext-adrian.hunter@nokia.com>,
linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org
Subject: [PATCH] UBIFS: inline one-line functions
Date: Tue, 30 Sep 2008 12:18:59 +0300 [thread overview]
Message-ID: <1222766358-21886-4-git-send-email-dedekind@infradead.org> (raw)
In-Reply-To: <1222766358-21886-1-git-send-email-dedekind@infradead.org>
From: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
'ubifs_get_lprops()' and 'ubifs_release_lprops()' basically wrap
mutex lock and unlock. We have them because we want lprops subsystem
be separate and as independent as possible. And we planned better
locking rules for lprops.
Anyway, because they are short, it is better to inline them.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
---
fs/ubifs/lprops.c | 28 ----------------------------
fs/ubifs/misc.h | 27 +++++++++++++++++++++++++++
fs/ubifs/ubifs.h | 2 --
3 files changed, 27 insertions(+), 30 deletions(-)
diff --git a/fs/ubifs/lprops.c b/fs/ubifs/lprops.c
index 3659b88..f27176e 100644
--- a/fs/ubifs/lprops.c
+++ b/fs/ubifs/lprops.c
@@ -461,18 +461,6 @@ static void change_category(struct ubifs_info *c, struct ubifs_lprops *lprops)
}
/**
- * ubifs_get_lprops - get reference to LEB properties.
- * @c: the UBIFS file-system description object
- *
- * This function locks lprops. Lprops have to be unlocked by
- * 'ubifs_release_lprops()'.
- */
-void ubifs_get_lprops(struct ubifs_info *c)
-{
- mutex_lock(&c->lp_mutex);
-}
-
-/**
* calc_dark - calculate LEB dark space size.
* @c: the UBIFS file-system description object
* @spc: amount of free and dirty space in the LEB
@@ -643,22 +631,6 @@ const struct ubifs_lprops *ubifs_change_lp(struct ubifs_info *c,
}
/**
- * ubifs_release_lprops - release lprops lock.
- * @c: the UBIFS file-system description object
- *
- * This function has to be called after each 'ubifs_get_lprops()' call to
- * unlock lprops.
- */
-void ubifs_release_lprops(struct ubifs_info *c)
-{
- ubifs_assert(mutex_is_locked(&c->lp_mutex));
- ubifs_assert(c->lst.empty_lebs >= 0 &&
- c->lst.empty_lebs <= c->main_lebs);
-
- mutex_unlock(&c->lp_mutex);
-}
-
-/**
* ubifs_get_lp_stats - get lprops statistics.
* @c: UBIFS file-system description object
* @st: return statistics
diff --git a/fs/ubifs/misc.h b/fs/ubifs/misc.h
index 4c12a92..4fa81d8 100644
--- a/fs/ubifs/misc.h
+++ b/fs/ubifs/misc.h
@@ -310,4 +310,31 @@ static inline int ubifs_tnc_lookup(struct ubifs_info *c,
return ubifs_tnc_locate(c, key, node, NULL, NULL);
}
+/**
+ * ubifs_get_lprops - get reference to LEB properties.
+ * @c: the UBIFS file-system description object
+ *
+ * This function locks lprops. Lprops have to be unlocked by
+ * 'ubifs_release_lprops()'.
+ */
+static inline void ubifs_get_lprops(struct ubifs_info *c)
+{
+ mutex_lock(&c->lp_mutex);
+}
+
+/**
+ * ubifs_release_lprops - release lprops lock.
+ * @c: the UBIFS file-system description object
+ *
+ * This function has to be called after each 'ubifs_get_lprops()' call to
+ * unlock lprops.
+ */
+static inline void ubifs_release_lprops(struct ubifs_info *c)
+{
+ ubifs_assert(mutex_is_locked(&c->lp_mutex));
+ ubifs_assert(c->lst.empty_lebs >= 0 &&
+ c->lst.empty_lebs <= c->main_lebs);
+ mutex_unlock(&c->lp_mutex);
+}
+
#endif /* __UBIFS_MISC_H__ */
diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h
index 17c620b..ce86549 100644
--- a/fs/ubifs/ubifs.h
+++ b/fs/ubifs/ubifs.h
@@ -1586,12 +1586,10 @@ int ubifs_lpt_post_commit(struct ubifs_info *c);
void ubifs_lpt_free(struct ubifs_info *c, int wr_only);
/* lprops.c */
-void ubifs_get_lprops(struct ubifs_info *c);
const struct ubifs_lprops *ubifs_change_lp(struct ubifs_info *c,
const struct ubifs_lprops *lp,
int free, int dirty, int flags,
int idx_gc_cnt);
-void ubifs_release_lprops(struct ubifs_info *c);
void ubifs_get_lp_stats(struct ubifs_info *c, struct ubifs_lp_stats *stats);
void ubifs_add_to_cat(struct ubifs_info *c, struct ubifs_lprops *lprops,
int cat);
--
1.5.4.1
next prev parent reply other threads:[~2008-09-30 7:45 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-30 9:18 What is in ubifs-2.6.git Artem Bityutskiy
2008-09-30 7:56 ` Artem Bityutskiy
2008-09-30 8:55 ` Amit Kumar Sharma
2008-09-30 9:02 ` Artem Bityutskiy
2008-09-30 9:18 ` [PATCH] UBIFS: add a print, fix comments and more minor stuff Artem Bityutskiy
2008-09-30 9:18 ` [PATCH] UBIFS: remove unneeded unlikely() Artem Bityutskiy
2008-09-30 9:18 ` Artem Bityutskiy [this message]
2008-09-30 9:19 ` [PATCH] UBIFS: use an IS_ERR test rather than a NULL test Artem Bityutskiy
2008-09-30 9:19 ` [PATCH] UBIFS: add bulk-read facility Artem Bityutskiy
2008-09-30 9:19 ` [PATCH] UBIFS: add no_chk_data_crc mount option Artem Bityutskiy
2008-09-30 9:19 ` [PATCH] UBIFS: improve znode splitting rules Artem Bityutskiy
2008-09-30 9:19 ` [PATCH] UBIFS: check data CRC when in error state Artem Bityutskiy
2008-09-30 9:19 ` [PATCH] UBIFS: use bit-fields when possible Artem Bityutskiy
2008-09-30 9:19 ` [PATCH] UBIFS: correct key comparison Artem Bityutskiy
2008-09-30 9:19 ` [PATCH] UBIFS: ensure data read beyond i_size is zeroed out correctly Artem Bityutskiy
2008-09-30 9:19 ` [PATCH] UBIFS: fix races in bit-fields Artem Bityutskiy
2008-09-30 9:19 ` [PATCH] UBIFS: fix commentary Artem Bityutskiy
2008-09-30 9:19 ` [PATCH] UBIFS: update dbg_dump_inode Artem Bityutskiy
2008-09-30 9:19 ` [PATCH] UBIFS: correct comment for commit_on_unmount Artem Bityutskiy
2008-09-30 9:19 ` [PATCH] UBIFS: commit on sync_fs Artem Bityutskiy
2008-09-30 9:19 ` [PATCH] UBIFS: allow for sync_fs when read-only Artem Bityutskiy
2008-09-30 9:19 ` [PATCH] UBIFS: improve garbage collection Artem Bityutskiy
2008-09-30 9:19 ` [PATCH] UBIFS: fix bulk-read handling uptodate pages Artem Bityutskiy
2008-09-30 9:19 ` [PATCH] UBIFS: add more debugging messages for LPT Artem Bityutskiy
2008-09-30 9:19 ` [PATCH] UBIFS: correct condition to eliminate unecessary assignment Artem Bityutskiy
2008-09-30 9:19 ` [PATCH] UBIFS: check buffer length when scanning for LPT nodes Artem Bityutskiy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1222766358-21886-4-git-send-email-dedekind@infradead.org \
--to=dedekind@infradead.org \
--cc=ext-adrian.hunter@nokia.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®