diff options
author | Tristan Ye <tristan.ye@oracle.com> | 2011-05-24 04:42:09 -0400 |
---|---|---|
committer | Tristan Ye <tristan.ye@oracle.com> | 2011-05-25 03:17:08 -0400 |
commit | 028ba5df63fa9fc18045bc1e9b48cdd43727e1c5 (patch) | |
tree | 2a3f20f03a0f82bc2ffd87b68b1649823b178e63 /fs/ocfs2 | |
parent | 220ebc4334326bc23e4c4c3f076dc5a58ec293f6 (diff) |
Ocfs2/move_extents: Add basic framework and source files for extent moving.
Adding new files move_extents.[c|h] and fill it with nothing but
only a context structure.
Signed-off-by: Tristan Ye <tristan.ye@oracle.com>
Diffstat (limited to 'fs/ocfs2')
-rw-r--r-- | fs/ocfs2/Makefile | 1 | ||||
-rw-r--r-- | fs/ocfs2/move_extents.c | 56 | ||||
-rw-r--r-- | fs/ocfs2/move_extents.h | 20 |
3 files changed, 77 insertions, 0 deletions
diff --git a/fs/ocfs2/Makefile b/fs/ocfs2/Makefile index d8a0313e99e6..f17e58b32989 100644 --- a/fs/ocfs2/Makefile +++ b/fs/ocfs2/Makefile | |||
@@ -30,6 +30,7 @@ ocfs2-objs := \ | |||
30 | namei.o \ | 30 | namei.o \ |
31 | refcounttree.o \ | 31 | refcounttree.o \ |
32 | reservations.o \ | 32 | reservations.o \ |
33 | move_extents.o \ | ||
33 | resize.o \ | 34 | resize.o \ |
34 | slot_map.o \ | 35 | slot_map.o \ |
35 | suballoc.o \ | 36 | suballoc.o \ |
diff --git a/fs/ocfs2/move_extents.c b/fs/ocfs2/move_extents.c new file mode 100644 index 000000000000..6311c15356f7 --- /dev/null +++ b/fs/ocfs2/move_extents.c | |||
@@ -0,0 +1,56 @@ | |||
1 | /* -*- mode: c; c-basic-offset: 8; -*- | ||
2 | * vim: noexpandtab sw=8 ts=8 sts=0: | ||
3 | * | ||
4 | * move_extents.c | ||
5 | * | ||
6 | * Copyright (C) 2011 Oracle. All rights reserved. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public | ||
10 | * License version 2 as published by the Free Software Foundation. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
15 | * General Public License for more details. | ||
16 | */ | ||
17 | #include <linux/fs.h> | ||
18 | #include <linux/types.h> | ||
19 | #include <linux/mount.h> | ||
20 | #include <linux/swap.h> | ||
21 | |||
22 | #include <cluster/masklog.h> | ||
23 | |||
24 | #include "ocfs2.h" | ||
25 | #include "ocfs2_ioctl.h" | ||
26 | |||
27 | #include "alloc.h" | ||
28 | #include "aops.h" | ||
29 | #include "dlmglue.h" | ||
30 | #include "extent_map.h" | ||
31 | #include "inode.h" | ||
32 | #include "journal.h" | ||
33 | #include "suballoc.h" | ||
34 | #include "uptodate.h" | ||
35 | #include "super.h" | ||
36 | #include "dir.h" | ||
37 | #include "buffer_head_io.h" | ||
38 | #include "sysfile.h" | ||
39 | #include "suballoc.h" | ||
40 | #include "refcounttree.h" | ||
41 | #include "move_extents.h" | ||
42 | |||
43 | struct ocfs2_move_extents_context { | ||
44 | struct inode *inode; | ||
45 | struct file *file; | ||
46 | int auto_defrag; | ||
47 | int credits; | ||
48 | u32 new_phys_cpos; | ||
49 | u32 clusters_moved; | ||
50 | u64 refcount_loc; | ||
51 | struct ocfs2_move_extents *range; | ||
52 | struct ocfs2_extent_tree et; | ||
53 | struct ocfs2_alloc_context *meta_ac; | ||
54 | struct ocfs2_alloc_context *data_ac; | ||
55 | struct ocfs2_cached_dealloc_ctxt dealloc; | ||
56 | }; | ||
diff --git a/fs/ocfs2/move_extents.h b/fs/ocfs2/move_extents.h new file mode 100644 index 000000000000..27570f7f6909 --- /dev/null +++ b/fs/ocfs2/move_extents.h | |||
@@ -0,0 +1,20 @@ | |||
1 | /* -*- mode: c; c-basic-offset: 8; -*- | ||
2 | * vim: noexpandtab sw=8 ts=8 sts=0: | ||
3 | * | ||
4 | * move_extents.h | ||
5 | * | ||
6 | * Copyright (C) 2011 Oracle. All rights reserved. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public | ||
10 | * License version 2 as published by the Free Software Foundation. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
15 | * General Public License for more details. | ||
16 | */ | ||
17 | #ifndef OCFS2_MOVE_EXTENTS_H | ||
18 | #define OCFS2_MOVE_EXTENTS_H | ||
19 | |||
20 | #endif /* OCFS2_MOVE_EXTENTS_H */ | ||