Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
Tejun Heo | 6d66f5c | 2007-09-20 17:31:38 +0900 | [diff] [blame] | 2 | * fs/sysfs/symlink.c - sysfs symlink implementation |
| 3 | * |
| 4 | * Copyright (c) 2001-3 Patrick Mochel |
| 5 | * Copyright (c) 2007 SUSE Linux Products GmbH |
| 6 | * Copyright (c) 2007 Tejun Heo <teheo@suse.de> |
| 7 | * |
| 8 | * This file is released under the GPLv2. |
| 9 | * |
| 10 | * Please see Documentation/filesystems/sysfs.txt for more information. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 11 | */ |
| 12 | |
| 13 | #include <linux/fs.h> |
Tejun Heo | 5a0e3ad | 2010-03-24 17:04:11 +0900 | [diff] [blame] | 14 | #include <linux/gfp.h> |
Greg Kroah-Hartman | ceeee1f | 2002-04-09 12:14:34 -0700 | [diff] [blame] | 15 | #include <linux/mount.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 16 | #include <linux/module.h> |
| 17 | #include <linux/kobject.h> |
| 18 | #include <linux/namei.h> |
Dave Young | 869512a | 2007-07-26 14:53:53 +0000 | [diff] [blame] | 19 | #include <linux/mutex.h> |
David P. Quigley | ddd29ec | 2009-09-09 14:25:37 -0400 | [diff] [blame] | 20 | #include <linux/security.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 21 | |
| 22 | #include "sysfs.h" |
| 23 | |
Tejun Heo | 5d0e26b | 2013-11-23 17:21:50 -0500 | [diff] [blame^] | 24 | /** |
| 25 | * kernfs_create_link - create a symlink |
| 26 | * @parent: directory to create the symlink in |
| 27 | * @name: name of the symlink |
| 28 | * @target: target node for the symlink to point to |
| 29 | * |
| 30 | * Returns the created node on success, ERR_PTR() value on error. |
| 31 | */ |
| 32 | struct sysfs_dirent *kernfs_create_link(struct sysfs_dirent *parent, |
| 33 | const char *name, |
| 34 | struct sysfs_dirent *target) |
| 35 | { |
| 36 | struct sysfs_dirent *sd; |
| 37 | struct sysfs_addrm_cxt acxt; |
| 38 | int error; |
| 39 | |
| 40 | sd = sysfs_new_dirent(name, S_IFLNK|S_IRWXUGO, SYSFS_KOBJ_LINK); |
| 41 | if (!sd) |
| 42 | return ERR_PTR(-ENOMEM); |
| 43 | |
| 44 | if (parent->s_flags & SYSFS_FLAG_NS) |
| 45 | sd->s_ns = target->s_ns; |
| 46 | sd->s_symlink.target_sd = target; |
| 47 | sysfs_get(target); /* ref owned by symlink */ |
| 48 | |
| 49 | sysfs_addrm_start(&acxt); |
| 50 | error = __sysfs_add_one(&acxt, sd, parent); |
| 51 | sysfs_addrm_finish(&acxt); |
| 52 | |
| 53 | if (!error) |
| 54 | return sd; |
| 55 | |
| 56 | sysfs_put(sd); |
| 57 | return ERR_PTR(error); |
| 58 | } |
| 59 | |
| 60 | |
Rafael J. Wysocki | 0bb8f3d | 2013-01-25 21:51:13 +0100 | [diff] [blame] | 61 | static int sysfs_do_create_link_sd(struct sysfs_dirent *parent_sd, |
| 62 | struct kobject *target, |
| 63 | const char *name, int warn) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 64 | { |
Tejun Heo | 5d0e26b | 2013-11-23 17:21:50 -0500 | [diff] [blame^] | 65 | struct sysfs_dirent *sd, *target_sd = NULL; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 66 | |
Rafael J. Wysocki | 0bb8f3d | 2013-01-25 21:51:13 +0100 | [diff] [blame] | 67 | BUG_ON(!name || !parent_sd); |
Tejun Heo | 2b29ac2 | 2007-06-14 03:45:15 +0900 | [diff] [blame] | 68 | |
Tejun Heo | 0cae60f | 2013-10-30 10:28:36 -0400 | [diff] [blame] | 69 | /* |
| 70 | * We don't own @target and it may be removed at any time. |
| 71 | * Synchronize using sysfs_symlink_target_lock. See |
| 72 | * sysfs_remove_dir() for details. |
Tejun Heo | 2b29ac2 | 2007-06-14 03:45:15 +0900 | [diff] [blame] | 73 | */ |
Tejun Heo | 0cae60f | 2013-10-30 10:28:36 -0400 | [diff] [blame] | 74 | spin_lock(&sysfs_symlink_target_lock); |
Tejun Heo | 608e266 | 2007-06-14 04:27:22 +0900 | [diff] [blame] | 75 | if (target->sd) |
| 76 | target_sd = sysfs_get(target->sd); |
Tejun Heo | 0cae60f | 2013-10-30 10:28:36 -0400 | [diff] [blame] | 77 | spin_unlock(&sysfs_symlink_target_lock); |
Tejun Heo | 2b29ac2 | 2007-06-14 03:45:15 +0900 | [diff] [blame] | 78 | |
| 79 | if (!target_sd) |
Tejun Heo | 5d0e26b | 2013-11-23 17:21:50 -0500 | [diff] [blame^] | 80 | return -ENOENT; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 81 | |
Tejun Heo | 5d0e26b | 2013-11-23 17:21:50 -0500 | [diff] [blame^] | 82 | sd = kernfs_create_link(parent_sd, name, target_sd); |
Tejun Heo | 3007e99 | 2007-06-14 04:27:23 +0900 | [diff] [blame] | 83 | sysfs_put(target_sd); |
Tejun Heo | 5d0e26b | 2013-11-23 17:21:50 -0500 | [diff] [blame^] | 84 | |
| 85 | if (!IS_ERR(sd)) |
| 86 | return 0; |
| 87 | |
| 88 | if (warn && PTR_ERR(sd) == -EEXIST) |
| 89 | sysfs_warn_dup(parent_sd, name); |
| 90 | return PTR_ERR(sd); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 91 | } |
| 92 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 93 | /** |
Rafael J. Wysocki | 0bb8f3d | 2013-01-25 21:51:13 +0100 | [diff] [blame] | 94 | * sysfs_create_link_sd - create symlink to a given object. |
| 95 | * @sd: directory we're creating the link in. |
| 96 | * @target: object we're pointing to. |
| 97 | * @name: name of the symlink. |
| 98 | */ |
| 99 | int sysfs_create_link_sd(struct sysfs_dirent *sd, struct kobject *target, |
| 100 | const char *name) |
| 101 | { |
| 102 | return sysfs_do_create_link_sd(sd, target, name, 1); |
| 103 | } |
| 104 | |
| 105 | static int sysfs_do_create_link(struct kobject *kobj, struct kobject *target, |
| 106 | const char *name, int warn) |
| 107 | { |
| 108 | struct sysfs_dirent *parent_sd = NULL; |
| 109 | |
| 110 | if (!kobj) |
| 111 | parent_sd = &sysfs_root; |
| 112 | else |
| 113 | parent_sd = kobj->sd; |
| 114 | |
| 115 | if (!parent_sd) |
| 116 | return -EFAULT; |
| 117 | |
| 118 | return sysfs_do_create_link_sd(parent_sd, target, name, warn); |
| 119 | } |
| 120 | |
| 121 | /** |
Cornelia Huck | 36ce6da | 2008-06-10 11:09:08 +0200 | [diff] [blame] | 122 | * sysfs_create_link - create symlink between two objects. |
| 123 | * @kobj: object whose directory we're creating the link in. |
| 124 | * @target: object we're pointing to. |
| 125 | * @name: name of the symlink. |
| 126 | */ |
| 127 | int sysfs_create_link(struct kobject *kobj, struct kobject *target, |
| 128 | const char *name) |
| 129 | { |
| 130 | return sysfs_do_create_link(kobj, target, name, 1); |
| 131 | } |
Greg Kroah-Hartman | 1b86675 | 2013-08-21 16:17:47 -0700 | [diff] [blame] | 132 | EXPORT_SYMBOL_GPL(sysfs_create_link); |
Cornelia Huck | 36ce6da | 2008-06-10 11:09:08 +0200 | [diff] [blame] | 133 | |
| 134 | /** |
| 135 | * sysfs_create_link_nowarn - create symlink between two objects. |
| 136 | * @kobj: object whose directory we're creating the link in. |
| 137 | * @target: object we're pointing to. |
| 138 | * @name: name of the symlink. |
| 139 | * |
Robert P. J. Day | 6f1cbd4 | 2012-09-04 07:23:35 -0400 | [diff] [blame] | 140 | * This function does the same as sysfs_create_link(), but it |
Cornelia Huck | 36ce6da | 2008-06-10 11:09:08 +0200 | [diff] [blame] | 141 | * doesn't warn if the link already exists. |
| 142 | */ |
| 143 | int sysfs_create_link_nowarn(struct kobject *kobj, struct kobject *target, |
| 144 | const char *name) |
| 145 | { |
| 146 | return sysfs_do_create_link(kobj, target, name, 0); |
| 147 | } |
| 148 | |
| 149 | /** |
Eric W. Biederman | 746edb7 | 2010-03-30 11:31:28 -0700 | [diff] [blame] | 150 | * sysfs_delete_link - remove symlink in object's directory. |
| 151 | * @kobj: object we're acting for. |
| 152 | * @targ: object we're pointing to. |
| 153 | * @name: name of the symlink to remove. |
| 154 | * |
| 155 | * Unlike sysfs_remove_link sysfs_delete_link has enough information |
| 156 | * to successfully delete symlinks in tagged directories. |
| 157 | */ |
| 158 | void sysfs_delete_link(struct kobject *kobj, struct kobject *targ, |
| 159 | const char *name) |
| 160 | { |
| 161 | const void *ns = NULL; |
Tejun Heo | 0cae60f | 2013-10-30 10:28:36 -0400 | [diff] [blame] | 162 | |
| 163 | /* |
| 164 | * We don't own @target and it may be removed at any time. |
| 165 | * Synchronize using sysfs_symlink_target_lock. See |
| 166 | * sysfs_remove_dir() for details. |
| 167 | */ |
| 168 | spin_lock(&sysfs_symlink_target_lock); |
Tejun Heo | c84a3b2 | 2013-11-23 18:01:46 -0500 | [diff] [blame] | 169 | if (targ->sd && (kobj->sd->s_flags & SYSFS_FLAG_NS)) |
Eric W. Biederman | 746edb7 | 2010-03-30 11:31:28 -0700 | [diff] [blame] | 170 | ns = targ->sd->s_ns; |
Tejun Heo | 0cae60f | 2013-10-30 10:28:36 -0400 | [diff] [blame] | 171 | spin_unlock(&sysfs_symlink_target_lock); |
Tejun Heo | 879f40d | 2013-11-23 17:21:49 -0500 | [diff] [blame] | 172 | kernfs_remove_by_name_ns(kobj->sd, name, ns); |
Eric W. Biederman | 746edb7 | 2010-03-30 11:31:28 -0700 | [diff] [blame] | 173 | } |
| 174 | |
| 175 | /** |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 176 | * sysfs_remove_link - remove symlink in object's directory. |
| 177 | * @kobj: object we're acting for. |
| 178 | * @name: name of the symlink to remove. |
| 179 | */ |
Greg Kroah-Hartman | 1b18dc2 | 2013-08-21 16:28:26 -0700 | [diff] [blame] | 180 | void sysfs_remove_link(struct kobject *kobj, const char *name) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 181 | { |
Mark Fasheh | a839c5a | 2008-01-29 14:35:18 -0800 | [diff] [blame] | 182 | struct sysfs_dirent *parent_sd = NULL; |
| 183 | |
| 184 | if (!kobj) |
| 185 | parent_sd = &sysfs_root; |
| 186 | else |
| 187 | parent_sd = kobj->sd; |
| 188 | |
Tejun Heo | 879f40d | 2013-11-23 17:21:49 -0500 | [diff] [blame] | 189 | kernfs_remove_by_name(parent_sd, name); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 190 | } |
Greg Kroah-Hartman | 1b86675 | 2013-08-21 16:17:47 -0700 | [diff] [blame] | 191 | EXPORT_SYMBOL_GPL(sysfs_remove_link); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 192 | |
Eric W. Biederman | 7cb3294 | 2010-02-12 19:22:25 -0800 | [diff] [blame] | 193 | /** |
Tejun Heo | 4b30ee5 | 2013-09-11 22:29:06 -0400 | [diff] [blame] | 194 | * sysfs_rename_link_ns - rename symlink in object's directory. |
Eric W. Biederman | 7cb3294 | 2010-02-12 19:22:25 -0800 | [diff] [blame] | 195 | * @kobj: object we're acting for. |
| 196 | * @targ: object we're pointing to. |
| 197 | * @old: previous name of the symlink. |
| 198 | * @new: new name of the symlink. |
Tejun Heo | 4b30ee5 | 2013-09-11 22:29:06 -0400 | [diff] [blame] | 199 | * @new_ns: new namespace of the symlink. |
Eric W. Biederman | 7cb3294 | 2010-02-12 19:22:25 -0800 | [diff] [blame] | 200 | * |
| 201 | * A helper function for the common rename symlink idiom. |
| 202 | */ |
Tejun Heo | 4b30ee5 | 2013-09-11 22:29:06 -0400 | [diff] [blame] | 203 | int sysfs_rename_link_ns(struct kobject *kobj, struct kobject *targ, |
| 204 | const char *old, const char *new, const void *new_ns) |
Eric W. Biederman | 7cb3294 | 2010-02-12 19:22:25 -0800 | [diff] [blame] | 205 | { |
| 206 | struct sysfs_dirent *parent_sd, *sd = NULL; |
Tejun Heo | 4b30ee5 | 2013-09-11 22:29:06 -0400 | [diff] [blame] | 207 | const void *old_ns = NULL; |
Eric W. Biederman | 7cb3294 | 2010-02-12 19:22:25 -0800 | [diff] [blame] | 208 | int result; |
| 209 | |
| 210 | if (!kobj) |
| 211 | parent_sd = &sysfs_root; |
| 212 | else |
| 213 | parent_sd = kobj->sd; |
| 214 | |
Eric W. Biederman | 3ff195b | 2010-03-30 11:31:26 -0700 | [diff] [blame] | 215 | if (targ->sd) |
| 216 | old_ns = targ->sd->s_ns; |
| 217 | |
Eric W. Biederman | 7cb3294 | 2010-02-12 19:22:25 -0800 | [diff] [blame] | 218 | result = -ENOENT; |
Tejun Heo | 388975c | 2013-09-11 23:19:13 -0400 | [diff] [blame] | 219 | sd = sysfs_get_dirent_ns(parent_sd, old, old_ns); |
Eric W. Biederman | 7cb3294 | 2010-02-12 19:22:25 -0800 | [diff] [blame] | 220 | if (!sd) |
| 221 | goto out; |
| 222 | |
| 223 | result = -EINVAL; |
| 224 | if (sysfs_type(sd) != SYSFS_KOBJ_LINK) |
| 225 | goto out; |
| 226 | if (sd->s_symlink.target_sd->s_dir.kobj != targ) |
| 227 | goto out; |
| 228 | |
Tejun Heo | cfec0bc | 2013-09-11 22:29:09 -0400 | [diff] [blame] | 229 | result = sysfs_rename(sd, parent_sd, new, new_ns); |
Eric W. Biederman | 7cb3294 | 2010-02-12 19:22:25 -0800 | [diff] [blame] | 230 | |
| 231 | out: |
| 232 | sysfs_put(sd); |
| 233 | return result; |
| 234 | } |
Tejun Heo | 4b30ee5 | 2013-09-11 22:29:06 -0400 | [diff] [blame] | 235 | EXPORT_SYMBOL_GPL(sysfs_rename_link_ns); |
Eric W. Biederman | 7cb3294 | 2010-02-12 19:22:25 -0800 | [diff] [blame] | 236 | |
Kay Sievers | 2f90a85 | 2007-11-01 20:20:52 +0100 | [diff] [blame] | 237 | static int sysfs_get_target_path(struct sysfs_dirent *parent_sd, |
| 238 | struct sysfs_dirent *target_sd, char *path) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 239 | { |
Kay Sievers | 2f90a85 | 2007-11-01 20:20:52 +0100 | [diff] [blame] | 240 | struct sysfs_dirent *base, *sd; |
| 241 | char *s = path; |
| 242 | int len = 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 243 | |
Kay Sievers | 2f90a85 | 2007-11-01 20:20:52 +0100 | [diff] [blame] | 244 | /* go up to the root, stop at the base */ |
| 245 | base = parent_sd; |
| 246 | while (base->s_parent) { |
| 247 | sd = target_sd->s_parent; |
| 248 | while (sd->s_parent && base != sd) |
| 249 | sd = sd->s_parent; |
| 250 | |
| 251 | if (base == sd) |
| 252 | break; |
| 253 | |
| 254 | strcpy(s, "../"); |
| 255 | s += 3; |
| 256 | base = base->s_parent; |
| 257 | } |
| 258 | |
| 259 | /* determine end of target string for reverse fillup */ |
| 260 | sd = target_sd; |
| 261 | while (sd->s_parent && sd != base) { |
| 262 | len += strlen(sd->s_name) + 1; |
| 263 | sd = sd->s_parent; |
| 264 | } |
| 265 | |
| 266 | /* check limits */ |
| 267 | if (len < 2) |
| 268 | return -EINVAL; |
| 269 | len--; |
| 270 | if ((s - path) + len > PATH_MAX) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 271 | return -ENAMETOOLONG; |
| 272 | |
Kay Sievers | 2f90a85 | 2007-11-01 20:20:52 +0100 | [diff] [blame] | 273 | /* reverse fillup of target string from target to base */ |
| 274 | sd = target_sd; |
| 275 | while (sd->s_parent && sd != base) { |
| 276 | int slen = strlen(sd->s_name); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 277 | |
Kay Sievers | 2f90a85 | 2007-11-01 20:20:52 +0100 | [diff] [blame] | 278 | len -= slen; |
| 279 | strncpy(s + len, sd->s_name, slen); |
| 280 | if (len) |
| 281 | s[--len] = '/'; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 282 | |
Kay Sievers | 2f90a85 | 2007-11-01 20:20:52 +0100 | [diff] [blame] | 283 | sd = sd->s_parent; |
| 284 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 285 | |
| 286 | return 0; |
| 287 | } |
| 288 | |
Greg Kroah-Hartman | 1b18dc2 | 2013-08-21 16:28:26 -0700 | [diff] [blame] | 289 | static int sysfs_getlink(struct dentry *dentry, char *path) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 290 | { |
Tejun Heo | 2b29ac2 | 2007-06-14 03:45:15 +0900 | [diff] [blame] | 291 | struct sysfs_dirent *sd = dentry->d_fsdata; |
| 292 | struct sysfs_dirent *parent_sd = sd->s_parent; |
Tejun Heo | b1fc3d6 | 2007-09-20 16:05:11 +0900 | [diff] [blame] | 293 | struct sysfs_dirent *target_sd = sd->s_symlink.target_sd; |
Tejun Heo | 2b29ac2 | 2007-06-14 03:45:15 +0900 | [diff] [blame] | 294 | int error; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 295 | |
Tejun Heo | 3007e99 | 2007-06-14 04:27:23 +0900 | [diff] [blame] | 296 | mutex_lock(&sysfs_mutex); |
Tejun Heo | 2b29ac2 | 2007-06-14 03:45:15 +0900 | [diff] [blame] | 297 | error = sysfs_get_target_path(parent_sd, target_sd, path); |
Tejun Heo | 3007e99 | 2007-06-14 04:27:23 +0900 | [diff] [blame] | 298 | mutex_unlock(&sysfs_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 299 | |
Tejun Heo | 2b29ac2 | 2007-06-14 03:45:15 +0900 | [diff] [blame] | 300 | return error; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 301 | } |
| 302 | |
Linus Torvalds | cc314ee | 2005-08-19 18:02:56 -0700 | [diff] [blame] | 303 | static void *sysfs_follow_link(struct dentry *dentry, struct nameidata *nd) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 304 | { |
| 305 | int error = -ENOMEM; |
| 306 | unsigned long page = get_zeroed_page(GFP_KERNEL); |
Armin Kuster | 557411e | 2009-04-29 07:29:59 -1000 | [diff] [blame] | 307 | if (page) { |
Greg Kroah-Hartman | ab9bf4b | 2013-08-21 16:21:17 -0700 | [diff] [blame] | 308 | error = sysfs_getlink(dentry, (char *) page); |
Armin Kuster | 557411e | 2009-04-29 07:29:59 -1000 | [diff] [blame] | 309 | if (error < 0) |
| 310 | free_page((unsigned long)page); |
| 311 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 312 | nd_set_link(nd, error ? ERR_PTR(error) : (char *)page); |
Linus Torvalds | cc314ee | 2005-08-19 18:02:56 -0700 | [diff] [blame] | 313 | return NULL; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 314 | } |
| 315 | |
Greg Kroah-Hartman | ddfd6d0 | 2013-08-21 16:33:34 -0700 | [diff] [blame] | 316 | static void sysfs_put_link(struct dentry *dentry, struct nameidata *nd, |
| 317 | void *cookie) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 318 | { |
| 319 | char *page = nd_get_link(nd); |
| 320 | if (!IS_ERR(page)) |
| 321 | free_page((unsigned long)page); |
| 322 | } |
| 323 | |
Arjan van de Ven | c5ef1c4 | 2007-02-12 00:55:40 -0800 | [diff] [blame] | 324 | const struct inode_operations sysfs_symlink_inode_operations = { |
Eric W. Biederman | c099aac | 2009-11-20 16:08:52 -0800 | [diff] [blame] | 325 | .setxattr = sysfs_setxattr, |
| 326 | .readlink = generic_readlink, |
| 327 | .follow_link = sysfs_follow_link, |
| 328 | .put_link = sysfs_put_link, |
Eric W. Biederman | e61ab4a | 2009-11-20 16:08:53 -0800 | [diff] [blame] | 329 | .setattr = sysfs_setattr, |
| 330 | .getattr = sysfs_getattr, |
| 331 | .permission = sysfs_permission, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 332 | }; |