Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
92fee66d
Commit
92fee66d
authored
Jul 25, 2007
by
Chris Mason
Committed by
David Woodhouse
Jul 25, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Btrfs: deal with api changes in 2.6.23-rc1
Signed-off-by:
Chris Mason
<
chris.mason@oracle.com
>
parent
618e21d5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
26 deletions
+33
-26
fs/btrfs/file.c
fs/btrfs/file.c
+7
-2
fs/btrfs/inode.c
fs/btrfs/inode.c
+26
-24
No files found.
fs/btrfs/file.c
View file @
92fee66d
...
...
@@ -30,6 +30,7 @@
#include <linux/writeback.h>
#include <linux/statfs.h>
#include <linux/compat.h>
#include <linux/version.h>
#include "ctree.h"
#include "disk-io.h"
#include "transaction.h"
...
...
@@ -713,8 +714,12 @@ static int btrfs_sync_file(struct file *file,
}
static
struct
vm_operations_struct
btrfs_file_vm_ops
=
{
.
nopage
=
filemap_nopage
,
.
populate
=
filemap_populate
,
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
.
nopage
=
filemap_nopage
,
.
populate
=
filemap_populate
,
#else
.
fault
=
filemap_fault
,
#endif
.
page_mkwrite
=
btrfs_page_mkwrite
,
};
...
...
fs/btrfs/inode.c
View file @
92fee66d
...
...
@@ -31,6 +31,7 @@
#include <linux/statfs.h>
#include <linux/compat.h>
#include <linux/bit_spinlock.h>
#include <linux/version.h>
#include "ctree.h"
#include "disk-io.h"
#include "transaction.h"
...
...
@@ -2323,42 +2324,43 @@ void btrfs_destroy_cachep(void)
kmem_cache_destroy
(
btrfs_path_cachep
);
}
static
struct
kmem_cache
*
cache_create
(
const
char
*
name
,
size_t
size
,
unsigned
long
extra_flags
,
void
(
*
ctor
)(
void
*
,
struct
kmem_cache
*
,
unsigned
long
))
{
return
kmem_cache_create
(
name
,
size
,
0
,
(
SLAB_RECLAIM_ACCOUNT
|
SLAB_MEM_SPREAD
|
extra_flags
),
ctor
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
,
NULL
#endif
);
}
int
btrfs_init_cachep
(
void
)
{
btrfs_inode_cachep
=
kmem_cache_create
(
"btrfs_inode_cache"
,
sizeof
(
struct
btrfs_inode
),
0
,
(
SLAB_RECLAIM_ACCOUNT
|
SLAB_MEM_SPREAD
),
init_once
,
NULL
);
btrfs_inode_cachep
=
cache_create
(
"btrfs_inode_cache"
,
sizeof
(
struct
btrfs_inode
),
0
,
init_once
);
if
(
!
btrfs_inode_cachep
)
goto
fail
;
btrfs_trans_handle_cachep
=
kmem_
cache_create
(
"btrfs_trans_handle_cache"
,
btrfs_trans_handle_cachep
=
cache_create
(
"btrfs_trans_handle_cache"
,
sizeof
(
struct
btrfs_trans_handle
),
0
,
(
SLAB_RECLAIM_ACCOUNT
|
SLAB_MEM_SPREAD
),
NULL
,
NULL
);
0
,
NULL
);
if
(
!
btrfs_trans_handle_cachep
)
goto
fail
;
btrfs_transaction_cachep
=
kmem_
cache_create
(
"btrfs_transaction_cache"
,
btrfs_transaction_cachep
=
cache_create
(
"btrfs_transaction_cache"
,
sizeof
(
struct
btrfs_transaction
),
0
,
(
SLAB_RECLAIM_ACCOUNT
|
SLAB_MEM_SPREAD
),
NULL
,
NULL
);
0
,
NULL
);
if
(
!
btrfs_transaction_cachep
)
goto
fail
;
btrfs_path_cachep
=
kmem_cache_create
(
"btrfs_path_cache"
,
sizeof
(
struct
btrfs_transaction
),
0
,
(
SLAB_RECLAIM_ACCOUNT
|
SLAB_MEM_SPREAD
),
NULL
,
NULL
);
btrfs_path_cachep
=
cache_create
(
"btrfs_path_cache"
,
sizeof
(
struct
btrfs_transaction
),
0
,
NULL
);
if
(
!
btrfs_path_cachep
)
goto
fail
;
btrfs_bit_radix_cachep
=
kmem_cache_create
(
"btrfs_radix"
,
256
,
0
,
(
SLAB_RECLAIM_ACCOUNT
|
SLAB_MEM_SPREAD
|
SLAB_DESTROY_BY_RCU
),
NULL
,
NULL
);
btrfs_bit_radix_cachep
=
cache_create
(
"btrfs_radix"
,
256
,
SLAB_DESTROY_BY_RCU
,
NULL
);
if
(
!
btrfs_bit_radix_cachep
)
goto
fail
;
return
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment