Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 05d0e94b authored by Ryusuke Konishi's avatar Ryusuke Konishi
Browse files

nilfs2: get rid of nilfs_bmap_union



This removes nilfs_bmap_union and finally unifies three structures and
the union in bmap/btree code into one.

Signed-off-by: default avatarRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
parent dc935be2
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -26,6 +26,8 @@
#include "nilfs.h"
#include "bmap.h"
#include "sb.h"
#include "btree.h"
#include "direct.h"
#include "btnode.h"
#include "mdt.h"
#include "dat.h"
@@ -533,7 +535,7 @@ void nilfs_bmap_init_gc(struct nilfs_bmap *bmap)

void nilfs_bmap_init_gcdat(struct nilfs_bmap *gcbmap, struct nilfs_bmap *bmap)
{
	memcpy(gcbmap, bmap, sizeof(union nilfs_bmap_union));
	memcpy(gcbmap, bmap, sizeof(*bmap));
	init_rwsem(&gcbmap->b_sem);
	lockdep_set_class(&bmap->b_sem, &nilfs_bmap_dat_lock_key);
	gcbmap->b_inode = &NILFS_BMAP_I(gcbmap)->vfs_inode;
@@ -541,7 +543,7 @@ void nilfs_bmap_init_gcdat(struct nilfs_bmap *gcbmap, struct nilfs_bmap *bmap)

void nilfs_bmap_commit_gcdat(struct nilfs_bmap *gcbmap, struct nilfs_bmap *bmap)
{
	memcpy(bmap, gcbmap, sizeof(union nilfs_bmap_union));
	memcpy(bmap, gcbmap, sizeof(*bmap));
	init_rwsem(&bmap->b_sem);
	lockdep_set_class(&bmap->b_sem, &nilfs_bmap_dat_lock_key);
	bmap->b_inode = &NILFS_BMAP_I(bmap)->vfs_inode;

fs/nilfs2/bmap_union.h

deleted100644 → 0
+0 −42
Original line number Diff line number Diff line
/*
 * bmap_union.h - NILFS block mapping.
 *
 * Copyright (C) 2006-2008 Nippon Telegraph and Telephone Corporation.
 *
 * 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 St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 * Written by Koji Sato <koji@osrg.net>.
 */

#ifndef _NILFS_BMAP_UNION_H
#define _NILFS_BMAP_UNION_H

#include "bmap.h"
#include "direct.h"
#include "btree.h"

/**
 * nilfs_bmap_union -
 * @bi_bmap: bmap structure
 * @bi_btree: direct map structure
 * @bi_direct: B-tree structure
 */
union nilfs_bmap_union {
	struct nilfs_bmap bi_bmap;
	struct nilfs_direct bi_direct;
	struct nilfs_btree bi_btree;
};

#endif	/* _NILFS_BMAP_UNION_H */
+0 −8
Original line number Diff line number Diff line
@@ -30,14 +30,6 @@
#include "btnode.h"
#include "bmap.h"

/**
 * struct nilfs_btree - B-tree structure
 * @bt_bmap: bmap base structure
 */
struct nilfs_btree {
	struct nilfs_bmap bt_bmap;
};

/**
 * struct nilfs_btree_path - A path on which B-tree operations are executed
 * @bp_bh: buffer head of node block
+0 −11
Original line number Diff line number Diff line
@@ -28,8 +28,6 @@
#include "bmap.h"


struct nilfs_direct;

/**
 * struct nilfs_direct_node - direct node
 * @dn_flags: flags
@@ -40,15 +38,6 @@ struct nilfs_direct_node {
	__u8 pad[7];
};

/**
 * struct nilfs_direct - direct mapping
 * @d_bmap: bmap structure
 */
struct nilfs_direct {
	struct nilfs_bmap d_bmap;
};


#define NILFS_DIRECT_NBLOCKS	(NILFS_BMAP_SIZE / sizeof(__le64) - 1)
#define NILFS_DIRECT_KEY_MIN	0
#define NILFS_DIRECT_KEY_MAX	(NILFS_DIRECT_NBLOCKS - 1)
+2 −0
Original line number Diff line number Diff line
@@ -48,6 +48,8 @@
#include <linux/slab.h>
#include <linux/swap.h>
#include "nilfs.h"
#include "btree.h"
#include "btnode.h"
#include "page.h"
#include "mdt.h"
#include "dat.h"
Loading