public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 4/9] fs:ubifs: add hook for UBI bakvol in ubifs layer
@ 2015-09-28  7:02 Bean Huo 霍斌斌 (beanhuo)
  2015-09-28 11:21 ` Boris Brezillon
  0 siblings, 1 reply; 2+ messages in thread
From: Bean Huo 霍斌斌 (beanhuo) @ 2015-09-28  7:02 UTC (permalink / raw)
  To: dedekind1@gmail.com, adrian.hunter@intel.com,
	computersforpeace@gmail.com, baruch@tkos.co.il,
	asierra@xes-inc.com, guz.fnst@cn.fujitsu.com, gsi@denx.de,
	richard@nod.at, Boris Brezillon
  Cc: Boris Brezillon, David Woodhouse, linux-mtd@lists.infradead.org,
	Artem Bityutskiy, Richard Weinberger,
	Frank Liu 刘群 (frankliu), Andrea Scian,
	Peter Pan 潘柏宏 (peterpan),
	Karl Zhang 张双锣 (karlzhang), Iwo Mergler,
	Jeff Lauruhn (jlauruhn), Stefan Roese,
	linux-kernel@vger.kernel.org

Add hook for UBI bakvol in ubifs layer.

open/close bakvol operation in ubifs mount.

Signed-off-by: Bean Huo <beanhuo@micron.com>
---
 fs/ubifs/super.c | 6 ++++++
 fs/ubifs/ubifs.h | 1 +
 2 files changed, 7 insertions(+)

diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index 9547a278..f3bf548 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -1463,6 +1463,8 @@ static int mount_ubifs(struct ubifs_info *c)
 	dbg_gen("max. seq. number:    %llu", c->max_sqnum);
 	dbg_gen("commit number:       %llu", c->cmt_no);
 
+	init_bakvol(c->ubi, 1);
+
 	return 0;
 
 out_infos:
@@ -1774,6 +1776,10 @@ static void ubifs_put_super(struct super_block *sb)
 	 * the mutex is locked.
 	 */
 	mutex_lock(&c->umount_mutex);
+
+	/* Disable ubi MLC power loss backup function */
+	init_bakvol(c->ubi, 0);
+
 	if (!c->ro_mount) {
 		/*
 		 * First of all kill the background thread to make sure it does
diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h
index de75902..4af2d5a 100644
--- a/fs/ubifs/ubifs.h
+++ b/fs/ubifs/ubifs.h
@@ -1479,6 +1479,7 @@ extern const struct inode_operations ubifs_dir_inode_operations;
 extern const struct inode_operations ubifs_symlink_inode_operations;
 extern struct backing_dev_info ubifs_backing_dev_info;
 extern struct ubifs_compressor *ubifs_compressors[UBIFS_COMPR_TYPES_CNT];
+extern void init_bakvol(struct ubi_volume_desc *desc, uint8_t choice);
 
 /* io.c */
 void ubifs_ro_mode(struct ubifs_info *c, int err);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-09-28 11:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-28  7:02 [PATCH 4/9] fs:ubifs: add hook for UBI bakvol in ubifs layer Bean Huo 霍斌斌 (beanhuo)
2015-09-28 11:21 ` Boris Brezillon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox