diff mbox

[4/9] fs:ubifs: add hook for UBI bakvol in ubifs layer

Message ID A765B125120D1346A63912DDE6D8B6310BF4CEE8@NTXXIAMBX02.xacn.micron.com
State Superseded
Headers show

Commit Message

Bean Huo Sept. 28, 2015, 7:02 a.m. UTC
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(+)

Comments

Boris Brezillon Sept. 28, 2015, 11:21 a.m. UTC | #1
On Mon, 28 Sep 2015 07:02:52 +0000
Bean Huo 霍斌斌 (beanhuo) <beanhuo@micron.com> wrote:

> 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);

This function is implemented in patch 9 and you're using it here, which
means your series is not bisectable.

Also, do we really want to let UBIFS decide whether this feature should
be enabled or not for the whole UBI device?
diff mbox

Patch

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);