aboutsummaryrefslogtreecommitdiffstats
path: root/fs/kernfs/file.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2013-12-11 14:11:56 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-12-11 20:39:20 -0500
commitdf23fc39bce03bb26e63bea57fc5f5bf6882d74b (patch)
tree9317af4854fd05e326a93ac736160fdc56ddbabc /fs/kernfs/file.c
parentc525aaddc366df23eb095d58a2bdf11cce62a98b (diff)
kernfs: s/sysfs/kernfs/ in constants
kernfs has just been separated out from sysfs and we're already in full conflict mode. Nothing can make the situation any worse. Let's take the chance to name things properly. This patch performs the following renames. * s/SYSFS_DIR/KERNFS_DIR/ * s/SYSFS_KOBJ_ATTR/KERNFS_FILE/ * s/SYSFS_KOBJ_LINK/KERNFS_LINK/ * s/SYSFS_{TYPE_FLAGS}/KERNFS_{TYPE_FLAGS}/ * s/SYSFS_FLAG_{FLAG}/KERNFS_{FLAG}/ * s/sysfs_type()/kernfs_type()/ * s/SD_DEACTIVATED_BIAS/KN_DEACTIVATED_BIAS/ This patch is strictly rename only and doesn't introduce any functional difference. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/kernfs/file.c')
-rw-r--r--fs/kernfs/file.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/fs/kernfs/file.c b/fs/kernfs/file.c
index 2714a394cd81..abe93e12089c 100644
--- a/fs/kernfs/file.c
+++ b/fs/kernfs/file.c
@@ -49,7 +49,7 @@ static struct kernfs_open_file *kernfs_of(struct file *file)
49 */ 49 */
50static const struct kernfs_ops *kernfs_ops(struct kernfs_node *kn) 50static const struct kernfs_ops *kernfs_ops(struct kernfs_node *kn)
51{ 51{
52 if (kn->flags & SYSFS_FLAG_LOCKDEP) 52 if (kn->flags & KERNFS_LOCKDEP)
53 lockdep_assert_held(kn); 53 lockdep_assert_held(kn);
54 return kn->attr.ops; 54 return kn->attr.ops;
55} 55}
@@ -189,7 +189,7 @@ static ssize_t kernfs_file_read(struct file *file, char __user *user_buf,
189{ 189{
190 struct kernfs_open_file *of = kernfs_of(file); 190 struct kernfs_open_file *of = kernfs_of(file);
191 191
192 if (of->kn->flags & SYSFS_FLAG_HAS_SEQ_SHOW) 192 if (of->kn->flags & KERNFS_HAS_SEQ_SHOW)
193 return seq_read(file, user_buf, count, ppos); 193 return seq_read(file, user_buf, count, ppos);
194 else 194 else
195 return kernfs_file_direct_read(of, user_buf, count, ppos); 195 return kernfs_file_direct_read(of, user_buf, count, ppos);
@@ -428,7 +428,7 @@ static int kernfs_file_mmap(struct file *file, struct vm_area_struct *vma)
428 * without grabbing @of->mutex by testing HAS_MMAP flag. See the 428 * without grabbing @of->mutex by testing HAS_MMAP flag. See the
429 * comment in kernfs_file_open() for more details. 429 * comment in kernfs_file_open() for more details.
430 */ 430 */
431 if (!(of->kn->flags & SYSFS_FLAG_HAS_MMAP)) 431 if (!(of->kn->flags & KERNFS_HAS_MMAP))
432 return -ENODEV; 432 return -ENODEV;
433 433
434 mutex_lock(&of->mutex); 434 mutex_lock(&of->mutex);
@@ -668,7 +668,7 @@ void sysfs_unmap_bin_file(struct kernfs_node *kn)
668 struct kernfs_open_node *on; 668 struct kernfs_open_node *on;
669 struct kernfs_open_file *of; 669 struct kernfs_open_file *of;
670 670
671 if (!(kn->flags & SYSFS_FLAG_HAS_MMAP)) 671 if (!(kn->flags & KERNFS_HAS_MMAP))
672 return; 672 return;
673 673
674 spin_lock_irq(&kernfs_open_node_lock); 674 spin_lock_irq(&kernfs_open_node_lock);
@@ -738,7 +738,7 @@ void kernfs_notify(struct kernfs_node *kn)
738 738
739 spin_lock_irqsave(&kernfs_open_node_lock, flags); 739 spin_lock_irqsave(&kernfs_open_node_lock, flags);
740 740
741 if (!WARN_ON(sysfs_type(kn) != SYSFS_KOBJ_ATTR)) { 741 if (!WARN_ON(kernfs_type(kn) != KERNFS_FILE)) {
742 on = kn->attr.open; 742 on = kn->attr.open;
743 if (on) { 743 if (on) {
744 atomic_inc(&on->event); 744 atomic_inc(&on->event);
@@ -785,7 +785,7 @@ struct kernfs_node *kernfs_create_file_ns_key(struct kernfs_node *parent,
785 int rc; 785 int rc;
786 786
787 kn = sysfs_new_dirent(kernfs_root(parent), name, 787 kn = sysfs_new_dirent(kernfs_root(parent), name,
788 (mode & S_IALLUGO) | S_IFREG, SYSFS_KOBJ_ATTR); 788 (mode & S_IALLUGO) | S_IFREG, KERNFS_FILE);
789 if (!kn) 789 if (!kn)
790 return ERR_PTR(-ENOMEM); 790 return ERR_PTR(-ENOMEM);
791 791
@@ -797,7 +797,7 @@ struct kernfs_node *kernfs_create_file_ns_key(struct kernfs_node *parent,
797#ifdef CONFIG_DEBUG_LOCK_ALLOC 797#ifdef CONFIG_DEBUG_LOCK_ALLOC
798 if (key) { 798 if (key) {
799 lockdep_init_map(&kn->dep_map, "s_active", key, 0); 799 lockdep_init_map(&kn->dep_map, "s_active", key, 0);
800 kn->flags |= SYSFS_FLAG_LOCKDEP; 800 kn->flags |= KERNFS_LOCKDEP;
801 } 801 }
802#endif 802#endif
803 803
@@ -807,9 +807,9 @@ struct kernfs_node *kernfs_create_file_ns_key(struct kernfs_node *parent,
807 * ref. Cache their existence in flags. 807 * ref. Cache their existence in flags.
808 */ 808 */
809 if (ops->seq_show) 809 if (ops->seq_show)
810 kn->flags |= SYSFS_FLAG_HAS_SEQ_SHOW; 810 kn->flags |= KERNFS_HAS_SEQ_SHOW;
811 if (ops->mmap) 811 if (ops->mmap)
812 kn->flags |= SYSFS_FLAG_HAS_MMAP; 812 kn->flags |= KERNFS_HAS_MMAP;
813 813
814 sysfs_addrm_start(&acxt); 814 sysfs_addrm_start(&acxt);
815 rc = sysfs_add_one(&acxt, kn, parent); 815 rc = sysfs_add_one(&acxt, kn, parent);