hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/fs/configfs/configfs_internal.h
....@@ -1,22 +1,8 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /* -*- mode: c; c-basic-offset:8; -*-
23 * vim: noexpandtab sw=8 ts=8 sts=0:
34 *
45 * 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.
206 *
217 * Based on sysfs:
228 * sysfs is Copyright (C) 2001, 2002, 2003 Patrick Mochel
....@@ -48,7 +34,7 @@
4834 int s_dependent_count;
4935 struct list_head s_sibling;
5036 struct list_head s_children;
51
- struct list_head s_links;
37
+ int s_links;
5238 void * s_element;
5339 int s_type;
5440 umode_t s_mode;
....@@ -80,7 +66,7 @@
8066 extern int configfs_is_root(struct config_item *item);
8167
8268 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);
8470
8571 extern int configfs_create_file(struct config_item *, const struct configfs_attribute *);
8672 extern int configfs_create_bin_file(struct config_item *,
....@@ -98,7 +84,6 @@
9884 extern struct dentry *configfs_pin_fs(void);
9985 extern void configfs_release_fs(void);
10086
101
-extern struct rw_semaphore configfs_rename_sem;
10287 extern const struct file_operations configfs_dir_operations;
10388 extern const struct file_operations configfs_file_operations;
10489 extern const struct file_operations configfs_bin_file_operations;
....@@ -111,14 +96,8 @@
11196 const char *symname);
11297 extern int configfs_unlink(struct inode *dir, struct dentry *dentry);
11398
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);
122101
123102 static inline struct config_item * to_item(struct dentry * dentry)
124103 {
....@@ -146,11 +125,7 @@
146125 spin_lock(&dentry->d_lock);
147126 if (!d_unhashed(dentry)) {
148127 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);
154129 }
155130 spin_unlock(&dentry->d_lock);
156131