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
71f73bd1
Commit
71f73bd1
authored
Oct 28, 2002
by
Alexander Viro
Committed by
James Bottomley
Oct 28, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] presto cache keyed by superblock instead of kdev_t
parent
4d466c1f
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
19 deletions
+15
-19
fs/intermezzo/cache.c
fs/intermezzo/cache.c
+11
-13
fs/intermezzo/inode.c
fs/intermezzo/inode.c
+1
-1
fs/intermezzo/super.c
fs/intermezzo/super.c
+1
-1
include/linux/intermezzo_fs.h
include/linux/intermezzo_fs.h
+2
-4
No files found.
fs/intermezzo/cache.c
View file @
71f73bd1
...
@@ -58,16 +58,15 @@ extern kmem_cache_t * presto_dentry_slab;
...
@@ -58,16 +58,15 @@ extern kmem_cache_t * presto_dentry_slab;
#define CACHES_MASK CACHES_SIZE - 1
#define CACHES_MASK CACHES_SIZE - 1
static
struct
list_head
presto_caches
[
CACHES_SIZE
];
static
struct
list_head
presto_caches
[
CACHES_SIZE
];
static
inline
int
presto_cache_hash
(
kdev_t
dev
)
static
inline
int
presto_cache_hash
(
struct
super_block
*
s
)
{
{
return
(
CACHES_MASK
)
&
((
0x000F
&
(
major
(
dev
))
<<
8
)
+
(
0x000F
&
minor
(
dev
))
);
return
(
CACHES_MASK
)
&
((
unsigned
long
)
s
>>
L1_CACHE_SHIFT
);
}
}
inline
void
presto_cache_add
(
struct
presto_cache
*
cache
,
kdev_t
dev
)
inline
void
presto_cache_add
(
struct
presto_cache
*
cache
)
{
{
list_add
(
&
cache
->
cache_chain
,
list_add
(
&
cache
->
cache_chain
,
&
presto_caches
[
presto_cache_hash
(
dev
)]);
&
presto_caches
[
presto_cache_hash
(
cache
->
cache_sb
)]);
cache
->
cache_dev
=
dev
;
}
}
inline
void
presto_cache_init_hash
(
void
)
inline
void
presto_cache_init_hash
(
void
)
...
@@ -79,18 +78,17 @@ inline void presto_cache_init_hash(void)
...
@@ -79,18 +78,17 @@ inline void presto_cache_init_hash(void)
}
}
/* map a device to a cache */
/* map a device to a cache */
struct
presto_cache
*
presto_cache_find
(
kdev_t
dev
)
struct
presto_cache
*
presto_cache_find
(
struct
super_block
*
s
)
{
{
struct
presto_cache
*
cache
;
struct
presto_cache
*
cache
;
struct
list_head
*
lh
,
*
tmp
;
struct
list_head
*
lh
,
*
tmp
;
lh
=
tmp
=
&
(
presto_caches
[
presto_cache_hash
(
dev
)]);
lh
=
tmp
=
&
(
presto_caches
[
presto_cache_hash
(
s
)]);
while
(
(
tmp
=
lh
->
next
)
!=
lh
)
{
while
(
(
tmp
=
lh
->
next
)
!=
lh
)
{
cache
=
list_entry
(
tmp
,
struct
presto_cache
,
cache_chain
);
cache
=
list_entry
(
tmp
,
struct
presto_cache
,
cache_chain
);
if
(
kdev_same
(
cache
->
cache_dev
,
dev
)
)
{
if
(
cache
->
cache_sb
==
s
)
return
cache
;
return
cache
;
}
}
}
return
NULL
;
return
NULL
;
}
}
...
@@ -101,10 +99,10 @@ struct presto_cache *presto_get_cache(struct inode *inode)
...
@@ -101,10 +99,10 @@ struct presto_cache *presto_get_cache(struct inode *inode)
struct
presto_cache
*
cache
;
struct
presto_cache
*
cache
;
ENTRY
;
ENTRY
;
/* find the correct presto_cache here, based on the device */
/* find the correct presto_cache here, based on the device */
cache
=
presto_cache_find
(
to_kdev_t
(
inode
->
i_dev
)
);
cache
=
presto_cache_find
(
inode
->
i_sb
);
if
(
!
cache
)
{
if
(
!
cache
)
{
CERROR
(
"WARNING: no presto cache for
dev %x
, ino %ld
\n
"
,
CERROR
(
"WARNING: no presto cache for
%s
, ino %ld
\n
"
,
inode
->
i_
dev
,
inode
->
i_ino
);
inode
->
i_
sb
->
s_id
,
inode
->
i_ino
);
EXIT
;
EXIT
;
return
NULL
;
return
NULL
;
}
}
...
@@ -122,7 +120,7 @@ int presto_ispresto(struct inode *inode)
...
@@ -122,7 +120,7 @@ int presto_ispresto(struct inode *inode)
cache
=
presto_get_cache
(
inode
);
cache
=
presto_get_cache
(
inode
);
if
(
!
cache
)
if
(
!
cache
)
return
0
;
return
0
;
return
kdev_same
(
to_kdev_t
(
inode
->
i_dev
),
cache
->
cache_dev
)
;
return
inode
->
i_sb
==
cache
->
cache_sb
;
}
}
/* setup a cache structure when we need one */
/* setup a cache structure when we need one */
...
...
fs/intermezzo/inode.c
View file @
71f73bd1
...
@@ -118,7 +118,7 @@ static void presto_put_super(struct super_block *sb)
...
@@ -118,7 +118,7 @@ static void presto_put_super(struct super_block *sb)
int
err
;
int
err
;
ENTRY
;
ENTRY
;
cache
=
presto_cache_find
(
to_kdev_t
(
sb
->
s_dev
)
);
cache
=
presto_cache_find
(
sb
);
if
(
!
cache
)
{
if
(
!
cache
)
{
EXIT
;
EXIT
;
goto
exit
;
goto
exit
;
...
...
fs/intermezzo/super.c
View file @
71f73bd1
...
@@ -285,7 +285,7 @@ struct super_block * presto_get_sb(struct file_system_type *izo_type,
...
@@ -285,7 +285,7 @@ struct super_block * presto_get_sb(struct file_system_type *izo_type,
cache
->
cache_root
=
dget
(
sb
->
s_root
);
cache
->
cache_root
=
dget
(
sb
->
s_root
);
/* we now know the dev of the cache: hash the cache */
/* we now know the dev of the cache: hash the cache */
presto_cache_add
(
cache
,
to_kdev_t
(
sb
->
s_dev
)
);
presto_cache_add
(
cache
);
err
=
izo_prepare_fileset
(
sb
->
s_root
,
fileset
);
err
=
izo_prepare_fileset
(
sb
->
s_root
,
fileset
);
filter_setup_journal_ops
(
cache
->
cache_filter
,
cache
->
cache_type
);
filter_setup_journal_ops
(
cache
->
cache_filter
,
cache
->
cache_type
);
...
...
include/linux/intermezzo_fs.h
View file @
71f73bd1
...
@@ -223,8 +223,6 @@ struct presto_cache {
...
@@ -223,8 +223,6 @@ struct presto_cache {
int
cache_flags
;
int
cache_flags
;
kdev_t
cache_dev
;
/* underlying block device */
char
*
cache_type
;
/* filesystem type of cache */
char
*
cache_type
;
/* filesystem type of cache */
struct
filter_fs
*
cache_filter
;
struct
filter_fs
*
cache_filter
;
...
@@ -425,10 +423,10 @@ int presto_prep(struct dentry *, struct presto_cache **,
...
@@ -425,10 +423,10 @@ int presto_prep(struct dentry *, struct presto_cache **,
struct
presto_file_set
**
);
struct
presto_file_set
**
);
/* cache.c */
/* cache.c */
extern
struct
presto_cache
*
presto_cache_init
(
void
);
extern
struct
presto_cache
*
presto_cache_init
(
void
);
extern
inline
void
presto_cache_add
(
struct
presto_cache
*
cache
,
kdev_t
dev
);
extern
inline
void
presto_cache_add
(
struct
presto_cache
*
cache
);
extern
inline
void
presto_cache_init_hash
(
void
);
extern
inline
void
presto_cache_init_hash
(
void
);
struct
presto_cache
*
presto_cache_find
(
kdev_t
dev
);
struct
presto_cache
*
presto_cache_find
(
struct
super_block
*
sb
);
#define PRESTO_REQLOW (3 * 4096)
#define PRESTO_REQLOW (3 * 4096)
#define PRESTO_REQHIGH (6 * 4096)
#define PRESTO_REQHIGH (6 * 4096)
...
...
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