1 /* SPDX-License-Identifier: GPL-2.0-only */
7 * Copyright (C) 2016 SuSE. All rights reserved.
14 #include <linux/types.h>
15 #include <linux/list.h>
18 /* File check errno */
20 OCFS2_FILECHECK_ERR_SUCCESS
= 0, /* Success */
21 OCFS2_FILECHECK_ERR_FAILED
= 1000, /* Other failure */
22 OCFS2_FILECHECK_ERR_INPROGRESS
, /* In progress */
23 OCFS2_FILECHECK_ERR_READONLY
, /* Read only */
24 OCFS2_FILECHECK_ERR_INJBD
, /* Buffer in jbd */
25 OCFS2_FILECHECK_ERR_INVALIDINO
, /* Invalid ino */
26 OCFS2_FILECHECK_ERR_BLOCKECC
, /* Block ecc */
27 OCFS2_FILECHECK_ERR_BLOCKNO
, /* Block number */
28 OCFS2_FILECHECK_ERR_VALIDFLAG
, /* Inode valid flag */
29 OCFS2_FILECHECK_ERR_GENERATION
, /* Inode generation */
30 OCFS2_FILECHECK_ERR_UNSUPPORTED
/* Unsupported */
33 #define OCFS2_FILECHECK_ERR_START OCFS2_FILECHECK_ERR_FAILED
34 #define OCFS2_FILECHECK_ERR_END OCFS2_FILECHECK_ERR_UNSUPPORTED
36 struct ocfs2_filecheck
{
37 struct list_head fc_head
; /* File check entry list head */
39 unsigned int fc_max
; /* Maximum number of entry in list */
40 unsigned int fc_size
; /* Current entry count in list */
41 unsigned int fc_done
; /* Finished entry count in list */
44 #define OCFS2_FILECHECK_MAXSIZE 100
45 #define OCFS2_FILECHECK_MINSIZE 10
47 /* File check operation type */
49 OCFS2_FILECHECK_TYPE_CHK
= 0, /* Check a file(inode) */
50 OCFS2_FILECHECK_TYPE_FIX
, /* Fix a file(inode) */
51 OCFS2_FILECHECK_TYPE_SET
= 100 /* Set entry list maximum size */
54 struct ocfs2_filecheck_sysfs_entry
{ /* sysfs entry per partition */
55 struct kobject fs_kobj
;
56 struct completion fs_kobj_unregister
;
57 struct ocfs2_filecheck
*fs_fcheck
;
61 int ocfs2_filecheck_create_sysfs(struct ocfs2_super
*osb
);
62 void ocfs2_filecheck_remove_sysfs(struct ocfs2_super
*osb
);
64 #endif /* FILECHECK_H */