diff options
author | Yan, Zheng <zyan@redhat.com> | 2015-01-14 00:46:04 -0500 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2015-02-19 05:31:39 -0500 |
commit | 38c48b5f0a7fd5ed9fdab6da4d208aa23cc5391a (patch) | |
tree | bd496db400c04a1f806e85774636e67186726698 /fs/ceph | |
parent | 1f041a89b4f22cf2e701514f4b8f73a8b1e06a3e (diff) |
ceph: provide seperate {inode,file}_operations for snapdir
remove all unsupported operations from {inode,file}_operations.
Signed-off-by: Yan, Zheng <zyan@redhat.com>
Diffstat (limited to 'fs/ceph')
-rw-r--r-- | fs/ceph/dir.c | 17 | ||||
-rw-r--r-- | fs/ceph/inode.c | 4 | ||||
-rw-r--r-- | fs/ceph/super.h | 2 |
3 files changed, 19 insertions, 4 deletions
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c index c241603764fd..709f3b98ca5c 100644 --- a/fs/ceph/dir.c +++ b/fs/ceph/dir.c | |||
@@ -26,8 +26,6 @@ | |||
26 | * point by name. | 26 | * point by name. |
27 | */ | 27 | */ |
28 | 28 | ||
29 | const struct inode_operations ceph_dir_iops; | ||
30 | const struct file_operations ceph_dir_fops; | ||
31 | const struct dentry_operations ceph_dentry_ops; | 29 | const struct dentry_operations ceph_dentry_ops; |
32 | 30 | ||
33 | /* | 31 | /* |
@@ -1335,6 +1333,13 @@ const struct file_operations ceph_dir_fops = { | |||
1335 | .fsync = ceph_dir_fsync, | 1333 | .fsync = ceph_dir_fsync, |
1336 | }; | 1334 | }; |
1337 | 1335 | ||
1336 | const struct file_operations ceph_snapdir_fops = { | ||
1337 | .iterate = ceph_readdir, | ||
1338 | .llseek = ceph_dir_llseek, | ||
1339 | .open = ceph_open, | ||
1340 | .release = ceph_release, | ||
1341 | }; | ||
1342 | |||
1338 | const struct inode_operations ceph_dir_iops = { | 1343 | const struct inode_operations ceph_dir_iops = { |
1339 | .lookup = ceph_lookup, | 1344 | .lookup = ceph_lookup, |
1340 | .permission = ceph_permission, | 1345 | .permission = ceph_permission, |
@@ -1357,6 +1362,14 @@ const struct inode_operations ceph_dir_iops = { | |||
1357 | .atomic_open = ceph_atomic_open, | 1362 | .atomic_open = ceph_atomic_open, |
1358 | }; | 1363 | }; |
1359 | 1364 | ||
1365 | const struct inode_operations ceph_snapdir_iops = { | ||
1366 | .lookup = ceph_lookup, | ||
1367 | .permission = ceph_permission, | ||
1368 | .getattr = ceph_getattr, | ||
1369 | .mkdir = ceph_mkdir, | ||
1370 | .rmdir = ceph_unlink, | ||
1371 | }; | ||
1372 | |||
1360 | const struct dentry_operations ceph_dentry_ops = { | 1373 | const struct dentry_operations ceph_dentry_ops = { |
1361 | .d_revalidate = ceph_d_revalidate, | 1374 | .d_revalidate = ceph_d_revalidate, |
1362 | .d_release = ceph_d_release, | 1375 | .d_release = ceph_d_release, |
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index f61a74115beb..d0fe2f437fbb 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c | |||
@@ -82,8 +82,8 @@ struct inode *ceph_get_snapdir(struct inode *parent) | |||
82 | inode->i_mode = parent->i_mode; | 82 | inode->i_mode = parent->i_mode; |
83 | inode->i_uid = parent->i_uid; | 83 | inode->i_uid = parent->i_uid; |
84 | inode->i_gid = parent->i_gid; | 84 | inode->i_gid = parent->i_gid; |
85 | inode->i_op = &ceph_dir_iops; | 85 | inode->i_op = &ceph_snapdir_iops; |
86 | inode->i_fop = &ceph_dir_fops; | 86 | inode->i_fop = &ceph_snapdir_fops; |
87 | ci->i_snap_caps = CEPH_CAP_PIN; /* so we can open */ | 87 | ci->i_snap_caps = CEPH_CAP_PIN; /* so we can open */ |
88 | ci->i_rbytes = 0; | 88 | ci->i_rbytes = 0; |
89 | return inode; | 89 | return inode; |
diff --git a/fs/ceph/super.h b/fs/ceph/super.h index 72bc05a73b69..04c8124ed30e 100644 --- a/fs/ceph/super.h +++ b/fs/ceph/super.h | |||
@@ -893,7 +893,9 @@ extern void ceph_fill_inline_data(struct inode *inode, struct page *locked_page, | |||
893 | int ceph_uninline_data(struct file *filp, struct page *locked_page); | 893 | int ceph_uninline_data(struct file *filp, struct page *locked_page); |
894 | /* dir.c */ | 894 | /* dir.c */ |
895 | extern const struct file_operations ceph_dir_fops; | 895 | extern const struct file_operations ceph_dir_fops; |
896 | extern const struct file_operations ceph_snapdir_fops; | ||
896 | extern const struct inode_operations ceph_dir_iops; | 897 | extern const struct inode_operations ceph_dir_iops; |
898 | extern const struct inode_operations ceph_snapdir_iops; | ||
897 | extern const struct dentry_operations ceph_dentry_ops, ceph_snap_dentry_ops, | 899 | extern const struct dentry_operations ceph_dentry_ops, ceph_snap_dentry_ops, |
898 | ceph_snapdir_dentry_ops; | 900 | ceph_snapdir_dentry_ops; |
899 | 901 | ||