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
18fc8abd
Commit
18fc8abd
authored
Oct 28, 2016
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ceph: unify dentry_operations instances
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
7126bc2e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
33 deletions
+10
-33
fs/ceph/dir.c
fs/ceph/dir.c
+3
-27
fs/ceph/inode.c
fs/ceph/inode.c
+5
-4
fs/ceph/super.c
fs/ceph/super.c
+1
-0
fs/ceph/super.h
fs/ceph/super.h
+1
-2
No files found.
fs/ceph/dir.c
View file @
18fc8abd
...
...
@@ -50,13 +50,6 @@ int ceph_init_dentry(struct dentry *dentry)
goto
out_unlock
;
}
if
(
ceph_snap
(
d_inode
(
dentry
->
d_parent
))
==
CEPH_NOSNAP
)
d_set_d_op
(
dentry
,
&
ceph_dentry_ops
);
else
if
(
ceph_snap
(
d_inode
(
dentry
->
d_parent
))
==
CEPH_SNAPDIR
)
d_set_d_op
(
dentry
,
&
ceph_snapdir_dentry_ops
);
else
d_set_d_op
(
dentry
,
&
ceph_snap_dentry_ops
);
di
->
dentry
=
dentry
;
di
->
lease_session
=
NULL
;
di
->
time
=
jiffies
;
...
...
@@ -1319,16 +1312,6 @@ static void ceph_d_release(struct dentry *dentry)
kmem_cache_free
(
ceph_dentry_cachep
,
di
);
}
static
int
ceph_snapdir_d_revalidate
(
struct
dentry
*
dentry
,
unsigned
int
flags
)
{
/*
* Eventually, we'll want to revalidate snapped metadata
* too... probably...
*/
return
1
;
}
/*
* When the VFS prunes a dentry from the cache, we need to clear the
* complete flag on the parent directory.
...
...
@@ -1347,6 +1330,9 @@ static void ceph_d_prune(struct dentry *dentry)
if
(
d_unhashed
(
dentry
))
return
;
if
(
ceph_snap
(
d_inode
(
dentry
->
d_parent
))
==
CEPH_SNAPDIR
)
return
;
/*
* we hold d_lock, so d_parent is stable, and d_fsdata is never
* cleared until d_release
...
...
@@ -1518,13 +1504,3 @@ const struct dentry_operations ceph_dentry_ops = {
.
d_release
=
ceph_d_release
,
.
d_prune
=
ceph_d_prune
,
};
const
struct
dentry_operations
ceph_snapdir_dentry_ops
=
{
.
d_revalidate
=
ceph_snapdir_d_revalidate
,
.
d_release
=
ceph_d_release
,
};
const
struct
dentry_operations
ceph_snap_dentry_ops
=
{
.
d_release
=
ceph_d_release
,
.
d_prune
=
ceph_d_prune
,
};
fs/ceph/inode.c
View file @
18fc8abd
...
...
@@ -1023,16 +1023,17 @@ static void update_dentry_lease(struct dentry *dentry,
long
unsigned
half_ttl
=
from_time
+
(
duration
*
HZ
/
2
)
/
1000
;
struct
inode
*
dir
;
/* only track leases on regular dentries */
if
(
dentry
->
d_op
!=
&
ceph_dentry_ops
)
return
;
spin_lock
(
&
dentry
->
d_lock
);
dout
(
"update_dentry_lease %p duration %lu ms ttl %lu
\n
"
,
dentry
,
duration
,
ttl
);
/* make lease_rdcache_gen match directory */
dir
=
d_inode
(
dentry
->
d_parent
);
/* only track leases on regular dentries */
if
(
ceph_snap
(
dir
)
!=
CEPH_NOSNAP
)
goto
out_unlock
;
di
->
lease_shared_gen
=
ceph_inode
(
dir
)
->
i_shared_gen
;
if
(
duration
==
0
)
...
...
fs/ceph/super.c
View file @
18fc8abd
...
...
@@ -877,6 +877,7 @@ static int ceph_set_super(struct super_block *s, void *data)
fsc
->
sb
=
s
;
s
->
s_op
=
&
ceph_super_ops
;
s
->
s_d_op
=
&
ceph_dentry_ops
;
s
->
s_export_op
=
&
ceph_export_ops
;
s
->
s_time_gran
=
1000
;
/* 1000 ns == 1 us */
...
...
fs/ceph/super.h
View file @
18fc8abd
...
...
@@ -934,8 +934,7 @@ extern const struct file_operations ceph_dir_fops;
extern
const
struct
file_operations
ceph_snapdir_fops
;
extern
const
struct
inode_operations
ceph_dir_iops
;
extern
const
struct
inode_operations
ceph_snapdir_iops
;
extern
const
struct
dentry_operations
ceph_dentry_ops
,
ceph_snap_dentry_ops
,
ceph_snapdir_dentry_ops
;
extern
const
struct
dentry_operations
ceph_dentry_ops
;
extern
loff_t
ceph_make_fpos
(
unsigned
high
,
unsigned
off
,
bool
hash_order
);
extern
int
ceph_handle_notrace_create
(
struct
inode
*
dir
,
struct
dentry
*
dentry
);
...
...
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