all: strip and move code

This commit is contained in:
Thomas Schoebel-Theuer 2015-12-31 10:41:49 +01:00
parent 4aa36ec1c8
commit fd26edee3d
17 changed files with 8 additions and 1018 deletions

View File

@ -59,59 +59,3 @@ mars-objs := \
mars_light/mars_proc.o \
mars_light/mars_light.o
## remove_this
ifdef CONFIG_MARS_NET_COMPAT
mars-objs += mars_net_compat.o
endif
mars-objs += \
xio_bricks/unused/xio_aio_user.o \
ifdef CONFIG_MARS_DEBUG
KBUILD_CFLAGS += -fno-inline-functions -fno-inline-small-functions -fno-inline-functions-called-once
# This is currently not really used.
# We urge people to maintain it by including it in debug versions
# (so the compiler may throw any complaints)
mars-objs += \
xio_bricks/unused/xio_dummy.o \
xio_bricks/unused/xio_check.o \
xio_bricks/unused/xio_buf.o \
xio_bricks/unused/xio_usebuf.o \
endif
#
# buildtag.h should be regenerated in every build.
#
# The version is determined by the following preference order:
# 1) environment variable $MARSVERSION
# 2) when git is available: git describe --tags
# 3) if a file 'DISTVERSION' exists (out-of-tree tarball), use its content.
# 4) otherwise "no-buildtag-available"
#
extra-y += buildtag.h
$(obj)/buildtag.h: $(patsubst $(obj)/buildtag.h,,$(wildcard $(obj)/*.[ch])) $(obj)/*/*.[ch]
$(Q)$(kecho) "MARS: Generating $@"
$(Q)set -e; \
exec > $@;\
/bin/echo -e "/* Automatically generated -- DO NOT EDIT! */";\
cd $(src); \
if [ "$$MARSVERSION" != "" ]; then \
BUILDTAG="$$MARSVERSION"; \
elif git describe --tags >/dev/null 2>&1; then \
BUILDTAG="$$(git describe --tags)"; \
elif [ -e DISTVERSION ]; then \
BUILDTAG=$$(cat DISTVERSION); \
else \
BUILDTAG="no-buildtag-available"; \
fi; \
/bin/echo -e "#define BUILDTAG \"$$BUILDTAG\"";\
/bin/echo -e "#define BUILDHOST \"$$USER@`hostname`\"";\
/bin/echo -e "#define BUILDDATE \"$$(date '+%F %T')\""
cat $@;
## end_remove_this

View File

@ -24,13 +24,6 @@
#include <linux/kthread.h>
#include <linux/atomic.h>
/* remove_this */
#ifndef CONFIG_MARS_MODULE
/* when unsure, include faked config file */
#include "mars_config.h"
#endif
/* end_remove_this */
#include "brick_say.h"
#include "meta.h"

View File

@ -27,9 +27,6 @@
#include "brick_mem.h"
#include "brick_say.h"
#include "lamport.h"
/* remove_this */
#include "buildtag.h"
/* end_remove_this */
#define USE_KERNEL_PAGES /* currently mandatory (vmalloc does not work) */
@ -255,16 +252,7 @@ _out_return:;
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
"yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy" \
"zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz" \
/* remove_this */ \
" BUILDTAG = " BUILDTAG \
" BUILDHOST = " BUILDHOST \
" BUILDDATE = " BUILDDATE \
/* end_remove_this */ \
" FILE = " __FILE__ \
/* remove_this */ \
" DATE = " __DATE__ \
" TIME = " __TIME__ \
/* end_remove_this */ \
" VERSION = " __VERSION__ \
" xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx STRING_error xxx\n"
# define STRING_PLUS (sizeof(int) * 3 + sizeof(STRING_CANARY))

View File

@ -19,13 +19,6 @@
#define BRICK_MEM_H
#include <linux/mm_types.h>
/* remove_this */
#ifndef CONFIG_MARS_MODULE
/* when unsure, include faked config file */
#include "mars_config.h"
#endif
/* end_remove_this */
#define BRICK_DEBUG_MEM 4096

View File

@ -17,13 +17,6 @@
#ifndef BRICK_SAY_H
#define BRICK_SAY_H
/* remove_this */
#ifndef CONFIG_MARS_MODULE
/* when unsure, include faked config file */
#include "mars_config.h"
#endif
/* end_remove_this */
/***********************************************************************/

View File

@ -26,11 +26,6 @@
#include "brick.h"
#include "../xio_bricks/xio.h"
#include "../xio_bricks/xio_bio.h"
/* remove_this */
#ifndef __USE_COMPAT
#include "../xio_bricks/unused/xio_aio_user.h"
#endif
/* end_remove_this */
#include "../xio_bricks/xio_sio.h"
#include "light_strategy.h"
@ -58,39 +53,11 @@ int _set_server_sio_params(struct xio_brick *_brick, void *private)
return 1;
}
/* remove_this */
#ifndef __USE_COMPAT
static
int _set_server_aio_params(struct xio_brick *_brick, void *private)
{
struct aio_brick *aio_brick = (void *)_brick;
if (_brick->type == (void *)_sio_brick_type)
return _set_server_sio_params(_brick, private);
if (_brick->type != (void *)_aio_brick_type) {
XIO_ERR("bad brick type\n");
return -EINVAL;
}
aio_brick->o_creat = false;
aio_brick->o_direct = false;
aio_brick->o_fdsync = false;
XIO_INF("name = '%s' path = '%s'\n", _brick->brick_name, _brick->brick_path);
return 1;
}
#endif
/* end_remove_this */
static
int _set_server_bio_params(struct xio_brick *_brick, void *private)
{
struct bio_brick *bio_brick;
/* remove_this */
#ifndef __USE_COMPAT
if (_brick->type == (void *)_aio_brick_type)
return _set_server_aio_params(_brick, private);
#endif
/* end_remove_this */
if (_brick->type == (void *)_sio_brick_type)
return _set_server_sio_params(_brick, private);
if (_brick->type != (void *)_bio_brick_type) {

View File

@ -41,29 +41,6 @@
#define SKIP_BIO false
/* remove_this */
#include <linux/wait.h>
#include <linux/version.h>
#ifndef DCACHE_MISS_TYPE /* define accessors compatible to b18825a7c8e37a7cf6abb97a12a6ad71af160de7 */
#define d_is_negative(dentry) ((dentry)->d_inode == NULL)
#define d_backing_inode(dentry) ((dentry)->d_inode)
#endif
/* FIXME: some Redhat/openvz kernels seem to have both (backporting etc).
* The folling is an incomplete quickfix / workaround. TBD.
*/
#if !defined(__WAIT_ATOMIC_T_KEY_INITIALIZER) || defined(RHEL_RELEASE)
#define HAS_VFS_READDIR
#elif !defined(f_dentry)
#define __HAS_NEW_FILLDIR_T
#endif
#ifdef RENAME_NOREPLACE
#define __HAS_RENAME2
#endif
/* end_remove_this */
/*******************************************************************/
/* meta descriptions */
@ -98,40 +75,17 @@ const struct meta mars_dent_meta[] = {
{}
};
/* remove_this */
#ifdef __USE_COMPAT
/* end_remove_this */
/*******************************************************************/
/* The _compat_*() functions are needed for the out-of-tree version
* of MARS for adapdation to different kernel version.
*/
/* remove_this */
#ifdef SB_FREEZE_LEVELS
/* since kernel 3.6 */
/* see a8104a9fcdeb82e22d7acd55fca20746581067d3 */
/* locking order changes in c30dabfe5d10c5fd70d882e5afb8f59f2942b194, we need to adapt */
#define __NEW_PATH_CREATE
#endif
#include <linux/fscache-cache.h>
#ifndef FSCACHE_OP_DEAD
/* since kernel 3.8 */
/* see b9d6ba94b875192ef5e2dab92d72beea33b83c3d */
#define __HAS_RETRY_ESTALE
#endif
/* end_remove_this */
/* Hack because of 8bcb77fabd7cbabcad49f58750be8683febee92b
*/
static int __path_parent(const char *name, struct path *path, unsigned flags)
{
/* remove_this */
#ifdef user_path
return kern_path(name, flags | LOOKUP_PARENT | LOOKUP_DIRECTORY | LOOKUP_FOLLOW, path);
#else
/* end_remove_this */
char *tmp;
int len;
int error;
@ -150,9 +104,6 @@ static int __path_parent(const char *name, struct path *path, unsigned flags)
brick_string_free(tmp);
return error;
/* remove_this */
#endif
/* end_remove_this */
}
/* code is blindly stolen from symlinkat()
@ -171,25 +122,12 @@ int _compat_symlink(const char __user *oldname,
from = (char *)oldname;
/* remove_this */
#ifdef __HAS_RETRY_ESTALE
/* end_remove_this */
retry:
/* remove_this */
#endif
/* end_remove_this */
dentry = user_path_create(newdfd, newname, &path, lookup_flags);
error = PTR_ERR(dentry);
if (IS_ERR(dentry))
goto out_putname;
/* remove_this */
#ifndef __NEW_PATH_CREATE
error = mnt_want_write(path.mnt);
if (error)
goto out_dput;
#endif
/* end_remove_this */
error = vfs_symlink(path.dentry->d_inode, dentry, from);
if (error >= 0 && mtime) {
struct iattr iattr = {
@ -206,27 +144,11 @@ retry:
#endif
mutex_unlock(&dentry->d_inode->i_mutex);
}
/* remove_this */
#ifdef __NEW_PATH_CREATE
/* end_remove_this */
done_path_create(&path, dentry);
/* remove_this */
#else
mnt_drop_write(path.mnt);
out_dput:
dput(dentry);
mutex_unlock(&path.dentry->d_inode->i_mutex);
path_put(&path);
#endif
#ifdef __HAS_RETRY_ESTALE
/* end_remove_this */
if (retry_estale(error, lookup_flags)) {
lookup_flags |= LOOKUP_REVAL;
goto retry;
}
/* remove_this */
#endif
/* end_remove_this */
out_putname:
return error;
}
@ -242,48 +164,19 @@ int _compat_mkdir(const char __user *pathname,
int error;
unsigned int lookup_flags = LOOKUP_DIRECTORY;
/* remove_this */
#ifdef __HAS_RETRY_ESTALE
/* end_remove_this */
retry:
/* remove_this */
#endif
/* end_remove_this */
dentry = user_path_create(dfd, pathname, &path, lookup_flags);
if (IS_ERR(dentry))
return PTR_ERR(dentry);
if (!IS_POSIXACL(path.dentry->d_inode))
mode &= ~current_umask();
/* remove_this */
#ifndef __NEW_PATH_CREATE
error = mnt_want_write(path.mnt);
if (error)
goto out_dput;
#endif
/* end_remove_this */
error = vfs_mkdir(path.dentry->d_inode, dentry, mode);
/* remove_this */
#ifdef __NEW_PATH_CREATE
/* end_remove_this */
done_path_create(&path, dentry);
/* remove_this */
#else
mnt_drop_write(path.mnt);
out_dput:
dput(dentry);
mutex_unlock(&path.dentry->d_inode->i_mutex);
path_put(&path);
#endif
#ifdef __HAS_RETRY_ESTALE
/* end_remove_this */
if (retry_estale(error, lookup_flags)) {
lookup_flags |= LOOKUP_REVAL;
goto retry;
}
/* remove_this */
#endif
/* end_remove_this */
return error;
}
@ -309,13 +202,7 @@ int _compat_rename(const char *oldname,
bool should_retry = false;
int error;
/* remove_this */
#ifdef __HAS_RETRY_ESTALE
/* end_remove_this */
retry:
/* remove_this */
#endif
/* end_remove_this */
error = __path_parent(oldname, &oldpath, lookup_flags);
if (unlikely(error))
goto exit;
@ -344,15 +231,9 @@ retry:
new_one = tmp + 1;
}
/* remove_this */
#ifdef __NEW_PATH_CREATE
/* end_remove_this */
error = mnt_want_write(oldpath.mnt);
if (unlikely(error))
goto exit2;
/* remove_this */
#endif
/* end_remove_this */
trap = lock_rename(new_dir, old_dir);
old_dentry = lookup_one_len(old_one, old_dir, strlen(old_one));
@ -374,30 +255,8 @@ retry:
if (unlikely(new_dentry == trap))
goto out_dput_new;
/* remove_this */
#ifndef __NEW_PATH_CREATE
error = mnt_want_write(oldpath.mnt);
if (unlikely(error))
goto out_dput_new;
#endif
#ifdef __HAS_RENAME2
/* end_remove_this */
error = vfs_rename(old_dir->d_inode, old_dentry,
new_dir->d_inode, new_dentry, NULL, 0);
/* remove_this */
#elif defined(FL_DELEG)
error = vfs_rename(old_dir->d_inode, old_dentry,
new_dir->d_inode, new_dentry, NULL);
#else
error = vfs_rename(old_dir->d_inode, old_dentry,
new_dir->d_inode, new_dentry);
#endif
#ifndef __NEW_PATH_CREATE
mnt_drop_write(oldpath.mnt);
#endif
/* end_remove_this */
out_dput_new:
dput(new_dentry);
@ -407,33 +266,17 @@ out_dput_old:
out_unlock_rename:
unlock_rename(new_dir, old_dir);
/* remove_this */
#ifdef __NEW_PATH_CREATE
/* end_remove_this */
mnt_drop_write(oldpath.mnt);
exit2:
/* remove_this */
#endif
#ifdef __HAS_RETRY_ESTALE
/* end_remove_this */
if (retry_estale(error, lookup_flags))
should_retry = true;
/* remove_this */
#endif
/* end_remove_this */
path_put(&newpath);
exit1:
path_put(&oldpath);
/* remove_this */
#ifdef __HAS_RETRY_ESTALE
/* end_remove_this */
if (should_retry) {
lookup_flags |= LOOKUP_REVAL;
goto retry;
}
/* remove_this */
#endif
/* end_remove_this */
exit:
return error;
}
@ -453,13 +296,7 @@ int _compat_unlink(const char *pathname)
int error;
unsigned int lookup_flags = 0;
/* remove_this */
#ifdef __HAS_RETRY_ESTALE
/* end_remove_this */
retry:
/* remove_this */
#endif
/* end_remove_this */
error = __path_parent(pathname, &path, lookup_flags);
if (unlikely(error))
goto exit;
@ -477,15 +314,9 @@ retry:
one = tmp + 1;
}
/* remove_this */
#ifdef __NEW_PATH_CREATE
/* end_remove_this */
error = mnt_want_write(path.mnt);
if (error)
goto exit1;
/* remove_this */
#endif
/* end_remove_this */
mutex_lock_nested(&parent->d_inode->i_mutex, I_MUTEX_PARENT);
dentry = lookup_one_len(one, parent, strlen(one));
@ -499,13 +330,6 @@ retry:
inode = dentry->d_inode;
ihold(inode);
/* remove_this */
#ifndef __NEW_PATH_CREATE
error = mnt_want_write(path.mnt);
if (error)
goto exit3;
#endif
/* end_remove_this */
#ifdef FL_DELEG
error = vfs_unlink(parent->d_inode, dentry, NULL);
@ -513,44 +337,24 @@ retry:
error = vfs_unlink(parent->d_inode, dentry);
#endif
/* remove_this */
#ifndef __NEW_PATH_CREATE
mnt_drop_write(path.mnt);
#endif
/* end_remove_this */
exit3:
dput(dentry);
exit2:
mutex_unlock(&parent->d_inode->i_mutex);
if (inode)
iput(inode);
/* remove_this */
#ifdef __NEW_PATH_CREATE
/* end_remove_this */
mnt_drop_write(path.mnt);
/* remove_this */
#endif
/* end_remove_this */
exit1:
path_put(&path);
exit:
/* remove_this */
#ifdef __HAS_RETRY_ESTALE
/* end_remove_this */
if (retry_estale(error, lookup_flags)) {
lookup_flags |= LOOKUP_REVAL;
inode = NULL;
goto retry;
}
/* remove_this */
#endif
/* end_remove_this */
return error;
}
/* remove_this */
#endif
/* end_remove_this */
/*******************************************************************/
/* some helpers */
@ -1085,42 +889,17 @@ int dent_compare(struct mars_dent *a, struct mars_dent *b)
return strcmp(a->d_path, b->d_path);
}
/* remove_this */
#ifndef HAS_VFS_READDIR
/* end_remove_this */
struct mars_dir_context {
struct dir_context ctx;
struct mars_cookie *cookie;
};
/* remove_this */
#endif
/* end_remove_this */
/* remove_this */
#ifdef __HAS_NEW_FILLDIR_T
/* end_remove_this */
int mars_filler(struct dir_context *__buf, const char *name, int namlen, loff_t offset,
u64 ino, unsigned int d_type)
/* remove_this */
#else
static
int mars_filler(void *__buf, const char *name, int namlen, loff_t offset,
u64 ino, unsigned int d_type)
#endif
/* end_remove_this */
{
/* remove_this */
#ifdef HAS_VFS_READDIR
struct mars_cookie *cookie = __buf;
#else
/* end_remove_this */
struct mars_dir_context *buf = (void *)__buf;
struct mars_cookie *cookie = buf->cookie;
/* remove_this */
#endif
/* end_remove_this */
struct mars_global *global = cookie->global;
struct list_head *anchor = &global->dent_anchor;
struct list_head *start = anchor;
@ -1219,12 +998,6 @@ static int _mars_readdir(struct mars_cookie *cookie)
mapping_set_gfp_mask(mapping, mapping_gfp_mask(mapping) & ~(__GFP_IO | __GFP_FS));
for (;;) {
/* remove_this */
#ifdef HAS_VFS_READDIR
cookie->hit = false;
status = vfs_readdir(f, mars_filler, cookie);
#else
/* end_remove_this */
struct mars_dir_context buf = {
.ctx.actor = mars_filler,
.cookie = cookie,
@ -1232,9 +1005,6 @@ static int _mars_readdir(struct mars_cookie *cookie)
cookie->hit = false;
status = iterate_dir(f, &buf.ctx);
/* remove_this */
#endif
/* end_remove_this */
if (!cookie->hit)
break;
if (unlikely(status < 0)) {
@ -2013,12 +1783,6 @@ struct xio_brick *path_find_brick(struct mars_global *global, const void *brick_
const struct generic_brick_type *_client_brick_type;
const struct generic_brick_type *_bio_brick_type;
/* remove_this */
#ifndef __USE_COMPAT
const struct generic_brick_type *_aio_brick_type;
#endif
/* end_remove_this */
const struct generic_brick_type *_sio_brick_type;
struct xio_brick *make_brick_all(

View File

@ -23,15 +23,6 @@
#include "../xio_bricks/xio.h"
/* remove_this */
#ifdef KUIDT_INIT
#define HAS_KUID
#else
#define __kuid_val(x) (x)
#define __kgid_val(x) (x)
#endif
/* end_remove_this */
#define MARS_ARGV_MAX 4
extern loff_t global_total_space;

View File

@ -36,9 +36,6 @@
#include <linux/blkdev.h>
#include "light_strategy.h"
/* remove_this */
#include "../buildtag.h"
/* end_remove_this */
#include <linux/wait.h>
@ -50,26 +47,9 @@
#include "../xio_bricks/xio_copy.h"
#include "../xio_bricks/xio_bio.h"
#include "../xio_bricks/xio_sio.h"
/* remove_this */
#ifndef __USE_COMPAT
#include "../xio_bricks/unused/xio_aio_user.h"
#else
#define aio_brick_type sio_brick_type
#define _set_aio_params _set_sio_params
#endif
/* end_remove_this */
#include "../xio_bricks/xio_trans_logger.h"
#include "../xio_bricks/xio_if.h"
#include "mars_proc.h"
/* remove_this */
#ifdef CONFIG_MARS_DEBUG
/* include currently unused bricks, essentially a compile check only */
#include "../xio_bricks/unused/xio_dummy.h"
#include "../xio_bricks/unused/xio_check.h"
#include "../xio_bricks/unused/xio_buf.h"
#include "../xio_bricks/unused/xio_usebuf.h"
#endif
/* end_remove_this */
#define REPLAY_TOLERANCE (PAGE_SIZE + OVERHEAD)
@ -648,32 +628,6 @@ int _set_sio_params(struct xio_brick *_brick, void *private)
return 1;
}
/* remove_this */
#ifndef __USE_COMPAT
static
int _set_aio_params(struct xio_brick *_brick, void *private)
{
struct aio_brick *aio_brick = (void *)_brick;
struct client_cookie *clc = private;
if (_brick->type == (void *)&client_brick_type)
return _set_client_params(_brick, private);
if (_brick->type == (void *)&sio_brick_type)
return _set_sio_params(_brick, private);
if (_brick->type != (void *)&aio_brick_type) {
XIO_ERR("bad brick type\n");
return -EINVAL;
}
aio_brick->o_creat = clc && clc->create_mode;
aio_brick->o_direct = false; /* important! */
aio_brick->o_fdsync = true;
aio_brick->killme = true;
XIO_INF("name = '%s' path = '%s'\n", _brick->brick_name, _brick->brick_path);
return 1;
}
#endif
/* end_remove_this */
static
int _set_bio_params(struct xio_brick *_brick, void *private)
{
@ -681,12 +635,6 @@ int _set_bio_params(struct xio_brick *_brick, void *private)
if (_brick->type == (void *)&client_brick_type)
return _set_client_params(_brick, private);
/* remove_this */
#ifndef __USE_COMPAT
if (_brick->type == (void *)&aio_brick_type)
return _set_aio_params(_brick, private);
#endif
/* end_remove_this */
if (_brick->type == (void *)&sio_brick_type)
return _set_sio_params(_brick, private);
if (_brick->type != (void *)&bio_brick_type) {
@ -2269,9 +2217,6 @@ void _make_alive(void)
}
_make_alivelink("alive", mars_global && mars_global->global_power.button ? 1 : 0);
_make_alivelink_str("tree", SYMLINK_TREE_VERSION);
/* remove_this */
_make_alivelink_str("buildtag", BUILDTAG "(" BUILDDATE ")");
/* end_remove_this */
}
void from_remote_trigger(void)
@ -3042,18 +2987,10 @@ int make_log_init(void *buf, struct mars_dent *dent)
aio_brick =
make_brick_all(global,
aio_dent,
/* remove_this */
_set_aio_params,
/* else_this */
/* _set_sio_params, */
/* end_remove_this */
_set_sio_params,
NULL,
aio_path,
/* remove_this */
(const struct generic_brick_type *)&aio_brick_type,
/* else_this */
/* (const struct generic_brick_type *)&sio_brick_type, */
/* end_remove_this */
(const struct generic_brick_type *)&sio_brick_type,
(const struct generic_brick_type*[]){},
/**/ rot->trans_brick || switch_on ? 2 : -1,
"%s",
@ -3675,18 +3612,10 @@ void _rotate_trans(struct mars_rotate *rot)
rot->next_relevant_brick =
make_brick_all(rot->global,
rot->next_relevant_log,
/* remove_this */
_set_aio_params,
/* else_this */
/* _set_sio_params, */
/* end_remove_this */
_set_sio_params,
NULL,
rot->next_relevant_log->d_path,
/* remove_this */
(const struct generic_brick_type *)&aio_brick_type,
/* else_this */
/* (const struct generic_brick_type *)&sio_brick_type, */
/* end_remove_this */
(const struct generic_brick_type *)&sio_brick_type,
(const struct generic_brick_type *[]){},
2, /* create + activate */
rot->next_relevant_log->d_path,
@ -3805,18 +3734,10 @@ int _start_trans(struct mars_rotate *rot)
rot->relevant_brick =
make_brick_all(rot->global,
rot->relevant_log,
/* remove_this */
_set_aio_params,
/* else_this */
/* _set_sio_params, */
/* end_remove_this */
_set_sio_params,
NULL,
rot->relevant_log->d_path,
/* remove_this */
(const struct generic_brick_type *)&aio_brick_type,
/* else_this */
/* (const struct generic_brick_type *)&sio_brick_type, */
/* end_remove_this */
(const struct generic_brick_type *)&sio_brick_type,
(const struct generic_brick_type *[]){},
2, /* start always */
rot->relevant_log->d_path,
@ -5736,16 +5657,6 @@ static int light_thread(void *data)
(void *)&client_brick_type,
true);
XIO_DBG("kill client bricks (when possible) = %d\n", status);
/* remove_this */
#ifndef __USE_COMPAT
status = xio_kill_brick_when_possible(&_global,
&_global.brick_anchor,
false,
(void *)&aio_brick_type,
true);
XIO_DBG("kill aio bricks (when possible) = %d\n", status);
#endif
/* end_remove_this */
status = xio_kill_brick_when_possible(&_global,
&_global.brick_anchor,
false,
@ -5900,11 +5811,7 @@ static int __init init_light(void)
return -ENOENT;
}
/* remove_this */
printk(KERN_INFO "loading MARS, BUILDTAG=%s BUILDHOST=%s BUILDDATE=%s\n", BUILDTAG, BUILDHOST, BUILDDATE);
/* else_this */
/* printk(KERN_INFO "loading MARS, tree_version=%s\n", SYMLINK_TREE_VERSION); */
/* end_remove_this */
printk(KERN_INFO "loading MARS, tree_version=%s\n", SYMLINK_TREE_VERSION);
init_say(); /* this must come first */
@ -5914,22 +5821,8 @@ static int __init init_light(void)
DO_INIT(brick);
DO_INIT(xio);
DO_INIT(xio_mapfree);
/* remove_this */
#ifdef CONFIG_MARS_DEBUG
/* essentially a compile check only */
DO_INIT(xio_dummy);
DO_INIT(xio_check);
DO_INIT(xio_buf);
DO_INIT(xio_usebuf);
#endif
/* end_remove_this */
DO_INIT(xio_net);
DO_INIT(xio_client);
/* remove_this */
#ifndef __USE_COMPAT
DO_INIT(xio_aio);
#endif
/* end_remove_this */
DO_INIT(xio_sio);
DO_INIT(xio_bio);
DO_INIT(xio_copy);
@ -5976,11 +5869,7 @@ const void *dummy2 = &server_brick_type;
MODULE_DESCRIPTION("MARS Light");
MODULE_AUTHOR("Thomas Schoebel-Theuer <tst@{schoebel-theuer,1und1}.de>");
/* remove_this */
MODULE_VERSION(BUILDTAG " (" BUILDHOST " " BUILDDATE ")");
/* else_this */
/* MODULE_VERSION(SYMLINK_TREE_VERSION); */
/* end_remove_this */
MODULE_VERSION(SYMLINK_TREE_VERSION);
MODULE_LICENSE("GPL");
#ifndef CONFIG_MARS_DEBUG

View File

@ -29,35 +29,12 @@
#include "mars_proc.h"
#include "../xio_bricks/lib_mapfree.h"
#include "../xio_bricks/xio_bio.h"
/* remove_this */
#ifndef __USE_COMPAT
#include "../xio_bricks/unused/xio_aio_user.h"
#endif
/* end_remove_this */
#include "../xio_bricks/xio_if.h"
#include "../xio_bricks/xio_copy.h"
#include "../xio_bricks/xio_client.h"
#include "../xio_bricks/xio_server.h"
#include "../xio_bricks/xio_trans_logger.h"
/* remove_this */
#include "../buildtag.h"
const char mars_version_string[] = BUILDTAG " (" BUILDHOST " " BUILDDATE ") "
#ifndef CONFIG_MARS_DEBUG
"production"
#else
"DEBUG"
#endif
#ifdef CONFIG_MARS_DEBUG_MEM
" BAD_PERFORMANCE"
#endif
#ifdef CONFIG_MARS_DEBUG_ORDER0
" EVIL_PERFORMANCE"
#endif
;
/* end_remove_this */
xio_info_fn xio_info;
static
@ -239,14 +216,6 @@ struct ctl_table io_tuning_table[] = {
THRESHOLD_ENTRIES(&bio_submit_threshold, "bio_submit"),
THRESHOLD_ENTRIES(&bio_io_threshold[0], "bio_io_r"),
THRESHOLD_ENTRIES(&bio_io_threshold[1], "bio_io_w"),
/* remove_this */
#ifndef __USE_COMPAT
THRESHOLD_ENTRIES(&aio_submit_threshold, "aio_submit"),
THRESHOLD_ENTRIES(&aio_io_threshold[0], "aio_io_r"),
THRESHOLD_ENTRIES(&aio_io_threshold[1], "aio_io_w"),
THRESHOLD_ENTRIES(&aio_sync_threshold, "aio_sync"),
#endif
/* end_remove_this */
{}
};
@ -264,16 +233,6 @@ struct ctl_table tcp_tuning_table[] = {
static
struct ctl_table mars_table[] = {
/* remove_this */
{
_CTL_NAME
.procname = "version",
.data = (char *)mars_version_string,
.maxlen = sizeof(mars_version_string),
.mode = 0400,
.proc_handler = &proc_dostring,
},
/* end_remove_this */
{
_CTL_NAME
.procname = "trigger",
@ -296,11 +255,6 @@ struct ctl_table mars_table[] = {
INT_ENTRY("show_debug_messages", brick_say_debug, 0600),
INT_ENTRY("show_statistics_global", global_show_statist, 0600),
INT_ENTRY("show_statistics_server", server_show_statist, 0600),
/* remove_this */
#ifndef __USE_COMPAT
INT_ENTRY("aio_sync_mode", aio_sync_mode, 0600),
#endif
/* end_remove_this */
INT_ENTRY("logger_completion_semantics", trans_logger_completion_semantics, 0600),
INT_ENTRY("logger_do_crc", trans_logger_do_crc, 0600),
INT_ENTRY("syslog_min_class", brick_say_syslog_min, 0600),
@ -355,11 +309,6 @@ struct ctl_table mars_table[] = {
LIMITER_ENTRIES(&if_throttle, "write_throttle", "kb"),
/* changing makes no sense because the server will immediately start upon modprobe */
INT_ENTRY("xio_port", xio_net_default_port, 0400),
/* remove_this */
#ifdef CONFIG_MARS_NET_COMPAT
INT_ENTRY("old_net_proto", use_old_format, 0600),
#endif
/* end_remove_this */
#ifdef __HAVE_LZO
INT_ENTRY("network_compress_data", xio_net_compress_data, 0600),
#endif

View File

@ -22,37 +22,6 @@
#include <linux/rwsem.h>
#include <linux/major.h>
/* remove_this */
/* check the Kconfig environment */
#ifndef CONFIG_MARS_MODULE
/* when unsure, include faked config file */
#include "mars_config.h"
#ifndef CONFIG_SMP
#warning CONFIG_SMP is not set -- are you SURE???
#endif
#endif
#ifndef CONFIG_64BIT
#error XIO is only tested under 64bit
#endif
#ifndef CONFIG_BLOCK
#error CONFIG_BLOCK must be set
#endif
#ifndef CONFIG_PROC_SYSCTL
#error CONFIG_PROC_SYSCTL must be set
#endif
#ifndef CONFIG_HIGH_RES_TIMERS
#error CONFIG_HIGH_RES_TIMERS must be set
#endif
#ifdef CONFIG_DEBUG_SLAB
#error Fixme: CONFIG_DEBUG_SLAB does not work (fix the bio offset calculation)
#endif
#ifdef CONFIG_DEBUG_SG
#error Fixme: CONFIG_DEBUG_SG does not work (fix the bio offset calculation)
#endif
/* end_remove_this */
#if defined(CONFIG_CRYPTO_LZO) || defined(CONFIG_CRYPTO_LZO_MODULE)
#define __HAVE_LZO
#endif
@ -323,11 +292,6 @@ extern int xio_throttle_end;
*/
extern const struct generic_brick_type *_client_brick_type;
extern const struct generic_brick_type *_bio_brick_type;
/* remove_this */
#ifndef __USE_COMPAT
extern const struct generic_brick_type *_aio_brick_type;
#endif
/* end_remove_this */
extern const struct generic_brick_type *_sio_brick_type;
/***********************************************************************/

View File

@ -30,16 +30,6 @@
#include "lib_mapfree.h"
#include "xio_bio.h"
/* remove_this */
#ifdef __bvec_iter_bvec
#define HAS_BVEC_ITER
#endif
/* adaptation to 4246a0b63bd8f56a1469b12eafeb875b1041a451 */
#ifndef bio_io_error
#define HAS_BI_ERROR
#endif
/* end_remove_this */
static struct timing_stats timings[2];
struct threshold bio_submit_threshold = {
@ -73,17 +63,8 @@ struct threshold bio_io_threshold[2] = {
/* This is called from the kernel bio layer.
*/
/* remove_this */
#ifdef HAS_BI_ERROR
/* end_remove_this */
static
void bio_callback(struct bio *bio)
/* remove_this */
#else
static
void bio_callback(struct bio *bio, int code)
#endif
/* end_remove_this */
{
struct bio_aio_aspect *aio_a = bio->bi_private;
struct bio_brick *brick;
@ -94,15 +75,7 @@ void bio_callback(struct bio *bio, int code)
brick = aio_a->output->brick;
CHECK_PTR(brick, err);
/* remove_this */
#ifdef HAS_BI_ERROR
/* end_remove_this */
aio_a->status_code = bio->bi_error;
/* remove_this */
#else
aio_a->status_code = code;
#endif
/* end_remove_this */
spin_lock_irqsave(&brick->lock, flags);
list_del(&aio_a->io_head);
@ -221,19 +194,9 @@ int make_bio(struct bio_brick *brick,
}
bio->bi_vcnt = i;
/* remove_this */
#ifdef HAS_BVEC_ITER
/* end_remove_this */
bio->bi_iter.bi_idx = 0;
bio->bi_iter.bi_size = result_len;
bio->bi_iter.bi_sector = sector;
/* remove_this */
#else
bio->bi_idx = 0;
bio->bi_size = result_len;
bio->bi_sector = sector;
#endif
/* end_remove_this */
bio->bi_bdev = bdev;
bio->bi_private = private;
bio->bi_end_io = bio_callback;
@ -394,41 +357,12 @@ void _bio_io_io(struct bio_output *output, struct aio_object *aio, bool cork)
rw = aio->io_rw & 1;
if (brick->do_noidle && !cork) {
/* remove_this */
/* adapt to different kernel versions (TBD: improve) */
#if defined(BIO_RW_RQ_MASK) || defined(BIO_FLUSH)
rw |= (1 << BIO_RW_NOIDLE);
#elif defined(REQ_NOIDLE)
/* end_remove_this */
rw |= REQ_NOIDLE;
/* remove_this */
#else
#warning Cannot control the NOIDLE flag
#endif
/* end_remove_this */
}
if (!aio->io_skip_sync) {
if (brick->do_sync) {
/* remove_this */
#if defined(BIO_RW_RQ_MASK) || defined(BIO_FLUSH)
rw |= (1 << BIO_RW_SYNCIO);
#elif defined(REQ_SYNC)
/* end_remove_this */
rw |= REQ_SYNC;
/* remove_this */
#else
#warning Cannot control the SYNC flag
#endif
/* end_remove_this */
}
/* remove_this */
#if defined(BIO_RW_RQ_MASK) || defined(BIO_FLUSH)
if (brick->do_unplug && !cork)
rw |= (1 << BIO_RW_UNPLUG);
#else
/* there is no substitute, but the above NOIDLE should do the job (CHECK!) */
#endif
/* end_remove_this */
}
aio_a->start_stamp = cpu_clock(raw_smp_processor_id());

View File

@ -37,11 +37,6 @@
#define USE_MAX_SEGMENT_SIZE IF_MAX_SEGMENT_SIZE
#define USE_LOGICAL_BLOCK_SIZE 512
#define USE_SEGMENT_BOUNDARY (PAGE_SIZE-1)
/* remove_this */
#define USE_CONGESTED_FN
#define USE_MERGE_BVEC
/* end_remove_this */
//#define DENY_READA
#include <linux/kernel.h>
@ -60,24 +55,6 @@
#define XIO_MAJOR (DRBD_MAJOR + 1)
#endif
/* remove_this */
#ifdef bio_end_sector
#define HAS_VOID_RELEASE
#endif
#ifdef __bvec_iter_bvec
#define HAS_BVEC_ITER
#endif
/* adaptation to 4246a0b63bd8f56a1469b12eafeb875b1041a451 */
#ifndef bio_io_error
#define HAS_BI_ERROR
#endif
/* adaptation to 54efd50bfd873e2dbf784e0b21a8027ba4299a3e and 8ae126660fddbeebb9251a174e6fa45b6ad8f932 */
#ifdef HAS_BI_ERROR
#define USE_BLK_QUEUE_SPLIT
#undef USE_MERGE_BVEC
#endif
/* end_remove_this */
/************************ global tuning ***********************/
int if_throttle_start_size;
@ -107,9 +84,6 @@ static int device_minor;
/************************ linux operations ***********************/
/* remove_this */
#ifdef part_stat_lock
/* end_remove_this */
static
void _if_start_io_acct(struct if_input *input, struct bio_wrapper *biow)
{
@ -120,15 +94,7 @@ void _if_start_io_acct(struct if_input *input, struct bio_wrapper *biow)
(void)cpu;
part_round_stats(cpu, &input->disk->part0);
part_stat_inc(cpu, &input->disk->part0, ios[rw]);
/* remove_this */
#ifdef HAS_BVEC_ITER
/* end_remove_this */
part_stat_add(cpu, &input->disk->part0, sectors[rw], bio->bi_iter.bi_size >> 9);
/* remove_this */
#else
part_stat_add(cpu, &input->disk->part0, sectors[rw], bio->bi_size >> 9);
#endif
/* end_remove_this */
part_inc_in_flight(&input->disk->part0, rw);
part_stat_unlock();
biow->start_time = jiffies;
@ -148,12 +114,6 @@ void _if_end_io_acct(struct if_input *input, struct bio_wrapper *biow)
part_dec_in_flight(&input->disk->part0, rw);
part_stat_unlock();
}
/* remove_this */
#else /* part_stat_lock */
#define _if_start_io_acct(...) do {} while (0)
#define _if_end_io_acct(...) do {} while (0)
#endif
/* end_remove_this */
/* callback
*/
@ -195,40 +155,15 @@ void if_endio(struct generic_callback *cb)
error = CALLBACK_ERROR(aio_a->object);
if (unlikely(error < 0)) {
/* remove_this */
#ifdef HAS_BVEC_ITER
/* end_remove_this */
int bi_size = bio->bi_iter.bi_size;
/* remove_this */
#else
int bi_size = bio->bi_size;
#endif
/* end_remove_this */
XIO_ERR("NYI: error=%d RETRY LOGIC %u\n", error, bi_size);
} else { /* bio conventions are slightly different... */
error = 0;
/* remove_this */
#ifdef HAS_BVEC_ITER
/* end_remove_this */
bio->bi_iter.bi_size = 0;
/* remove_this */
#else
bio->bi_size = 0;
#endif
/* end_remove_this */
}
/* remove_this */
#ifdef HAS_BI_ERROR
/* end_remove_this */
bio->bi_error = error;
bio_endio(bio);
/* remove_this */
#else
bio_endio(bio, error);
#endif
/* end_remove_this */
bio_put(bio);
brick_mem_free(biow);
}
@ -300,18 +235,7 @@ void _if_unplug(struct if_input *input)
/* accept a linux bio, convert to aio and call buf_io() on it.
*/
static
/* remove_this */
/* see dece16353ef47d8d33f5302bc158072a9d65e26f */
#ifdef BLK_QC_T_NONE
/* end_remove_this */
blk_qc_t if_make_request(struct request_queue *q, struct bio *bio)
/* remove_this */
#elif defined(BIO_CPU_AFFINE)
int if_make_request(struct request_queue *q, struct bio *bio)
#else
void if_make_request(struct request_queue *q, struct bio *bio)
#endif
/* end_remove_this */
{
struct if_input *input = q->queuedata;
struct if_brick *brick = input->brick;
@ -321,12 +245,6 @@ void if_make_request(struct request_queue *q, struct bio *bio)
const int rw = bio_data_dir(bio);
const int sectors = bio_sectors(bio);
/* remove_this */
/* Adapt to different kernel versions (TBD: improve)
* Since 4246a0b63bd8f56a1469b12eafeb875b1041a451 bio_flagged is no longer a macro.
*/
#if defined(bio_flagged) || !defined(bio_io_error)
/* end_remove_this */
const bool ahead = bio_flagged(bio, __REQ_RAHEAD) && rw == READ;
const bool barrier = bio_flagged(bio, __REQ_SOFTBARRIER);
const bool syncio = bio_flagged(bio, __REQ_SYNC);
@ -335,30 +253,6 @@ void if_make_request(struct request_queue *q, struct bio *bio)
const bool discard = bio_flagged(bio, __REQ_DISCARD);
const bool noidle = bio_flagged(bio, __REQ_NOIDLE);
/* remove_this */
#elif defined(BIO_RW_RQ_MASK) || defined(BIO_FLUSH)
const bool ahead = bio_rw_flagged(bio, BIO_RW_AHEAD) && rw == READ;
const bool barrier = bio_rw_flagged(bio, BIO_RW_BARRIER);
const bool syncio = bio_rw_flagged(bio, BIO_RW_SYNCIO);
const bool unplug = bio_rw_flagged(bio, BIO_RW_UNPLUG);
const bool meta = bio_rw_flagged(bio, BIO_RW_META);
const bool discard = bio_rw_flagged(bio, BIO_RW_DISCARD);
const bool noidle = bio_rw_flagged(bio, BIO_RW_NOIDLE);
#elif defined(REQ_FLUSH) && defined(REQ_SYNC)
#define _flagged(x) (bio->bi_rw & (x))
const bool ahead = _flagged(REQ_RAHEAD) && rw == READ;
const bool barrier = _flagged(REQ_FLUSH);
const bool syncio = _flagged(REQ_SYNC);
const bool unplug = false;
const bool meta = _flagged(REQ_META);
const bool discard = _flagged(REQ_DISCARD);
const bool noidle = _flagged(REQ_THROTTLED);
#else
#error Cannot decode the bio flags
#endif
/* end_remove_this */
const int prio = bio_prio(bio);
/* Transform into XIO flags
@ -376,25 +270,12 @@ void if_make_request(struct request_queue *q, struct bio *bio)
struct aio_object *aio = NULL;
struct if_aio_aspect *aio_a;
/* remove_this */
#ifdef HAS_BVEC_ITER
/* end_remove_this */
struct bio_vec bvec;
struct bvec_iter i;
loff_t pos = ((loff_t)bio->bi_iter.bi_sector) << 9; /* TODO: make dynamic */
int total_len = bio->bi_iter.bi_size;
/* remove_this */
#else
struct bio_vec *bvec;
int i;
loff_t pos = ((loff_t)bio->bi_sector) << 9; /* TODO: make dynamic */
int total_len = bio->bi_size;
#endif
/* end_remove_this */
bool assigned = false;
int error = -EINVAL;
@ -402,14 +283,7 @@ void if_make_request(struct request_queue *q, struct bio *bio)
might_sleep();
/* remove_this */
#ifdef USE_BLK_QUEUE_SPLIT
#warning USE_BLK_QUEUE_SPLIT
/* end_remove_this */
blk_queue_split(q, &bio, q->bio_split);
/* remove_this */
#endif
/* end_remove_this */
if (unlikely(!sectors)) {
_if_unplug(input);
@ -420,17 +294,9 @@ void if_make_request(struct request_queue *q, struct bio *bio)
* In case of exceptional semantics, we need to do
* something here. For now, we do just nothing.
*/
/* remove_this */
#ifdef HAS_BI_ERROR
/* end_remove_this */
error = 0;
bio->bi_error = error;
bio_endio(bio);
/* remove_this */
#else
bio_endio(bio, error);
#endif
/* end_remove_this */
goto done;
}
@ -445,16 +311,8 @@ void if_make_request(struct request_queue *q, struct bio *bio)
#ifdef DENY_READA /* provisionary */
if (ahead) {
atomic_inc(&input->total_reada_count);
/* remove_this */
#ifdef HAS_BI_ERROR
/* end_remove_this */
bio->bi_error = -EWOULDBLOCK;
bio_endio(bio);
/* remove_this */
#else
bio_endio(bio, -EWOULDBLOCK);
#endif
/* end_remove_this */
error = 0;
goto done;
}
@ -463,16 +321,8 @@ void if_make_request(struct request_queue *q, struct bio *bio)
#endif
if (unlikely(discard)) { /* NYI */
error = 0;
/* remove_this */
#ifdef HAS_BI_ERROR
/* end_remove_this */
bio->bi_error = error;
bio_endio(bio);
/* remove_this */
#else
bio_endio(bio, error);
#endif
/* end_remove_this */
goto done;
}
@ -497,21 +347,10 @@ void if_make_request(struct request_queue *q, struct bio *bio)
brick_msleep(100);
bio_for_each_segment(bvec, bio, i) {
/* remove_this */
#ifdef HAS_BVEC_ITER
/* end_remove_this */
struct page *page = bvec.bv_page;
int bv_len = bvec.bv_len;
int offset = bvec.bv_offset;
/* remove_this */
#else
struct page *page = bvec->bv_page;
int bv_len = bvec->bv_len;
int offset = bvec->bv_offset;
#endif
/* end_remove_this */
void *data;
#ifdef ARCH_HAS_KMAP
@ -640,17 +479,8 @@ unlock:
* working in synchronous writethrough mode.
*/
aio->io_skip_sync = true;
/* remove_this */
#ifdef HAS_BVEC_ITER
/* end_remove_this */
if (!do_skip_sync && i.bi_idx + 1 >= bio->bi_iter.bi_idx)
aio->io_skip_sync = false;
/* remove_this */
#else
if (!do_skip_sync && i + 1 >= bio->bi_vcnt)
aio->io_skip_sync = false;
#endif
/* end_remove_this */
atomic_inc(&input->plugged_count);
@ -676,16 +506,8 @@ err:
if (error < 0) {
XIO_ERR("cannot submit request from bio, status=%d\n", error);
if (!assigned) {
/* remove_this */
#ifdef HAS_BI_ERROR
/* end_remove_this */
bio->bi_error = error;
bio_endio(bio);
/* remove_this */
#else
bio_endio(bio, error);
#endif
/* end_remove_this */
}
}
@ -697,45 +519,15 @@ err:
done:
remove_binding_from(brick->say_channel, current);
/* remove_this */
/* see dece16353ef47d8d33f5302bc158072a9d65e26f */
#ifdef BLK_QC_T_NONE
/* end_remove_this */
return BLK_QC_T_NONE;
/* remove_this */
#elif defined(BIO_CPU_AFFINE)
return error;
#else
goto out_return;
#endif
/* end_remove_this */
}
/* remove_this */
#ifndef BLK_MAX_REQUEST_COUNT
/* static */
void if_unplug(struct request_queue *q)
{
struct if_input *input = q->queuedata;
spin_lock_irq(q->queue_lock);
was_plugged = blk_remove_plug(q);
spin_unlock_irq(q->queue_lock);
_if_unplug(input);
}
#endif
/* end_remove_this */
static
int xio_congested(void *data, int bdi_bits)
{
struct if_input *input = data;
int ret = 0;
/* remove_this */
#ifdef WB_STAT_BATCH /* changed by 4452226ea276e74fc3e252c88d9bb7e8f8e44bf0 */
/* end_remove_this */
if (bdi_bits & (1 << WB_sync_congested) &&
atomic_read(&input->read_flying_count) > 0) {
ret |= (1 << WB_sync_congested);
@ -744,35 +536,9 @@ int xio_congested(void *data, int bdi_bits)
atomic_read(&input->write_flying_count) > 0) {
ret |= (1 << WB_async_congested);
}
/* remove_this */
#else /* old code */
if (bdi_bits & (1 << BDI_sync_congested) &&
atomic_read(&input->read_flying_count) > 0) {
ret |= (1 << BDI_sync_congested);
}
if (bdi_bits & (1 << BDI_async_congested) &&
atomic_read(&input->write_flying_count) > 0) {
ret |= (1 << BDI_async_congested);
}
#endif
/* end_remove_this */
return ret;
}
/* remove_this */
#ifdef USE_MERGE_BVEC
static
int xio_merge_bvec(struct request_queue *q, struct bvec_merge_data *bvm, struct bio_vec *bvec)
{
unsigned int bio_size = bvm->bi_size;
if (!bio_size)
return bvec->bv_len;
return 128;
}
#endif
/* end_remove_this */
static
loff_t if_get_capacity(struct if_brick *brick)
{
@ -872,77 +638,14 @@ static int if_switch(struct if_brick *brick)
if_set_capacity(input, capacity);
blk_queue_make_request(q, if_make_request);
/* remove_this */
#ifdef blk_queue_dead
/* introduced in b1bd055d397e09f99dcef9b138ed104ff1812fcb, detected by 34f6055c80285e4efb3f602a9119db75239744dc */
/* end_remove_this */
blk_set_stacking_limits(&q->limits);
/* remove_this */
#endif
#ifdef USE_MAX_SECTORS
#ifdef MAX_SEGMENT_SIZE
XIO_DBG("blk_queue_max_sectors()\n");
blk_queue_max_sectors(q, USE_MAX_SECTORS);
#else
XIO_DBG("blk_queue_max_hw_sectors()\n");
/* end_remove_this */
blk_queue_max_hw_sectors(q, USE_MAX_SECTORS);
/* remove_this */
#endif
#endif
#ifdef USE_MAX_PHYS_SEGMENTS
#ifdef MAX_SEGMENT_SIZE
XIO_DBG("blk_queue_max_phys_segments()\n");
blk_queue_max_phys_segments(q, USE_MAX_PHYS_SEGMENTS);
#else
XIO_DBG("blk_queue_max_segments()\n");
/* end_remove_this */
blk_queue_max_segments(q, PAGE_SIZE);
/* remove_this */
#endif
#endif
#ifdef USE_MAX_HW_SEGMENTS
XIO_DBG("blk_queue_max_hw_segments()\n");
blk_queue_max_hw_segments(q, USE_MAX_HW_SEGMENTS);
#endif
#ifdef USE_MAX_SEGMENT_SIZE
XIO_DBG("blk_queue_max_segment_size()\n");
/* end_remove_this */
blk_queue_max_segment_size(q, USE_MAX_SEGMENT_SIZE);
/* remove_this */
#endif
#ifdef USE_LOGICAL_BLOCK_SIZE
XIO_DBG("blk_queue_logical_block_size()\n");
/* end_remove_this */
blk_queue_logical_block_size(q, USE_LOGICAL_BLOCK_SIZE);
/* remove_this */
#endif
#ifdef USE_SEGMENT_BOUNDARY
XIO_DBG("blk_queue_segment_boundary()\n");
/* end_remove_this */
blk_queue_segment_boundary(q, USE_SEGMENT_BOUNDARY);
/* remove_this */
#endif
#ifdef QUEUE_ORDERED_DRAIN
XIO_DBG("blk_queue_ordered()\n");
blk_queue_ordered(q, QUEUE_ORDERED_DRAIN, NULL);
#endif
XIO_DBG("blk_queue_bounce_limit()\n");
/* end_remove_this */
blk_queue_bounce_limit(q, BLK_BOUNCE_ANY);
/* remove_this */
#ifndef BLK_MAX_REQUEST_COUNT
XIO_DBG("unplug_fn\n");
q->unplug_fn = if_unplug;
#endif
XIO_DBG("queue_lock\n");
#ifdef REQ_WRITE_SAME
/* introduced by 4363ac7c */
/* end_remove_this */
blk_queue_max_write_same_sectors(q, 0);
/* remove_this */
#endif
/* end_remove_this */
q->queue_lock = &input->req_lock; /* needed! */
input->bdev = bdget(MKDEV(disk->major, minor));
@ -953,19 +656,8 @@ static int if_switch(struct if_brick *brick)
XIO_INF("ra_pages OLD = %lu NEW = %d\n", q->backing_dev_info.ra_pages, brick->readahead);
q->backing_dev_info.ra_pages = brick->readahead;
#endif
/* remove_this */
#ifdef USE_CONGESTED_FN
XIO_DBG("congested_fn\n");
/* end_remove_this */
q->backing_dev_info.congested_fn = xio_congested;
q->backing_dev_info.congested_data = input;
/* remove_this */
#endif
#ifdef USE_MERGE_BVEC
XIO_DBG("blk_queue_merge_bvec()\n");
blk_queue_merge_bvec(q, xio_merge_bvec);
#endif
/* end_remove_this */
/* point of no return */
XIO_DBG("add_disk()\n");
@ -1074,15 +766,7 @@ static int if_open(struct block_device *bdev, fmode_t mode)
}
static
/* remove_this */
#ifdef HAS_VOID_RELEASE
/* end_remove_this */
void
/* remove_this */
#else
int
#endif
/* end_remove_this */
if_release(struct gendisk *gd, fmode_t mode)
{
struct if_input *input = gd->private_data;
@ -1103,11 +787,6 @@ if_release(struct gendisk *gd, fmode_t mode)
brick->power.off_led);
local_trigger();
}
/* remove_this */
#ifndef HAS_VOID_RELEASE
return 0;
#endif
/* end_remove_this */
}
static const struct block_device_operations if_blkdev_ops = {

View File

@ -342,21 +342,6 @@ void xio_proto_check(struct xio_socket *msock)
u16 service_flags = 0;
int status;
/* remove_this */
#ifdef CONFIG_MARS_NET_COMPAT
status = _xio_recv_raw(msock, &service_version, 1, 1, MSG_PEEK);
if (unlikely(status < 0)) {
XIO_DBG("#%d protocol exchange failed at peeking, status = %d\n",
msock->s_debug_nr,
status);
goto out_return;
}
if (service_version == 0x8d) {
use_old_format = 1;
goto out_return;
}
#endif
/* end_remove_this */
status = _xio_recv_raw(msock, &service_version, 1, 1, 0);
if (unlikely(status < 0)) {
XIO_DBG("#%d protocol exchange failed at receiving, status = %d\n",
@ -387,13 +372,6 @@ int xio_proto_exchange(struct xio_socket *msock, const char *msg)
{
int status;
/* remove_this */
#ifdef CONFIG_MARS_NET_COMPAT
if (use_old_format)
return 0;
#endif
/* end_remove_this */
msock->s_send_proto = SEND_PROTO_VERSION;
status = xio_send_raw(msock, &msock->s_send_proto, 1, false);
if (unlikely(status < 0)) {
@ -1596,12 +1574,6 @@ int desc_send_struct(struct xio_socket *msock, const void *data, const struct me
int h_meta_len = 0;
int status = -EINVAL;
/* remove_this */
#ifdef CONFIG_MARS_NET_COMPAT
if (!msock->s_recv_proto)
return desc_send_struct_old(msock, data, meta, cork);
#endif
/* end_remove_this */
for (i = 0; i < MAX_DESC_CACHE; i++) {
mc = msock->s_desc_send[i];
if (!mc)
@ -1634,12 +1606,6 @@ int desc_recv_struct(struct xio_socket *msock, void *data, const struct meta *me
int status = 0;
bool need_swap = false;
/* remove_this */
#ifdef CONFIG_MARS_NET_COMPAT
if (!msock->s_recv_proto)
return desc_recv_struct_old(msock, data, meta, line);
#endif
/* end_remove_this */
status = xio_recv_raw(msock, &header, sizeof(header), sizeof(header));
_CHECK_STATUS("recv_header");

View File

@ -161,17 +161,6 @@ extern int xio_recv_aio(struct xio_socket *msock, struct aio_object *aio, struct
extern int xio_send_cb(struct xio_socket *msock, struct aio_object *aio);
extern int xio_recv_cb(struct xio_socket *msock, struct aio_object *aio, struct xio_cmd *cmd);
/* remove_this */
/***********************************************************************/
#ifdef CONFIG_MARS_NET_COMPAT
extern int use_old_format;
int desc_send_struct_old(struct xio_socket *msock, const void *data, const struct meta *meta, bool cork);
int desc_recv_struct_old(struct xio_socket *msock, void *data, const struct meta *meta, int line);
#endif
/* end_remove_this */
/***********************************************************************/
/* init */

View File

@ -27,11 +27,6 @@
#include "brick.h"
#include "xio.h"
#include "xio_bio.h"
/* remove_this */
#ifndef __USE_COMPAT
#include "unused/xio_aio_user.h"
#endif
/* end_remove_this */
#include "xio_sio.h"
/************************ own type definitions ***********************/

View File

@ -1460,14 +1460,6 @@ void phase0_endio(void *private, int error)
orig_aio_a = private;
CHECK_PTR(orig_aio_a, err);
/* remove_this */
if (unlikely(cmpxchg(&orig_aio_a->is_endio, false, true))) {
XIO_ERR("Sigh this should not happen %p %p\n",
orig_aio_a, orig_aio_a->object);
goto out_return;
}
/* end_remove_this */
brick = orig_aio_a->my_brick;
CHECK_PTR(brick, err);
orig_aio = orig_aio_a->object;