.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
---|
1 | 2 | /* -*- mode: c; c-basic-offset:8; -*- |
---|
2 | 3 | * vim: noexpandtab sw=8 ts=8 sts=0: |
---|
3 | 4 | * |
---|
4 | 5 | * configfs_internal.h - Internal stuff for configfs |
---|
5 | | - * |
---|
6 | | - * This program is free software; you can redistribute it and/or |
---|
7 | | - * modify it under the terms of the GNU General Public |
---|
8 | | - * License as published by the Free Software Foundation; either |
---|
9 | | - * version 2 of the License, or (at your option) any later version. |
---|
10 | | - * |
---|
11 | | - * This program is distributed in the hope that it will be useful, |
---|
12 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
13 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
14 | | - * General Public License for more details. |
---|
15 | | - * |
---|
16 | | - * You should have received a copy of the GNU General Public |
---|
17 | | - * License along with this program; if not, write to the |
---|
18 | | - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
---|
19 | | - * Boston, MA 021110-1307, USA. |
---|
20 | 6 | * |
---|
21 | 7 | * Based on sysfs: |
---|
22 | 8 | * sysfs is Copyright (C) 2001, 2002, 2003 Patrick Mochel |
---|
.. | .. |
---|
48 | 34 | int s_dependent_count; |
---|
49 | 35 | struct list_head s_sibling; |
---|
50 | 36 | struct list_head s_children; |
---|
51 | | - struct list_head s_links; |
---|
| 37 | + int s_links; |
---|
52 | 38 | void * s_element; |
---|
53 | 39 | int s_type; |
---|
54 | 40 | umode_t s_mode; |
---|
.. | .. |
---|
80 | 66 | extern int configfs_is_root(struct config_item *item); |
---|
81 | 67 | |
---|
82 | 68 | extern struct inode * configfs_new_inode(umode_t mode, struct configfs_dirent *, struct super_block *); |
---|
83 | | -extern int configfs_create(struct dentry *, umode_t mode, void (*init)(struct inode *)); |
---|
| 69 | +extern struct inode *configfs_create(struct dentry *, umode_t mode); |
---|
84 | 70 | |
---|
85 | 71 | extern int configfs_create_file(struct config_item *, const struct configfs_attribute *); |
---|
86 | 72 | extern int configfs_create_bin_file(struct config_item *, |
---|
.. | .. |
---|
98 | 84 | extern struct dentry *configfs_pin_fs(void); |
---|
99 | 85 | extern void configfs_release_fs(void); |
---|
100 | 86 | |
---|
101 | | -extern struct rw_semaphore configfs_rename_sem; |
---|
102 | 87 | extern const struct file_operations configfs_dir_operations; |
---|
103 | 88 | extern const struct file_operations configfs_file_operations; |
---|
104 | 89 | extern const struct file_operations configfs_bin_file_operations; |
---|
.. | .. |
---|
111 | 96 | const char *symname); |
---|
112 | 97 | extern int configfs_unlink(struct inode *dir, struct dentry *dentry); |
---|
113 | 98 | |
---|
114 | | -struct configfs_symlink { |
---|
115 | | - struct list_head sl_list; |
---|
116 | | - struct config_item *sl_target; |
---|
117 | | -}; |
---|
118 | | - |
---|
119 | | -extern int configfs_create_link(struct configfs_symlink *sl, |
---|
120 | | - struct dentry *parent, |
---|
121 | | - struct dentry *dentry); |
---|
| 99 | +int configfs_create_link(struct configfs_dirent *target, struct dentry *parent, |
---|
| 100 | + struct dentry *dentry, char *body); |
---|
122 | 101 | |
---|
123 | 102 | static inline struct config_item * to_item(struct dentry * dentry) |
---|
124 | 103 | { |
---|
.. | .. |
---|
146 | 125 | spin_lock(&dentry->d_lock); |
---|
147 | 126 | if (!d_unhashed(dentry)) { |
---|
148 | 127 | struct configfs_dirent * sd = dentry->d_fsdata; |
---|
149 | | - if (sd->s_type & CONFIGFS_ITEM_LINK) { |
---|
150 | | - struct configfs_symlink * sl = sd->s_element; |
---|
151 | | - item = config_item_get(sl->sl_target); |
---|
152 | | - } else |
---|
153 | | - item = config_item_get(sd->s_element); |
---|
| 128 | + item = config_item_get(sd->s_element); |
---|
154 | 129 | } |
---|
155 | 130 | spin_unlock(&dentry->d_lock); |
---|
156 | 131 | |
---|