diff options
Diffstat (limited to 'kernel/bpf/inode.c')
-rw-r--r-- | kernel/bpf/inode.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/kernel/bpf/inode.c b/kernel/bpf/inode.c index 2ada5e21dfa6..bc53e5b20ddc 100644 --- a/kernel/bpf/inode.c +++ b/kernel/bpf/inode.c | |||
@@ -554,19 +554,6 @@ struct bpf_prog *bpf_prog_get_type_path(const char *name, enum bpf_prog_type typ | |||
554 | } | 554 | } |
555 | EXPORT_SYMBOL(bpf_prog_get_type_path); | 555 | EXPORT_SYMBOL(bpf_prog_get_type_path); |
556 | 556 | ||
557 | static void bpf_evict_inode(struct inode *inode) | ||
558 | { | ||
559 | enum bpf_type type; | ||
560 | |||
561 | truncate_inode_pages_final(&inode->i_data); | ||
562 | clear_inode(inode); | ||
563 | |||
564 | if (S_ISLNK(inode->i_mode)) | ||
565 | kfree(inode->i_link); | ||
566 | if (!bpf_inode_type(inode, &type)) | ||
567 | bpf_any_put(inode->i_private, type); | ||
568 | } | ||
569 | |||
570 | /* | 557 | /* |
571 | * Display the mount options in /proc/mounts. | 558 | * Display the mount options in /proc/mounts. |
572 | */ | 559 | */ |
@@ -579,11 +566,22 @@ static int bpf_show_options(struct seq_file *m, struct dentry *root) | |||
579 | return 0; | 566 | return 0; |
580 | } | 567 | } |
581 | 568 | ||
569 | static void bpf_free_inode(struct inode *inode) | ||
570 | { | ||
571 | enum bpf_type type; | ||
572 | |||
573 | if (S_ISLNK(inode->i_mode)) | ||
574 | kfree(inode->i_link); | ||
575 | if (!bpf_inode_type(inode, &type)) | ||
576 | bpf_any_put(inode->i_private, type); | ||
577 | free_inode_nonrcu(inode); | ||
578 | } | ||
579 | |||
582 | static const struct super_operations bpf_super_ops = { | 580 | static const struct super_operations bpf_super_ops = { |
583 | .statfs = simple_statfs, | 581 | .statfs = simple_statfs, |
584 | .drop_inode = generic_delete_inode, | 582 | .drop_inode = generic_delete_inode, |
585 | .show_options = bpf_show_options, | 583 | .show_options = bpf_show_options, |
586 | .evict_inode = bpf_evict_inode, | 584 | .free_inode = bpf_free_inode, |
587 | }; | 585 | }; |
588 | 586 | ||
589 | enum { | 587 | enum { |