You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
ocfs2: sysfile interfaces for online file check
Implement online file check sysfile interfaces, e.g. how to create the related sysfile according to device name, how to display/handle file check request from the sysfile. Signed-off-by: Gang He <ghe@suse.com> Reviewed-by: Mark Fasheh <mfasheh@suse.de> Cc: Joel Becker <jlbec@evilplan.org> Cc: Junxiao Bi <junxiao.bi@oracle.com> Cc: Joseph Qi <joseph.qi@huawei.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
@@ -41,7 +41,8 @@ ocfs2-objs := \
|
||||
quota_local.o \
|
||||
quota_global.o \
|
||||
xattr.o \
|
||||
acl.o
|
||||
acl.o \
|
||||
filecheck.o
|
||||
|
||||
ocfs2_stackglue-objs := stackglue.o
|
||||
ocfs2_stack_o2cb-objs := stack_o2cb.o
|
||||
|
||||
606
fs/ocfs2/filecheck.c
Normal file
606
fs/ocfs2/filecheck.c
Normal file
File diff suppressed because it is too large
Load Diff
49
fs/ocfs2/filecheck.h
Normal file
49
fs/ocfs2/filecheck.h
Normal file
@@ -0,0 +1,49 @@
|
||||
/* -*- mode: c; c-basic-offset: 8; -*-
|
||||
* vim: noexpandtab sw=8 ts=8 sts=0:
|
||||
*
|
||||
* filecheck.h
|
||||
*
|
||||
* Online file check.
|
||||
*
|
||||
* Copyright (C) 2016 SuSE. All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public
|
||||
* License as published by the Free Software Foundation, version 2.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef FILECHECK_H
|
||||
#define FILECHECK_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/list.h>
|
||||
|
||||
|
||||
/* File check errno */
|
||||
enum {
|
||||
OCFS2_FILECHECK_ERR_SUCCESS = 0, /* Success */
|
||||
OCFS2_FILECHECK_ERR_FAILED = 1000, /* Other failure */
|
||||
OCFS2_FILECHECK_ERR_INPROGRESS, /* In progress */
|
||||
OCFS2_FILECHECK_ERR_READONLY, /* Read only */
|
||||
OCFS2_FILECHECK_ERR_INJBD, /* Buffer in jbd */
|
||||
OCFS2_FILECHECK_ERR_INVALIDINO, /* Invalid ino */
|
||||
OCFS2_FILECHECK_ERR_BLOCKECC, /* Block ecc */
|
||||
OCFS2_FILECHECK_ERR_BLOCKNO, /* Block number */
|
||||
OCFS2_FILECHECK_ERR_VALIDFLAG, /* Inode valid flag */
|
||||
OCFS2_FILECHECK_ERR_GENERATION, /* Inode generation */
|
||||
OCFS2_FILECHECK_ERR_UNSUPPORTED /* Unsupported */
|
||||
};
|
||||
|
||||
#define OCFS2_FILECHECK_ERR_START OCFS2_FILECHECK_ERR_FAILED
|
||||
#define OCFS2_FILECHECK_ERR_END OCFS2_FILECHECK_ERR_UNSUPPORTED
|
||||
|
||||
int ocfs2_filecheck_create_sysfs(struct super_block *sb);
|
||||
int ocfs2_filecheck_remove_sysfs(struct super_block *sb);
|
||||
|
||||
#endif /* FILECHECK_H */
|
||||
@@ -139,6 +139,9 @@ int ocfs2_drop_inode(struct inode *inode);
|
||||
/* Flags for ocfs2_iget() */
|
||||
#define OCFS2_FI_FLAG_SYSFILE 0x1
|
||||
#define OCFS2_FI_FLAG_ORPHAN_RECOVERY 0x2
|
||||
#define OCFS2_FI_FLAG_FILECHECK_CHK 0x4
|
||||
#define OCFS2_FI_FLAG_FILECHECK_FIX 0x8
|
||||
|
||||
struct inode *ocfs2_ilookup(struct super_block *sb, u64 feoff);
|
||||
struct inode *ocfs2_iget(struct ocfs2_super *osb, u64 feoff, unsigned flags,
|
||||
int sysfile_type);
|
||||
|
||||
Reference in New Issue
Block a user