2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-29 07:34:06 +08:00
linux-next/fs/ocfs2/filecheck.h
Thomas Gleixner 50acfb2b76 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 286
Based on 1 normalized pattern(s):

  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

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-only

has been chosen to replace the boilerplate/reference in 97 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Reviewed-by: Alexios Zavras <alexios.zavras@intel.com>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190529141901.025053186@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-05 17:36:37 +02:00

67 lines
1.9 KiB
C

/* SPDX-License-Identifier: GPL-2.0-only */
/* -*- 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.
*/
#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
struct ocfs2_filecheck {
struct list_head fc_head; /* File check entry list head */
spinlock_t fc_lock;
unsigned int fc_max; /* Maximum number of entry in list */
unsigned int fc_size; /* Current entry count in list */
unsigned int fc_done; /* Finished entry count in list */
};
#define OCFS2_FILECHECK_MAXSIZE 100
#define OCFS2_FILECHECK_MINSIZE 10
/* File check operation type */
enum {
OCFS2_FILECHECK_TYPE_CHK = 0, /* Check a file(inode) */
OCFS2_FILECHECK_TYPE_FIX, /* Fix a file(inode) */
OCFS2_FILECHECK_TYPE_SET = 100 /* Set entry list maximum size */
};
struct ocfs2_filecheck_sysfs_entry { /* sysfs entry per partition */
struct kobject fs_kobj;
struct completion fs_kobj_unregister;
struct ocfs2_filecheck *fs_fcheck;
};
int ocfs2_filecheck_create_sysfs(struct ocfs2_super *osb);
void ocfs2_filecheck_remove_sysfs(struct ocfs2_super *osb);
#endif /* FILECHECK_H */