Skip to content

Commit

Permalink
Merge branch 'master' of github.com:oscarlab/betrfs
Browse files Browse the repository at this point in the history
  • Loading branch information
donporter committed Sep 8, 2017
2 parents fa96b05 + ffae826 commit 976807a
Show file tree
Hide file tree
Showing 36 changed files with 99 additions and 18 deletions.
9 changes: 6 additions & 3 deletions filesystem/ftfs_profile.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/* -*- mode: C++; c-basic-offset: 8; indent-tabs-mode: t -*- */
// vim: set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab:

#include <linux/types.h>
#include <linux/fs.h>
#include <linux/slab.h>
Expand All @@ -9,11 +12,11 @@ static struct proc_dir_entry * ftfs_profile_entry;

static void ftfs_print_unlink_profile(void)
{
printk("===== unlink =====\n");
printk("===== unlink =====\n");
printk("time of if branch:%lld\n", unlink_stat.stage1_if.tv64);
printk("time of else branch:%lld\n", unlink_stat.stage1_else.tv64);
printk("time of stage2:%lld\n", unlink_stat.stage2.tv64);
printk("time of ftfs_unlink:%lld\n", unlink_stat.stage2.tv64 +
printk("time of ftfs_unlink:%lld\n", unlink_stat.stage2.tv64 +
unlink_stat.stage1_else.tv64 +
unlink_stat.stage1_if.tv64);
printk("time of ftfs_rmdir:%lld\n", unlink_stat.rmdir.tv64);
Expand All @@ -24,7 +27,7 @@ static void ftfs_print_unlink_profile(void)
printk("count of ftfs_rmdir:%u\n", unlink_stat.count_rmdir);
printk("count of ftfs_destroy_inode:%u\n", unlink_stat.count_destroy);
printk("count of ftfs_evict_inode:%u\n", unlink_stat.count_evict);
printk("===== end ======\n");
printk("===== end ======\n");
memset(&unlink_stat, 0, sizeof(unlink_stat));
}

Expand Down
2 changes: 2 additions & 0 deletions filesystem/ftfs_profile.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* -*- mode: C++; c-basic-offset: 8; indent-tabs-mode: t -*- */
// vim: set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab:
#ifndef FTFS_PROFILE_H
#define FTFS_PROFILE_H

Expand Down
3 changes: 3 additions & 0 deletions filesystem/toku_checkpoint.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/* -*- mode: C++; c-basic-offset: 8; indent-tabs-mode: t -*- */
// vim: set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab:

#include <linux/types.h>
#include <linux/fs.h>
#include <linux/slab.h>
Expand Down
3 changes: 3 additions & 0 deletions filesystem/toku_checkpoint.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/* -*- mode: C++; c-basic-offset: 8; indent-tabs-mode: t -*- */
// vim: set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab:

#ifndef TOKU_CHECKPOINT_H
#define TOKU_CHECKPOINT_H

Expand Down
3 changes: 3 additions & 0 deletions filesystem/toku_engine_status.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/* -*- mode: C++; c-basic-offset: 8; indent-tabs-mode: t -*- */
// vim: set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab:

#include <linux/types.h>
#include <linux/fs.h>
#include <linux/slab.h>
Expand Down
3 changes: 3 additions & 0 deletions filesystem/toku_engine_status.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/* -*- mode: C++; c-basic-offset: 8; indent-tabs-mode: t -*- */
// vim: set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab:

#ifndef TOKU_ENGINE_STATUS_H
#define TOKU_ENGINE_STATUS_H

Expand Down
3 changes: 3 additions & 0 deletions filesystem/toku_flusher.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/* -*- mode: C++; c-basic-offset: 8; indent-tabs-mode: t -*- */
// vim: set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab:

#include <linux/types.h>
#include <linux/fs.h>
#include <linux/slab.h>
Expand Down
3 changes: 3 additions & 0 deletions filesystem/toku_flusher.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/* -*- mode: C++; c-basic-offset: 8; indent-tabs-mode: t -*- */
// vim: set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab:

#ifndef TOKU_FLUSHER_H
#define TOKU_FLUSHER_H

Expand Down
3 changes: 3 additions & 0 deletions filesystem/toku_memleak_detect.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/* -*- mode: C++; c-basic-offset: 8; indent-tabs-mode: t -*- */
// vim: set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab:

#ifdef TOKU_MEMLEAK_DETECT
#include <linux/types.h>
#include <linux/fs.h>
Expand Down
3 changes: 3 additions & 0 deletions filesystem/toku_memleak_detect.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/* -*- mode: C++; c-basic-offset: 8; indent-tabs-mode: t -*- */
// vim: set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab:

#ifndef TOKU_MEMLEAK_DETECT_H
#define TOKU_MEMLEAK_DETECT_H

Expand Down
2 changes: 2 additions & 0 deletions ftfs/ftfs_dir.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* -*- mode: C++; c-basic-offset: 8; indent-tabs-mode: t -*- */
// vim: set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab:
#include <linux/kernel.h>
#include <linux/syscalls.h>
#include <linux/bug.h>
Expand Down
2 changes: 2 additions & 0 deletions ftfs/ftfs_dir.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* -*- mode: C++; c-basic-offset: 8; indent-tabs-mode: t -*- */
// vim: set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab:
#ifndef _FTFS_DIR_H
#define _FTFS_DIR_H

Expand Down
2 changes: 2 additions & 0 deletions ftfs/ftfs_error.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* -*- mode: C++; c-basic-offset: 8; indent-tabs-mode: t -*- */
// vim: set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab:
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/timer.h>
Expand Down
2 changes: 2 additions & 0 deletions ftfs/ftfs_error.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* -*- mode: C++; c-basic-offset: 8; indent-tabs-mode: t -*- */
// vim: set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab:
#ifndef _FTFS_ERROR_H
#define _FTFS_ERROR_H

Expand Down
4 changes: 3 additions & 1 deletion ftfs/ftfs_frwlock.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/* -*- mode: C++; c-basic-offset: 8; indent-tabs-mode: t -*- */
// vim: set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab:
#include "ftfs_frwlock.h"
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/export.h>
#include <linux/rwsem.h>
#include <linux/rwsem.h>
#include <linux/atomic.h>

void __sched ftfs_down_read(struct rw_semaphore *sem)
Expand Down
4 changes: 3 additions & 1 deletion ftfs/ftfs_frwlock.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
/* -*- mode: C++; c-basic-offset: 8; indent-tabs-mode: t -*- */
// vim: set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab:
#ifndef FTFS_FRWLOCK_H
#define FTFS_FRWLOCK_H
#include "ftfs_rwsem.h"
#include <linux/linkage.h>
#include <linux/linkage.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/list.h>
Expand Down
2 changes: 2 additions & 0 deletions ftfs/ftfs_fs.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* -*- mode: C++; c-basic-offset: 8; indent-tabs-mode: t -*- */
// vim: set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab:
#ifndef _FTFS_FS_H
#define _FTFS_FS_H
#define FTFS_SUPER_MAGIC 0
Expand Down
2 changes: 2 additions & 0 deletions ftfs/ftfs_rwsem.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* -*- mode: C++; c-basic-offset: 8; indent-tabs-mode: t -*- */
// vim: set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab:
//copied from 3.8 kernel

/* rwsem.c: R/W semaphores: contention handling functions
Expand Down
8 changes: 5 additions & 3 deletions ftfs/ftfs_rwsem.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* -*- mode: C++; c-basic-offset: 8; indent-tabs-mode: t -*- */
// vim: set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab:
/*as values and the counter type limits the number of
* potential readers/writers to 32767 for 32 bits and 2147483647
* for 64 bits.
Expand Down Expand Up @@ -39,7 +41,7 @@ static inline int __ftfs_down_read_trylock(struct rw_semaphore *sem)
return 1;
}
}
return 0;
return 0;

}

Expand All @@ -50,7 +52,7 @@ static inline void __ftfs_down_write_nested(struct rw_semaphore *sem, int subcla
{


long tmp;
long tmp;
tmp = atomic_long_add_return(FTFS_RWSEM_ACTIVE_WRITE_BIAS,
(atomic_long_t *)&sem->count);
if (unlikely(tmp != FTFS_RWSEM_ACTIVE_WRITE_BIAS))
Expand Down Expand Up @@ -82,7 +84,7 @@ static inline void __ftfs_up_read(struct rw_semaphore *sem)
long tmp;
tmp = atomic_long_dec_return((atomic_long_t *)&sem->count);
if (unlikely(tmp < -1 && (tmp & FTFS_RWSEM_ACTIVE_MASK) == 0))
ftfs_rwsem_wake(sem);
ftfs_rwsem_wake(sem);
}

/*
Expand Down
4 changes: 3 additions & 1 deletion ftfs/ftfs_southbound.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* -*- mode: C++; c-basic-offset: 8; indent-tabs-mode: t -*- */
// vim: set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab:
#include <linux/kallsyms.h>
#include <linux/slab.h>
#include <asm/page_types.h>
Expand Down Expand Up @@ -261,7 +263,7 @@ void detach_ftfs_southbound(struct task_struct *tsk)
ftfs_exit_fs(tsk);
}

