2015-08-26 07:29:55 +00:00
|
|
|
/*
|
|
|
|
* MARS Long Distance Replication Software
|
|
|
|
*
|
|
|
|
* This file is part of MARS project: http://schoebel.github.io/mars/
|
|
|
|
*
|
|
|
|
* Copyright (C) 2010-2014 Thomas Schoebel-Theuer
|
|
|
|
* Copyright (C) 2011-2014 1&1 Internet AG
|
|
|
|
*
|
|
|
|
* 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; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _MARS_COMPAT
|
|
|
|
#define _MARS_COMPAT
|
|
|
|
|
|
|
|
#include <linux/major.h>
|
|
|
|
|
|
|
|
/* TRANSITIONAL compatibility to BOTH the old prepatch
|
|
|
|
* and the new wrappers around vfs_*().
|
|
|
|
*/
|
|
|
|
#ifdef MARS_MAJOR
|
2019-08-06 06:34:41 +00:00
|
|
|
#define MARS_HAS_PREPATCH
|
2015-08-26 07:29:55 +00:00
|
|
|
#else
|
|
|
|
#define MARS_MAJOR (DRBD_MAJOR + 1)
|
|
|
|
#endif
|
|
|
|
|
2019-08-06 06:34:41 +00:00
|
|
|
#ifdef MARS_HAS_PREPATCH
|
2015-08-26 07:29:55 +00:00
|
|
|
|
|
|
|
#include <linux/syscalls.h>
|
|
|
|
|
2019-08-06 06:34:41 +00:00
|
|
|
#else /* MARS_HAS_PREPATCH */
|
2015-08-26 07:29:55 +00:00
|
|
|
|
2015-05-26 10:16:32 +00:00
|
|
|
#include <linux/compiler.h>
|
2015-05-27 10:03:47 +00:00
|
|
|
#include <linux/time.h>
|
2015-05-26 10:16:32 +00:00
|
|
|
|
|
|
|
extern int _compat_symlink(
|
|
|
|
const char __user *oldname,
|
2015-05-27 10:03:47 +00:00
|
|
|
const char __user *newname,
|
|
|
|
struct timespec *mtime);
|
2015-05-26 10:16:32 +00:00
|
|
|
|
2015-05-26 11:45:35 +00:00
|
|
|
extern int _compat_mkdir(
|
|
|
|
const char __user *pathname,
|
|
|
|
int mode);
|
|
|
|
|
2015-05-27 08:01:20 +00:00
|
|
|
extern int _compat_rename(
|
|
|
|
const char __user *oldname,
|
|
|
|
const char __user *newname);
|
|
|
|
|
2017-05-04 08:28:43 +00:00
|
|
|
extern int _compat_unlink(
|
|
|
|
const char __user *pathname);
|
|
|
|
|
2019-08-06 06:34:41 +00:00
|
|
|
#endif /* MARS_HAS_PREPATCH */
|
2015-08-26 07:29:55 +00:00
|
|
|
|
2019-02-20 10:18:06 +00:00
|
|
|
/* Various compatibility checks for upstream kernels.
|
|
|
|
* This is a hell.
|
|
|
|
*/
|
|
|
|
|
2019-02-20 10:19:11 +00:00
|
|
|
#ifdef __bvec_iter_bvec
|
|
|
|
#define HAS_BVEC_ITER
|
|
|
|
#endif
|
|
|
|
|
2019-02-20 10:32:05 +00:00
|
|
|
/* adaptation to 4246a0b63bd8f56a1469b12eafeb875b1041a451 and 8ae126660fddbeebb9251a174e6fa45b6ad8f932 */
|
2019-02-20 10:27:10 +00:00
|
|
|
#ifndef bio_io_error
|
|
|
|
#define HAS_BI_ERROR
|
2019-02-20 10:32:05 +00:00
|
|
|
#else
|
|
|
|
#define HAS_MERGE_BVEC
|
2019-02-20 10:27:10 +00:00
|
|
|
#endif
|
|
|
|
|
2019-02-20 10:28:11 +00:00
|
|
|
/* adapt to 4e1b2d52a80d79296a5d899d73249748dea71a53 and many others */
|
|
|
|
#ifdef bio_op
|
|
|
|
#define HAS_NEW_BIO_OP
|
|
|
|
#endif
|
|
|
|
|
2019-02-20 10:29:47 +00:00
|
|
|
#ifdef bio_end_sector
|
|
|
|
#define HAS_VOID_RELEASE
|
|
|
|
#endif
|
|
|
|
|
2019-02-20 10:30:21 +00:00
|
|
|
#ifdef __bvec_iter_bvec
|
|
|
|
#define HAS_BVEC_ITER
|
|
|
|
#endif
|
|
|
|
|
2019-02-20 10:34:53 +00:00
|
|
|
/* 54efd50bfd873e2dbf784e0b21a8027ba4299a3e and 8ae126660fddbeebb9251a174e6fa45b6ad8f932,
|
|
|
|
* detected via 4246a0b63bd8f56a1469b12eafeb875b1041a451
|
|
|
|
*/
|
|
|
|
#ifndef BIO_UPTODATE
|
|
|
|
#define NEED_BIO_SPLIT
|
|
|
|
#endif
|
|
|
|
|
2015-08-26 07:29:55 +00:00
|
|
|
#endif /* _MARS_COMPAT */
|