diff options
author | Tejun Heo <tj@kernel.org> | 2014-02-03 14:09:09 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-02-07 18:52:48 -0500 |
commit | 90c07c895c87d38db100b6afcb686ab3ef0d6a64 (patch) | |
tree | 22ff946cdcd306f0ba5ce998832db0028bae3aab /fs/kernfs | |
parent | 07c7530dd46728e25e938d0eb291f8085435c365 (diff) |
kernfs: rename kernfs_dir_ops to kernfs_syscall_ops
We're gonna need non-dir syscall callbacks, which will make dir_ops a
misnomer. Let's rename kernfs_dir_ops to kernfs_syscall_ops.
This is pure rename.
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/kernfs')
-rw-r--r-- | fs/kernfs/dir.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/fs/kernfs/dir.c b/fs/kernfs/dir.c index bfbfb48f4ad8..f58d2f16eaf7 100644 --- a/fs/kernfs/dir.c +++ b/fs/kernfs/dir.c | |||
@@ -527,13 +527,14 @@ EXPORT_SYMBOL_GPL(kernfs_find_and_get_ns); | |||
527 | 527 | ||
528 | /** | 528 | /** |
529 | * kernfs_create_root - create a new kernfs hierarchy | 529 | * kernfs_create_root - create a new kernfs hierarchy |
530 | * @kdops: optional directory syscall operations for the hierarchy | 530 | * @scops: optional syscall operations for the hierarchy |
531 | * @priv: opaque data associated with the new directory | 531 | * @priv: opaque data associated with the new directory |
532 | * | 532 | * |
533 | * Returns the root of the new hierarchy on success, ERR_PTR() value on | 533 | * Returns the root of the new hierarchy on success, ERR_PTR() value on |
534 | * failure. | 534 | * failure. |
535 | */ | 535 | */ |
536 | struct kernfs_root *kernfs_create_root(struct kernfs_dir_ops *kdops, void *priv) | 536 | struct kernfs_root *kernfs_create_root(struct kernfs_syscall_ops *scops, |
537 | void *priv) | ||
537 | { | 538 | { |
538 | struct kernfs_root *root; | 539 | struct kernfs_root *root; |
539 | struct kernfs_node *kn; | 540 | struct kernfs_node *kn; |
@@ -556,7 +557,7 @@ struct kernfs_root *kernfs_create_root(struct kernfs_dir_ops *kdops, void *priv) | |||
556 | kn->priv = priv; | 557 | kn->priv = priv; |
557 | kn->dir.root = root; | 558 | kn->dir.root = root; |
558 | 559 | ||
559 | root->dir_ops = kdops; | 560 | root->syscall_ops = scops; |
560 | root->kn = kn; | 561 | root->kn = kn; |
561 | init_waitqueue_head(&root->deactivate_waitq); | 562 | init_waitqueue_head(&root->deactivate_waitq); |
562 | 563 | ||
@@ -653,16 +654,16 @@ static int kernfs_iop_mkdir(struct inode *dir, struct dentry *dentry, | |||
653 | umode_t mode) | 654 | umode_t mode) |
654 | { | 655 | { |
655 | struct kernfs_node *parent = dir->i_private; | 656 | struct kernfs_node *parent = dir->i_private; |
656 | struct kernfs_dir_ops *kdops = kernfs_root(parent)->dir_ops; | 657 | struct kernfs_syscall_ops *scops = kernfs_root(parent)->syscall_ops; |
657 | int ret; | 658 | int ret; |
658 | 659 | ||
659 | if (!kdops || !kdops->mkdir) | 660 | if (!scops || !scops->mkdir) |
660 | return -EPERM; | 661 | return -EPERM; |
661 | 662 | ||
662 | if (!kernfs_get_active(parent)) | 663 | if (!kernfs_get_active(parent)) |
663 | return -ENODEV; | 664 | return -ENODEV; |
664 | 665 | ||
665 | ret = kdops->mkdir(parent, dentry->d_name.name, mode); | 666 | ret = scops->mkdir(parent, dentry->d_name.name, mode); |
666 | 667 | ||
667 | kernfs_put_active(parent); | 668 | kernfs_put_active(parent); |
668 | return ret; | 669 | return ret; |
@@ -671,16 +672,16 @@ static int kernfs_iop_mkdir(struct inode *dir, struct dentry *dentry, | |||
671 | static int kernfs_iop_rmdir(struct inode *dir, struct dentry *dentry) | 672 | static int kernfs_iop_rmdir(struct inode *dir, struct dentry *dentry) |
672 | { | 673 | { |
673 | struct kernfs_node *kn = dentry->d_fsdata; | 674 | struct kernfs_node *kn = dentry->d_fsdata; |
674 | struct kernfs_dir_ops *kdops = kernfs_root(kn)->dir_ops; | 675 | struct kernfs_syscall_ops *scops = kernfs_root(kn)->syscall_ops; |
675 | int ret; | 676 | int ret; |
676 | 677 | ||
677 | if (!kdops || !kdops->rmdir) | 678 | if (!scops || !scops->rmdir) |
678 | return -EPERM; | 679 | return -EPERM; |
679 | 680 | ||
680 | if (!kernfs_get_active(kn)) | 681 | if (!kernfs_get_active(kn)) |
681 | return -ENODEV; | 682 | return -ENODEV; |
682 | 683 | ||
683 | ret = kdops->rmdir(kn); | 684 | ret = scops->rmdir(kn); |
684 | 685 | ||
685 | kernfs_put_active(kn); | 686 | kernfs_put_active(kn); |
686 | return ret; | 687 | return ret; |
@@ -691,10 +692,10 @@ static int kernfs_iop_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
691 | { | 692 | { |
692 | struct kernfs_node *kn = old_dentry->d_fsdata; | 693 | struct kernfs_node *kn = old_dentry->d_fsdata; |
693 | struct kernfs_node *new_parent = new_dir->i_private; | 694 | struct kernfs_node *new_parent = new_dir->i_private; |
694 | struct kernfs_dir_ops *kdops = kernfs_root(kn)->dir_ops; | 695 | struct kernfs_syscall_ops *scops = kernfs_root(kn)->syscall_ops; |
695 | int ret; | 696 | int ret; |
696 | 697 | ||
697 | if (!kdops || !kdops->rename) | 698 | if (!scops || !scops->rename) |
698 | return -EPERM; | 699 | return -EPERM; |
699 | 700 | ||
700 | if (!kernfs_get_active(kn)) | 701 | if (!kernfs_get_active(kn)) |
@@ -705,7 +706,7 @@ static int kernfs_iop_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
705 | return -ENODEV; | 706 | return -ENODEV; |
706 | } | 707 | } |
707 | 708 | ||
708 | ret = kdops->rename(kn, new_parent, new_dentry->d_name.name); | 709 | ret = scops->rename(kn, new_parent, new_dentry->d_name.name); |
709 | 710 | ||
710 | kernfs_put_active(new_parent); | 711 | kernfs_put_active(new_parent); |
711 | kernfs_put_active(kn); | 712 | kernfs_put_active(kn); |