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
Kirill Smelkov
linux
Commits
0ea611a3
Commit
0ea611a3
authored
Apr 07, 2015
by
Yan, Zheng
Committed by
Ilya Dryomov
Apr 22, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ceph: rename snapshot support
Signed-off-by:
Yan, Zheng
<
zyan@redhat.com
>
parent
c0bd50e2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
4 deletions
+11
-4
fs/ceph/dir.c
fs/ceph/dir.c
+9
-4
fs/ceph/strings.c
fs/ceph/strings.c
+1
-0
include/linux/ceph/ceph_fs.h
include/linux/ceph/ceph_fs.h
+1
-0
No files found.
fs/ceph/dir.c
View file @
0ea611a3
...
...
@@ -947,16 +947,20 @@ static int ceph_rename(struct inode *old_dir, struct dentry *old_dentry,
struct
ceph_fs_client
*
fsc
=
ceph_sb_to_client
(
old_dir
->
i_sb
);
struct
ceph_mds_client
*
mdsc
=
fsc
->
mdsc
;
struct
ceph_mds_request
*
req
;
int
op
=
CEPH_MDS_OP_RENAME
;
int
err
;
if
(
ceph_snap
(
old_dir
)
!=
ceph_snap
(
new_dir
))
return
-
EXDEV
;
if
(
ceph_snap
(
old_dir
)
!=
CEPH_NOSNAP
||
ceph_snap
(
new_dir
)
!=
CEPH_NOSNAP
)
return
-
EROFS
;
if
(
ceph_snap
(
old_dir
)
!=
CEPH_NOSNAP
)
{
if
(
old_dir
==
new_dir
&&
ceph_snap
(
old_dir
)
==
CEPH_SNAPDIR
)
op
=
CEPH_MDS_OP_RENAMESNAP
;
else
return
-
EROFS
;
}
dout
(
"rename dir %p dentry %p to dir %p dentry %p
\n
"
,
old_dir
,
old_dentry
,
new_dir
,
new_dentry
);
req
=
ceph_mdsc_create_request
(
mdsc
,
CEPH_MDS_OP_RENAME
,
USE_AUTH_MDS
);
req
=
ceph_mdsc_create_request
(
mdsc
,
op
,
USE_AUTH_MDS
);
if
(
IS_ERR
(
req
))
return
PTR_ERR
(
req
);
ihold
(
old_dir
);
...
...
@@ -1387,6 +1391,7 @@ const struct inode_operations ceph_snapdir_iops = {
.
getattr
=
ceph_getattr
,
.
mkdir
=
ceph_mkdir
,
.
rmdir
=
ceph_unlink
,
.
rename
=
ceph_rename
,
};
const
struct
dentry_operations
ceph_dentry_ops
=
{
...
...
fs/ceph/strings.c
View file @
0ea611a3
...
...
@@ -75,6 +75,7 @@ const char *ceph_mds_op_name(int op)
case
CEPH_MDS_OP_LSSNAP
:
return
"lssnap"
;
case
CEPH_MDS_OP_MKSNAP
:
return
"mksnap"
;
case
CEPH_MDS_OP_RMSNAP
:
return
"rmsnap"
;
case
CEPH_MDS_OP_RENAMESNAP
:
return
"renamesnap"
;
case
CEPH_MDS_OP_SETFILELOCK
:
return
"setfilelock"
;
case
CEPH_MDS_OP_GETFILELOCK
:
return
"getfilelock"
;
}
...
...
include/linux/ceph/ceph_fs.h
View file @
0ea611a3
...
...
@@ -323,6 +323,7 @@ enum {
CEPH_MDS_OP_MKSNAP
=
0x01400
,
CEPH_MDS_OP_RMSNAP
=
0x01401
,
CEPH_MDS_OP_LSSNAP
=
0x00402
,
CEPH_MDS_OP_RENAMESNAP
=
0x01403
,
};
extern
const
char
*
ceph_mds_op_name
(
int
op
);
...
...
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