void save_task_southbound(struct task_struct *tsk,
void save_task_southbound(struct task_struct *tsk,
struct ftfs_southbound *save)
{
struct fs_struct *fs;
Expand Down
4 changes: 3 additions & 1 deletion ftfs/ftfs_southbound.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* -*- mode: C++; c-basic-offset: 8; indent-tabs-mode: t -*- */
// vim: set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab:
#ifndef _FTFS_SOUTHBOUND_H
#define _FTFS_SOUTHBOUND_H

Expand Down Expand Up @@ -95,7 +97,7 @@ int ftfs_private_umount(void);

int in_southbound_context(struct task_struct *tsk);

void save_task_southbound(struct task_struct *tsk,
void save_task_southbound(struct task_struct *tsk,
struct ftfs_southbound *save);
void restore_task_southbound(struct task_struct *tsk,
struct ftfs_southbound *saved);
Expand Down
2 changes: 2 additions & 0 deletions ftfs/ftfs_stat.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* -*- mode: C++; c-basic-offset: 8; indent-tabs-mode: t -*- */
// vim: set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab:
#include <linux/kernel.h>
#include <linux/time.h>
#include <linux/err.h>
Expand Down
2 changes: 2 additions & 0 deletions ftfs/ftfs_stat.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* -*- mode: C++; c-basic-offset: 8; indent-tabs-mode: t -*- */
// vim: set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab:
#ifndef _FTFS_STAT_H
#define _FTFS_STAT_H
#include<linux/statfs.h>
Expand Down
2 changes: 2 additions & 0 deletions ftfs/ftfs_toku_lock.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* -*- mode: C++; c-basic-offset: 8; indent-tabs-mode: t -*- */
// vim: set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab:
#include <linux/slab.h>
#include <asm/uaccess.h>
#include "ftfs_toku_lock.h"
Expand Down
2 changes: 2 additions & 0 deletions ftfs/ftfs_toku_lock.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* -*- mode: C++; c-basic-offset: 8; indent-tabs-mode: t -*- */
// vim: set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab:
#ifndef _FTFS_ERROR_H
#define _FTFS_ERROR_H

Expand Down
2 changes: 2 additions & 0 deletions ftfs/toku_linkage.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* -*- mode: C++; c-basic-offset: 8; indent-tabs-mode: t -*- */
// vim: set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab:
#include <linux/string.h>
#include <linux/kernel.h>
#include <linux/time.h>
Expand Down
4 changes: 3 additions & 1 deletion ftfs/toku_zlib.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* -*- mode: C++; c-basic-offset: 8; indent-tabs-mode: t -*- */
// vim: set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab:
#include <linux/zlib.h>
#include <linux/vmalloc.h>
#include "ftfs.h"
Expand All @@ -17,7 +19,7 @@ int deflateInit2_(z_streamp strm, int level, int method,
int windowBits, int memLevel, int strategy) {
vfree(strm->workspace);
init_stream_workspace(strm);
return zlib_deflateInit2(strm, level, method,
return zlib_deflateInit2(strm, level, method,
windowBits, memLevel, strategy);
}

Expand Down
2 changes: 2 additions & 0 deletions ftfs_fs/faked_std.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* -*- mode: C++; c-basic-offset: 8; indent-tabs-mode: t -*- */
// vim: set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab:
#ifndef FAKED_STD_LIB
#define FAKED_STD_LIB

Expand Down
4 changes: 3 additions & 1 deletion ftfs_fs/ftfs.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
/* -*- mode: C++; c-basic-offset: 8; indent-tabs-mode: t -*- */
// vim: set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab:
#ifndef _FTFS_H
#define _FTFS_H

# define FTFS_DEBUG_ON(err)
# define FTFS_DEBUG_ON(err)
static inline void ftfs_error (const char * function, const char * fmt, ...) {}
static inline void ftfs_log (const char * function, const char * fmt, ...) {}

Expand Down
4 changes: 3 additions & 1 deletion ftfs_fs/ftfs_bstore.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* -*- mode: C++; c-basic-offset: 8; indent-tabs-mode: t -*- */
// vim: set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab:
#include <linux/kernel.h>
#include <linux/slab.h>

Expand Down Expand Up @@ -189,7 +191,7 @@ int ftfs_bstore_update_ino(struct ftfs_sb_info *sbi, ino_t ino)
dbt_init(&next_ino_value_dbt, &curr_ino,
sizeof(curr_ino));

TXN_GOTO_LABEL(retry);
TXN_GOTO_LABEL(retry);
{

ftfs_bstore_txn_begin(sbi->db_env, NULL, &txn, TXN_MAY_WRITE);
Expand Down
2 changes: 2 additions & 0 deletions ftfs_fs/ftfs_fs.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* -*- mode: C++; c-basic-offset: 8; indent-tabs-mode: t -*- */
// vim: set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab:
#ifndef FTFS_FS_H
#define FTFS_FS_H

Expand Down
2 changes: 2 additions & 0 deletions ftfs_fs/ftfs_metadata.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* -*- mode: C++; c-basic-offset: 8; indent-tabs-mode: t -*- */
// vim: set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab:
#include <linux/sched.h>
#include <linux/cred.h>
#include <linux/slab.h>
Expand Down
2 changes: 2 additions & 0 deletions ftfs_fs/ftfs_module.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* -*- mode: C++; c-basic-offset: 8; indent-tabs-mode: t -*- */
// vim: set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab:
#include <linux/module.h>
#include "ftfs_fs.h"

Expand Down
4 changes: 3 additions & 1 deletion ftfs_fs/ftfs_southbound.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* -*- mode: C++; c-basic-offset: 8; indent-tabs-mode: t -*- */
// vim: set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab:
#ifndef _FTFS_SOUTHBOUND_H
#define _FTFS_SOUTHBOUND_H

Expand All @@ -16,7 +18,7 @@ extern size_t db_cachesize;
static inline int ftfs_super_statfs(struct dentry * d, struct kstatfs * buf)
{ return 0; }
static inline int attach_ftfs_southbound(struct task_struct *tsk) { return 0; }
static inline void save_task_southbound(struct task_struct *tsk,
static inline void save_task_southbound(struct task_struct *tsk,
struct ftfs_southbound *save) { }
static inline void restore_task_southbound(struct task_struct *tsk,
struct ftfs_southbound *saved) { }
Expand Down
6 changes: 4 additions & 2 deletions ftfs_fs/ftfs_super.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* -*- mode: C++; c-basic-offset: 8; indent-tabs-mode: t -*- */
// vim: set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab:
#include <linux/kernel.h>
#include <linux/namei.h>
#include <linux/slab.h>
Expand Down Expand Up @@ -147,7 +149,7 @@ ftfs_setup_inode(struct super_block *sb, struct ftfs_meta_key *meta_key,
struct ftfs_metadata *meta);

static inline void
ftfs_setup_metadata(struct ftfs_metadata *meta, umode_t mode,
ftfs_setup_metadata(struct ftfs_metadata *meta, umode_t mode,
loff_t size, dev_t rdev, ino_t ino)
{
struct timespec now_tspec;
Expand Down Expand Up @@ -334,7 +336,7 @@ ftfs_do_unlink(struct ftfs_meta_key *meta_key, DB_TXN *txn,
* we lock the whole subtree before rename for exclusive access. for
* either success or fail, you have to call unlock or else you are
* hosed
*
*
* only the children are locked not the parent
*/
static int prelock_children_for_rename(struct dentry *object, struct list_head *locked)
Expand Down
6 changes: 4 additions & 2 deletions ftfs_fs/rbtreekv.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* -*- mode: C++; c-basic-offset: 8; indent-tabs-mode: t -*- */
// vim: set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab:
#ifndef RBTREE_KV_H
#define RBTREE_KV_H

Expand Down Expand Up @@ -191,7 +193,7 @@ static int rb_kv_insert(DB *db, struct rb_kv_node *node)
new = &((*new)->rb_left);
else if (result > 0)
new = &((*new)->rb_right);
else
else
return -1;
}

Expand Down Expand Up @@ -363,7 +365,7 @@ static int dbc_c_set_bounds(DBC *dbc, const DBT *left_key, const DBT *right_key,
ret = dbt_alloc_and_copy(&wrap->right, right_key);
BUG_ON(ret != 0);

return 0;
return 0;
}

static int dbc_c_getf_current(DBC *c, uint32_t flag, YDB_CALLBACK_FUNCTION f, void *extra)
Expand Down

0 comments on commit 976807a

Please sign in to comment.