diff options
Diffstat (limited to 'fs/kernfs')
-rw-r--r-- | fs/kernfs/dir.c | 64 | ||||
-rw-r--r-- | fs/kernfs/file.c | 2 | ||||
-rw-r--r-- | fs/kernfs/inode.c | 46 | ||||
-rw-r--r-- | fs/kernfs/kernfs-internal.h | 14 | ||||
-rw-r--r-- | fs/kernfs/mount.c | 14 | ||||
-rw-r--r-- | fs/kernfs/symlink.c | 6 |
6 files changed, 73 insertions, 73 deletions
diff --git a/fs/kernfs/dir.c b/fs/kernfs/dir.c index bc8a3b367a8c..d3c66237474f 100644 --- a/fs/kernfs/dir.c +++ b/fs/kernfs/dir.c | |||
@@ -17,7 +17,7 @@ | |||
17 | 17 | ||
18 | #include "kernfs-internal.h" | 18 | #include "kernfs-internal.h" |
19 | 19 | ||
20 | DEFINE_MUTEX(sysfs_mutex); | 20 | DEFINE_MUTEX(kernfs_mutex); |
21 | 21 | ||
22 | #define rb_to_kn(X) rb_entry((X), struct kernfs_node, rb) | 22 | #define rb_to_kn(X) rb_entry((X), struct kernfs_node, rb) |
23 | 23 | ||
@@ -68,7 +68,7 @@ static int sysfs_sd_compare(const struct kernfs_node *left, | |||
68 | * @kn->parent->dir.children. | 68 | * @kn->parent->dir.children. |
69 | * | 69 | * |
70 | * Locking: | 70 | * Locking: |
71 | * mutex_lock(sysfs_mutex) | 71 | * mutex_lock(kernfs_mutex) |
72 | * | 72 | * |
73 | * RETURNS: | 73 | * RETURNS: |
74 | * 0 on susccess -EEXIST on failure. | 74 | * 0 on susccess -EEXIST on failure. |
@@ -109,7 +109,7 @@ static int sysfs_link_sibling(struct kernfs_node *kn) | |||
109 | * kn->parent->dir.children. | 109 | * kn->parent->dir.children. |
110 | * | 110 | * |
111 | * Locking: | 111 | * Locking: |
112 | * mutex_lock(sysfs_mutex) | 112 | * mutex_lock(kernfs_mutex) |
113 | */ | 113 | */ |
114 | static void sysfs_unlink_sibling(struct kernfs_node *kn) | 114 | static void sysfs_unlink_sibling(struct kernfs_node *kn) |
115 | { | 115 | { |
@@ -251,7 +251,7 @@ void kernfs_put(struct kernfs_node *kn) | |||
251 | } | 251 | } |
252 | kfree(kn->iattr); | 252 | kfree(kn->iattr); |
253 | ida_simple_remove(&root->ino_ida, kn->ino); | 253 | ida_simple_remove(&root->ino_ida, kn->ino); |
254 | kmem_cache_free(sysfs_dir_cachep, kn); | 254 | kmem_cache_free(kernfs_node_cache, kn); |
255 | 255 | ||
256 | kn = parent; | 256 | kn = parent; |
257 | if (kn) { | 257 | if (kn) { |
@@ -279,7 +279,7 @@ static int sysfs_dentry_revalidate(struct dentry *dentry, unsigned int flags) | |||
279 | return -ECHILD; | 279 | return -ECHILD; |
280 | 280 | ||
281 | kn = dentry->d_fsdata; | 281 | kn = dentry->d_fsdata; |
282 | mutex_lock(&sysfs_mutex); | 282 | mutex_lock(&kernfs_mutex); |
283 | 283 | ||
284 | /* The sysfs dirent has been deleted */ | 284 | /* The sysfs dirent has been deleted */ |
285 | if (kn->flags & KERNFS_REMOVED) | 285 | if (kn->flags & KERNFS_REMOVED) |
@@ -298,7 +298,7 @@ static int sysfs_dentry_revalidate(struct dentry *dentry, unsigned int flags) | |||
298 | kernfs_info(dentry->d_sb)->ns != kn->ns) | 298 | kernfs_info(dentry->d_sb)->ns != kn->ns) |
299 | goto out_bad; | 299 | goto out_bad; |
300 | 300 | ||
301 | mutex_unlock(&sysfs_mutex); | 301 | mutex_unlock(&kernfs_mutex); |
302 | out_valid: | 302 | out_valid: |
303 | return 1; | 303 | return 1; |
304 | out_bad: | 304 | out_bad: |
@@ -312,7 +312,7 @@ out_bad: | |||
312 | * is performed at its new name the dentry will be readded | 312 | * is performed at its new name the dentry will be readded |
313 | * to the dcache hashes. | 313 | * to the dcache hashes. |
314 | */ | 314 | */ |
315 | mutex_unlock(&sysfs_mutex); | 315 | mutex_unlock(&kernfs_mutex); |
316 | 316 | ||
317 | /* If we have submounts we must allow the vfs caches | 317 | /* If we have submounts we must allow the vfs caches |
318 | * to lie about the state of the filesystem to prevent | 318 | * to lie about the state of the filesystem to prevent |
@@ -329,7 +329,7 @@ static void sysfs_dentry_release(struct dentry *dentry) | |||
329 | kernfs_put(dentry->d_fsdata); | 329 | kernfs_put(dentry->d_fsdata); |
330 | } | 330 | } |
331 | 331 | ||
332 | const struct dentry_operations sysfs_dentry_ops = { | 332 | const struct dentry_operations kernfs_dops = { |
333 | .d_revalidate = sysfs_dentry_revalidate, | 333 | .d_revalidate = sysfs_dentry_revalidate, |
334 | .d_delete = sysfs_dentry_delete, | 334 | .d_delete = sysfs_dentry_delete, |
335 | .d_release = sysfs_dentry_release, | 335 | .d_release = sysfs_dentry_release, |
@@ -348,7 +348,7 @@ struct kernfs_node *sysfs_new_dirent(struct kernfs_root *root, | |||
348 | return NULL; | 348 | return NULL; |
349 | } | 349 | } |
350 | 350 | ||
351 | kn = kmem_cache_zalloc(sysfs_dir_cachep, GFP_KERNEL); | 351 | kn = kmem_cache_zalloc(kernfs_node_cache, GFP_KERNEL); |
352 | if (!kn) | 352 | if (!kn) |
353 | goto err_out1; | 353 | goto err_out1; |
354 | 354 | ||
@@ -367,7 +367,7 @@ struct kernfs_node *sysfs_new_dirent(struct kernfs_root *root, | |||
367 | return kn; | 367 | return kn; |
368 | 368 | ||
369 | err_out2: | 369 | err_out2: |
370 | kmem_cache_free(sysfs_dir_cachep, kn); | 370 | kmem_cache_free(kernfs_node_cache, kn); |
371 | err_out1: | 371 | err_out1: |
372 | kfree(dup_name); | 372 | kfree(dup_name); |
373 | return NULL; | 373 | return NULL; |
@@ -378,19 +378,19 @@ struct kernfs_node *sysfs_new_dirent(struct kernfs_root *root, | |||
378 | * @acxt: pointer to kernfs_addrm_cxt to be used | 378 | * @acxt: pointer to kernfs_addrm_cxt to be used |
379 | * | 379 | * |
380 | * This function is called when the caller is about to add or remove | 380 | * This function is called when the caller is about to add or remove |
381 | * kernfs_node. This function acquires sysfs_mutex. @acxt is used to | 381 | * kernfs_node. This function acquires kernfs_mutex. @acxt is used |
382 | * keep and pass context to other addrm functions. | 382 | * to keep and pass context to other addrm functions. |
383 | * | 383 | * |
384 | * LOCKING: | 384 | * LOCKING: |
385 | * Kernel thread context (may sleep). sysfs_mutex is locked on | 385 | * Kernel thread context (may sleep). kernfs_mutex is locked on |
386 | * return. | 386 | * return. |
387 | */ | 387 | */ |
388 | void sysfs_addrm_start(struct kernfs_addrm_cxt *acxt) | 388 | void sysfs_addrm_start(struct kernfs_addrm_cxt *acxt) |
389 | __acquires(sysfs_mutex) | 389 | __acquires(kernfs_mutex) |
390 | { | 390 | { |
391 | memset(acxt, 0, sizeof(*acxt)); | 391 | memset(acxt, 0, sizeof(*acxt)); |
392 | 392 | ||
393 | mutex_lock(&sysfs_mutex); | 393 | mutex_lock(&kernfs_mutex); |
394 | } | 394 | } |
395 | 395 | ||
396 | /** | 396 | /** |
@@ -503,13 +503,13 @@ static void sysfs_remove_one(struct kernfs_addrm_cxt *acxt, | |||
503 | * cleaned up. | 503 | * cleaned up. |
504 | * | 504 | * |
505 | * LOCKING: | 505 | * LOCKING: |
506 | * sysfs_mutex is released. | 506 | * kernfs_mutex is released. |
507 | */ | 507 | */ |
508 | void sysfs_addrm_finish(struct kernfs_addrm_cxt *acxt) | 508 | void sysfs_addrm_finish(struct kernfs_addrm_cxt *acxt) |
509 | __releases(sysfs_mutex) | 509 | __releases(kernfs_mutex) |
510 | { | 510 | { |
511 | /* release resources acquired by sysfs_addrm_start() */ | 511 | /* release resources acquired by sysfs_addrm_start() */ |
512 | mutex_unlock(&sysfs_mutex); | 512 | mutex_unlock(&kernfs_mutex); |
513 | 513 | ||
514 | /* kill removed kernfs_nodes */ | 514 | /* kill removed kernfs_nodes */ |
515 | while (acxt->removed) { | 515 | while (acxt->removed) { |
@@ -540,7 +540,7 @@ static struct kernfs_node *kernfs_find_ns(struct kernfs_node *parent, | |||
540 | bool has_ns = kernfs_ns_enabled(parent); | 540 | bool has_ns = kernfs_ns_enabled(parent); |
541 | unsigned int hash; | 541 | unsigned int hash; |
542 | 542 | ||
543 | lockdep_assert_held(&sysfs_mutex); | 543 | lockdep_assert_held(&kernfs_mutex); |
544 | 544 | ||
545 | if (has_ns != (bool)ns) { | 545 | if (has_ns != (bool)ns) { |
546 | WARN(1, KERN_WARNING "sysfs: ns %s in '%s' for '%s'\n", | 546 | WARN(1, KERN_WARNING "sysfs: ns %s in '%s' for '%s'\n", |
@@ -580,10 +580,10 @@ struct kernfs_node *kernfs_find_and_get_ns(struct kernfs_node *parent, | |||
580 | { | 580 | { |
581 | struct kernfs_node *kn; | 581 | struct kernfs_node *kn; |
582 | 582 | ||
583 | mutex_lock(&sysfs_mutex); | 583 | mutex_lock(&kernfs_mutex); |
584 | kn = kernfs_find_ns(parent, name, ns); | 584 | kn = kernfs_find_ns(parent, name, ns); |
585 | kernfs_get(kn); | 585 | kernfs_get(kn); |
586 | mutex_unlock(&sysfs_mutex); | 586 | mutex_unlock(&kernfs_mutex); |
587 | 587 | ||
588 | return kn; | 588 | return kn; |
589 | } | 589 | } |
@@ -683,7 +683,7 @@ static struct dentry *sysfs_lookup(struct inode *dir, struct dentry *dentry, | |||
683 | struct inode *inode; | 683 | struct inode *inode; |
684 | const void *ns = NULL; | 684 | const void *ns = NULL; |
685 | 685 | ||
686 | mutex_lock(&sysfs_mutex); | 686 | mutex_lock(&kernfs_mutex); |
687 | 687 | ||
688 | if (kernfs_ns_enabled(parent)) | 688 | if (kernfs_ns_enabled(parent)) |
689 | ns = kernfs_info(dir->i_sb)->ns; | 689 | ns = kernfs_info(dir->i_sb)->ns; |
@@ -708,11 +708,11 @@ static struct dentry *sysfs_lookup(struct inode *dir, struct dentry *dentry, | |||
708 | /* instantiate and hash dentry */ | 708 | /* instantiate and hash dentry */ |
709 | ret = d_materialise_unique(dentry, inode); | 709 | ret = d_materialise_unique(dentry, inode); |
710 | out_unlock: | 710 | out_unlock: |
711 | mutex_unlock(&sysfs_mutex); | 711 | mutex_unlock(&kernfs_mutex); |
712 | return ret; | 712 | return ret; |
713 | } | 713 | } |
714 | 714 | ||
715 | const struct inode_operations sysfs_dir_inode_operations = { | 715 | const struct inode_operations kernfs_dir_iops = { |
716 | .lookup = sysfs_lookup, | 716 | .lookup = sysfs_lookup, |
717 | .permission = sysfs_permission, | 717 | .permission = sysfs_permission, |
718 | .setattr = sysfs_setattr, | 718 | .setattr = sysfs_setattr, |
@@ -759,7 +759,7 @@ static struct kernfs_node *sysfs_next_descendant_post(struct kernfs_node *pos, | |||
759 | { | 759 | { |
760 | struct rb_node *rbn; | 760 | struct rb_node *rbn; |
761 | 761 | ||
762 | lockdep_assert_held(&sysfs_mutex); | 762 | lockdep_assert_held(&kernfs_mutex); |
763 | 763 | ||
764 | /* if first iteration, visit leftmost descendant which may be root */ | 764 | /* if first iteration, visit leftmost descendant which may be root */ |
765 | if (!pos) | 765 | if (!pos) |
@@ -859,7 +859,7 @@ int kernfs_rename_ns(struct kernfs_node *kn, struct kernfs_node *new_parent, | |||
859 | { | 859 | { |
860 | int error; | 860 | int error; |
861 | 861 | ||
862 | mutex_lock(&sysfs_mutex); | 862 | mutex_lock(&kernfs_mutex); |
863 | 863 | ||
864 | error = 0; | 864 | error = 0; |
865 | if ((kn->parent == new_parent) && (kn->ns == new_ns) && | 865 | if ((kn->parent == new_parent) && (kn->ns == new_ns) && |
@@ -894,7 +894,7 @@ int kernfs_rename_ns(struct kernfs_node *kn, struct kernfs_node *new_parent, | |||
894 | 894 | ||
895 | error = 0; | 895 | error = 0; |
896 | out: | 896 | out: |
897 | mutex_unlock(&sysfs_mutex); | 897 | mutex_unlock(&kernfs_mutex); |
898 | return error; | 898 | return error; |
899 | } | 899 | } |
900 | 900 | ||
@@ -968,7 +968,7 @@ static int sysfs_readdir(struct file *file, struct dir_context *ctx) | |||
968 | 968 | ||
969 | if (!dir_emit_dots(file, ctx)) | 969 | if (!dir_emit_dots(file, ctx)) |
970 | return 0; | 970 | return 0; |
971 | mutex_lock(&sysfs_mutex); | 971 | mutex_lock(&kernfs_mutex); |
972 | 972 | ||
973 | if (kernfs_ns_enabled(parent)) | 973 | if (kernfs_ns_enabled(parent)) |
974 | ns = kernfs_info(dentry->d_sb)->ns; | 974 | ns = kernfs_info(dentry->d_sb)->ns; |
@@ -985,12 +985,12 @@ static int sysfs_readdir(struct file *file, struct dir_context *ctx) | |||
985 | file->private_data = pos; | 985 | file->private_data = pos; |
986 | kernfs_get(pos); | 986 | kernfs_get(pos); |
987 | 987 | ||
988 | mutex_unlock(&sysfs_mutex); | 988 | mutex_unlock(&kernfs_mutex); |
989 | if (!dir_emit(ctx, name, len, ino, type)) | 989 | if (!dir_emit(ctx, name, len, ino, type)) |
990 | return 0; | 990 | return 0; |
991 | mutex_lock(&sysfs_mutex); | 991 | mutex_lock(&kernfs_mutex); |
992 | } | 992 | } |
993 | mutex_unlock(&sysfs_mutex); | 993 | mutex_unlock(&kernfs_mutex); |
994 | file->private_data = NULL; | 994 | file->private_data = NULL; |
995 | ctx->pos = INT_MAX; | 995 | ctx->pos = INT_MAX; |
996 | return 0; | 996 | return 0; |
@@ -1008,7 +1008,7 @@ static loff_t sysfs_dir_llseek(struct file *file, loff_t offset, int whence) | |||
1008 | return ret; | 1008 | return ret; |
1009 | } | 1009 | } |
1010 | 1010 | ||
1011 | const struct file_operations sysfs_dir_operations = { | 1011 | const struct file_operations kernfs_dir_fops = { |
1012 | .read = generic_read_dir, | 1012 | .read = generic_read_dir, |
1013 | .iterate = sysfs_readdir, | 1013 | .iterate = sysfs_readdir, |
1014 | .release = sysfs_dir_release, | 1014 | .release = sysfs_dir_release, |
diff --git a/fs/kernfs/file.c b/fs/kernfs/file.c index abe93e12089c..32364ddb24de 100644 --- a/fs/kernfs/file.c +++ b/fs/kernfs/file.c | |||
@@ -750,7 +750,7 @@ void kernfs_notify(struct kernfs_node *kn) | |||
750 | } | 750 | } |
751 | EXPORT_SYMBOL_GPL(kernfs_notify); | 751 | EXPORT_SYMBOL_GPL(kernfs_notify); |
752 | 752 | ||
753 | const struct file_operations kernfs_file_operations = { | 753 | const struct file_operations kernfs_file_fops = { |
754 | .read = kernfs_file_read, | 754 | .read = kernfs_file_read, |
755 | .write = kernfs_file_write, | 755 | .write = kernfs_file_write, |
756 | .llseek = generic_file_llseek, | 756 | .llseek = generic_file_llseek, |
diff --git a/fs/kernfs/inode.c b/fs/kernfs/inode.c index af92638d792b..c5f231e8d36d 100644 --- a/fs/kernfs/inode.c +++ b/fs/kernfs/inode.c | |||
@@ -18,19 +18,19 @@ | |||
18 | 18 | ||
19 | #include "kernfs-internal.h" | 19 | #include "kernfs-internal.h" |
20 | 20 | ||
21 | static const struct address_space_operations sysfs_aops = { | 21 | static const struct address_space_operations kernfs_aops = { |
22 | .readpage = simple_readpage, | 22 | .readpage = simple_readpage, |
23 | .write_begin = simple_write_begin, | 23 | .write_begin = simple_write_begin, |
24 | .write_end = simple_write_end, | 24 | .write_end = simple_write_end, |
25 | }; | 25 | }; |
26 | 26 | ||
27 | static struct backing_dev_info sysfs_backing_dev_info = { | 27 | static struct backing_dev_info kernfs_bdi = { |
28 | .name = "sysfs", | 28 | .name = "kernfs", |
29 | .ra_pages = 0, /* No readahead */ | 29 | .ra_pages = 0, /* No readahead */ |
30 | .capabilities = BDI_CAP_NO_ACCT_AND_WRITEBACK, | 30 | .capabilities = BDI_CAP_NO_ACCT_AND_WRITEBACK, |
31 | }; | 31 | }; |
32 | 32 | ||
33 | static const struct inode_operations sysfs_inode_operations = { | 33 | static const struct inode_operations kernfs_iops = { |
34 | .permission = sysfs_permission, | 34 | .permission = sysfs_permission, |
35 | .setattr = sysfs_setattr, | 35 | .setattr = sysfs_setattr, |
36 | .getattr = sysfs_getattr, | 36 | .getattr = sysfs_getattr, |
@@ -42,8 +42,8 @@ static const struct inode_operations sysfs_inode_operations = { | |||
42 | 42 | ||
43 | void __init sysfs_inode_init(void) | 43 | void __init sysfs_inode_init(void) |
44 | { | 44 | { |
45 | if (bdi_init(&sysfs_backing_dev_info)) | 45 | if (bdi_init(&kernfs_bdi)) |
46 | panic("failed to init sysfs_backing_dev_info"); | 46 | panic("failed to init kernfs_bdi"); |
47 | } | 47 | } |
48 | 48 | ||
49 | static struct kernfs_iattrs *kernfs_iattrs(struct kernfs_node *kn) | 49 | static struct kernfs_iattrs *kernfs_iattrs(struct kernfs_node *kn) |
@@ -109,9 +109,9 @@ int kernfs_setattr(struct kernfs_node *kn, const struct iattr *iattr) | |||
109 | { | 109 | { |
110 | int ret; | 110 | int ret; |
111 | 111 | ||
112 | mutex_lock(&sysfs_mutex); | 112 | mutex_lock(&kernfs_mutex); |
113 | ret = __kernfs_setattr(kn, iattr); | 113 | ret = __kernfs_setattr(kn, iattr); |
114 | mutex_unlock(&sysfs_mutex); | 114 | mutex_unlock(&kernfs_mutex); |
115 | return ret; | 115 | return ret; |
116 | } | 116 | } |
117 | 117 | ||
@@ -124,7 +124,7 @@ int sysfs_setattr(struct dentry *dentry, struct iattr *iattr) | |||
124 | if (!kn) | 124 | if (!kn) |
125 | return -EINVAL; | 125 | return -EINVAL; |
126 | 126 | ||
127 | mutex_lock(&sysfs_mutex); | 127 | mutex_lock(&kernfs_mutex); |
128 | error = inode_change_ok(inode, iattr); | 128 | error = inode_change_ok(inode, iattr); |
129 | if (error) | 129 | if (error) |
130 | goto out; | 130 | goto out; |
@@ -137,7 +137,7 @@ int sysfs_setattr(struct dentry *dentry, struct iattr *iattr) | |||
137 | setattr_copy(inode, iattr); | 137 | setattr_copy(inode, iattr); |
138 | 138 | ||
139 | out: | 139 | out: |
140 | mutex_unlock(&sysfs_mutex); | 140 | mutex_unlock(&kernfs_mutex); |
141 | return error; | 141 | return error; |
142 | } | 142 | } |
143 | 143 | ||
@@ -187,9 +187,9 @@ int sysfs_setxattr(struct dentry *dentry, const char *name, const void *value, | |||
187 | if (error) | 187 | if (error) |
188 | return error; | 188 | return error; |
189 | 189 | ||
190 | mutex_lock(&sysfs_mutex); | 190 | mutex_lock(&kernfs_mutex); |
191 | error = sysfs_sd_setsecdata(kn, &secdata, &secdata_len); | 191 | error = sysfs_sd_setsecdata(kn, &secdata, &secdata_len); |
192 | mutex_unlock(&sysfs_mutex); | 192 | mutex_unlock(&kernfs_mutex); |
193 | 193 | ||
194 | if (secdata) | 194 | if (secdata) |
195 | security_release_secctx(secdata, secdata_len); | 195 | security_release_secctx(secdata, secdata_len); |
@@ -279,9 +279,9 @@ int sysfs_getattr(struct vfsmount *mnt, struct dentry *dentry, | |||
279 | struct kernfs_node *kn = dentry->d_fsdata; | 279 | struct kernfs_node *kn = dentry->d_fsdata; |
280 | struct inode *inode = dentry->d_inode; | 280 | struct inode *inode = dentry->d_inode; |
281 | 281 | ||
282 | mutex_lock(&sysfs_mutex); | 282 | mutex_lock(&kernfs_mutex); |
283 | sysfs_refresh_inode(kn, inode); | 283 | sysfs_refresh_inode(kn, inode); |
284 | mutex_unlock(&sysfs_mutex); | 284 | mutex_unlock(&kernfs_mutex); |
285 | 285 | ||
286 | generic_fillattr(inode, stat); | 286 | generic_fillattr(inode, stat); |
287 | return 0; | 287 | return 0; |
@@ -291,9 +291,9 @@ static void sysfs_init_inode(struct kernfs_node *kn, struct inode *inode) | |||
291 | { | 291 | { |
292 | kernfs_get(kn); | 292 | kernfs_get(kn); |
293 | inode->i_private = kn; | 293 | inode->i_private = kn; |
294 | inode->i_mapping->a_ops = &sysfs_aops; | 294 | inode->i_mapping->a_ops = &kernfs_aops; |
295 | inode->i_mapping->backing_dev_info = &sysfs_backing_dev_info; | 295 | inode->i_mapping->backing_dev_info = &kernfs_bdi; |
296 | inode->i_op = &sysfs_inode_operations; | 296 | inode->i_op = &kernfs_iops; |
297 | 297 | ||
298 | set_default_inode_attr(inode, kn->mode); | 298 | set_default_inode_attr(inode, kn->mode); |
299 | sysfs_refresh_inode(kn, inode); | 299 | sysfs_refresh_inode(kn, inode); |
@@ -301,15 +301,15 @@ static void sysfs_init_inode(struct kernfs_node *kn, struct inode *inode) | |||
301 | /* initialize inode according to type */ | 301 | /* initialize inode according to type */ |
302 | switch (kernfs_type(kn)) { | 302 | switch (kernfs_type(kn)) { |
303 | case KERNFS_DIR: | 303 | case KERNFS_DIR: |
304 | inode->i_op = &sysfs_dir_inode_operations; | 304 | inode->i_op = &kernfs_dir_iops; |
305 | inode->i_fop = &sysfs_dir_operations; | 305 | inode->i_fop = &kernfs_dir_fops; |
306 | break; | 306 | break; |
307 | case KERNFS_FILE: | 307 | case KERNFS_FILE: |
308 | inode->i_size = kn->attr.size; | 308 | inode->i_size = kn->attr.size; |
309 | inode->i_fop = &kernfs_file_operations; | 309 | inode->i_fop = &kernfs_file_fops; |
310 | break; | 310 | break; |
311 | case KERNFS_LINK: | 311 | case KERNFS_LINK: |
312 | inode->i_op = &sysfs_symlink_inode_operations; | 312 | inode->i_op = &kernfs_symlink_iops; |
313 | break; | 313 | break; |
314 | default: | 314 | default: |
315 | BUG(); | 315 | BUG(); |
@@ -369,9 +369,9 @@ int sysfs_permission(struct inode *inode, int mask) | |||
369 | 369 | ||
370 | kn = inode->i_private; | 370 | kn = inode->i_private; |
371 | 371 | ||
372 | mutex_lock(&sysfs_mutex); | 372 | mutex_lock(&kernfs_mutex); |
373 | sysfs_refresh_inode(kn, inode); | 373 | sysfs_refresh_inode(kn, inode); |
374 | mutex_unlock(&sysfs_mutex); | 374 | mutex_unlock(&kernfs_mutex); |
375 | 375 | ||
376 | return generic_permission(inode, mask); | 376 | return generic_permission(inode, mask); |
377 | } | 377 | } |
diff --git a/fs/kernfs/kernfs-internal.h b/fs/kernfs/kernfs-internal.h index c4bf5bf72f78..e62e8ec15d65 100644 --- a/fs/kernfs/kernfs-internal.h +++ b/fs/kernfs/kernfs-internal.h | |||
@@ -71,7 +71,7 @@ struct kernfs_super_info { | |||
71 | }; | 71 | }; |
72 | #define kernfs_info(SB) ((struct kernfs_super_info *)(SB->s_fs_info)) | 72 | #define kernfs_info(SB) ((struct kernfs_super_info *)(SB->s_fs_info)) |
73 | 73 | ||
74 | extern struct kmem_cache *sysfs_dir_cachep; | 74 | extern struct kmem_cache *kernfs_node_cache; |
75 | 75 | ||
76 | /* | 76 | /* |
77 | * inode.c | 77 | * inode.c |
@@ -93,10 +93,10 @@ void sysfs_inode_init(void); | |||
93 | /* | 93 | /* |
94 | * dir.c | 94 | * dir.c |
95 | */ | 95 | */ |
96 | extern struct mutex sysfs_mutex; | 96 | extern struct mutex kernfs_mutex; |
97 | extern const struct dentry_operations sysfs_dentry_ops; | 97 | extern const struct dentry_operations kernfs_dops; |
98 | extern const struct file_operations sysfs_dir_operations; | 98 | extern const struct file_operations kernfs_dir_fops; |
99 | extern const struct inode_operations sysfs_dir_inode_operations; | 99 | extern const struct inode_operations kernfs_dir_iops; |
100 | 100 | ||
101 | struct kernfs_node *sysfs_get_active(struct kernfs_node *kn); | 101 | struct kernfs_node *sysfs_get_active(struct kernfs_node *kn); |
102 | void sysfs_put_active(struct kernfs_node *kn); | 102 | void sysfs_put_active(struct kernfs_node *kn); |
@@ -110,13 +110,13 @@ struct kernfs_node *sysfs_new_dirent(struct kernfs_root *root, | |||
110 | /* | 110 | /* |
111 | * file.c | 111 | * file.c |
112 | */ | 112 | */ |
113 | extern const struct file_operations kernfs_file_operations; | 113 | extern const struct file_operations kernfs_file_fops; |
114 | 114 | ||
115 | void sysfs_unmap_bin_file(struct kernfs_node *kn); | 115 | void sysfs_unmap_bin_file(struct kernfs_node *kn); |
116 | 116 | ||
117 | /* | 117 | /* |
118 | * symlink.c | 118 | * symlink.c |
119 | */ | 119 | */ |
120 | extern const struct inode_operations sysfs_symlink_inode_operations; | 120 | extern const struct inode_operations kernfs_symlink_iops; |
121 | 121 | ||
122 | #endif /* __KERNFS_INTERNAL_H */ | 122 | #endif /* __KERNFS_INTERNAL_H */ |
diff --git a/fs/kernfs/mount.c b/fs/kernfs/mount.c index e0796dcb6065..27d967ba0bb9 100644 --- a/fs/kernfs/mount.c +++ b/fs/kernfs/mount.c | |||
@@ -17,9 +17,9 @@ | |||
17 | 17 | ||
18 | #include "kernfs-internal.h" | 18 | #include "kernfs-internal.h" |
19 | 19 | ||
20 | struct kmem_cache *sysfs_dir_cachep; | 20 | struct kmem_cache *kernfs_node_cache; |
21 | 21 | ||
22 | static const struct super_operations sysfs_ops = { | 22 | static const struct super_operations kernfs_sops = { |
23 | .statfs = simple_statfs, | 23 | .statfs = simple_statfs, |
24 | .drop_inode = generic_delete_inode, | 24 | .drop_inode = generic_delete_inode, |
25 | .evict_inode = sysfs_evict_inode, | 25 | .evict_inode = sysfs_evict_inode, |
@@ -34,13 +34,13 @@ static int sysfs_fill_super(struct super_block *sb) | |||
34 | sb->s_blocksize = PAGE_CACHE_SIZE; | 34 | sb->s_blocksize = PAGE_CACHE_SIZE; |
35 | sb->s_blocksize_bits = PAGE_CACHE_SHIFT; | 35 | sb->s_blocksize_bits = PAGE_CACHE_SHIFT; |
36 | sb->s_magic = SYSFS_MAGIC; | 36 | sb->s_magic = SYSFS_MAGIC; |
37 | sb->s_op = &sysfs_ops; | 37 | sb->s_op = &kernfs_sops; |
38 | sb->s_time_gran = 1; | 38 | sb->s_time_gran = 1; |
39 | 39 | ||
40 | /* get root inode, initialize and unlock it */ | 40 | /* get root inode, initialize and unlock it */ |
41 | mutex_lock(&sysfs_mutex); | 41 | mutex_lock(&kernfs_mutex); |
42 | inode = sysfs_get_inode(sb, info->root->kn); | 42 | inode = sysfs_get_inode(sb, info->root->kn); |
43 | mutex_unlock(&sysfs_mutex); | 43 | mutex_unlock(&kernfs_mutex); |
44 | if (!inode) { | 44 | if (!inode) { |
45 | pr_debug("sysfs: could not get root inode\n"); | 45 | pr_debug("sysfs: could not get root inode\n"); |
46 | return -ENOMEM; | 46 | return -ENOMEM; |
@@ -55,7 +55,7 @@ static int sysfs_fill_super(struct super_block *sb) | |||
55 | kernfs_get(info->root->kn); | 55 | kernfs_get(info->root->kn); |
56 | root->d_fsdata = info->root->kn; | 56 | root->d_fsdata = info->root->kn; |
57 | sb->s_root = root; | 57 | sb->s_root = root; |
58 | sb->s_d_op = &sysfs_dentry_ops; | 58 | sb->s_d_op = &kernfs_dops; |
59 | return 0; | 59 | return 0; |
60 | } | 60 | } |
61 | 61 | ||
@@ -158,7 +158,7 @@ void kernfs_kill_sb(struct super_block *sb) | |||
158 | 158 | ||
159 | void __init kernfs_init(void) | 159 | void __init kernfs_init(void) |
160 | { | 160 | { |
161 | sysfs_dir_cachep = kmem_cache_create("sysfs_dir_cache", | 161 | kernfs_node_cache = kmem_cache_create("kernfs_node_cache", |
162 | sizeof(struct kernfs_node), | 162 | sizeof(struct kernfs_node), |
163 | 0, SLAB_PANIC, NULL); | 163 | 0, SLAB_PANIC, NULL); |
164 | sysfs_inode_init(); | 164 | sysfs_inode_init(); |
diff --git a/fs/kernfs/symlink.c b/fs/kernfs/symlink.c index a92284d3c73d..4105bd04ea2f 100644 --- a/fs/kernfs/symlink.c +++ b/fs/kernfs/symlink.c | |||
@@ -110,9 +110,9 @@ static int sysfs_getlink(struct dentry *dentry, char *path) | |||
110 | struct kernfs_node *target = kn->symlink.target_kn; | 110 | struct kernfs_node *target = kn->symlink.target_kn; |
111 | int error; | 111 | int error; |
112 | 112 | ||
113 | mutex_lock(&sysfs_mutex); | 113 | mutex_lock(&kernfs_mutex); |
114 | error = sysfs_get_target_path(parent, target, path); | 114 | error = sysfs_get_target_path(parent, target, path); |
115 | mutex_unlock(&sysfs_mutex); | 115 | mutex_unlock(&kernfs_mutex); |
116 | 116 | ||
117 | return error; | 117 | return error; |
118 | } | 118 | } |
@@ -138,7 +138,7 @@ static void sysfs_put_link(struct dentry *dentry, struct nameidata *nd, | |||
138 | free_page((unsigned long)page); | 138 | free_page((unsigned long)page); |
139 | } | 139 | } |
140 | 140 | ||
141 | const struct inode_operations sysfs_symlink_inode_operations = { | 141 | const struct inode_operations kernfs_symlink_iops = { |
142 | .setxattr = sysfs_setxattr, | 142 | .setxattr = sysfs_setxattr, |
143 | .removexattr = sysfs_removexattr, | 143 | .removexattr = sysfs_removexattr, |
144 | .getxattr = sysfs_getxattr, | 144 | .getxattr = sysfs_getxattr, |