diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-08 13:17:20 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-08 13:17:20 -0500 |
commit | e10154189f001b6428a83f58b03a27954f0f8022 (patch) | |
tree | 30b4ac5760c5d310e9cc2cbf8fc4b9c6f9d0e369 /fs/sysfs/inode.c | |
parent | d4bab1b091be4a91a7363118c9ede3cc9a7fefd4 (diff) | |
parent | 410c17651998944630a95fbb286a50362de2dbb0 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6: (62 commits)
msi-laptop: depends on RFKILL
msi-laptop: Detect 3G device exists by standard ec command
msi-laptop: Add resume method for set the SCM load again
msi-laptop: Support some MSI 3G netbook that is need load SCM
msi-laptop: Add threeg sysfs file for support query 3G state by standard 66/62 ec command
msi-laptop: Support standard ec 66/62 command on MSI notebook and nebook
Driver core: create lock/unlock functions for struct device
sysfs: fix for thinko with sysfs_bin_attr_init()
sysfs: Kill unused sysfs_sb variable.
sysfs: Pass super_block to sysfs_get_inode
driver core: Use sysfs_rename_link in device_rename
sysfs: Implement sysfs_rename_link
sysfs: Pack sysfs_dirent more tightly.
sysfs: Serialize updates to the vfs inode
sysfs: windfarm: init sysfs attributes
sysfs: Use sysfs_attr_init and sysfs_bin_attr_init on module dynamic attributes
sysfs: Document sysfs_attr_init and sysfs_bin_attr_init
sysfs: Use sysfs_attr_init and sysfs_bin_attr_init on dynamic attributes
sysfs: Use one lockdep class per sysfs attribute.
sysfs: Only take active references on attributes.
...
Diffstat (limited to 'fs/sysfs/inode.c')
-rw-r--r-- | fs/sysfs/inode.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c index 6a06a1d1ea7b..082daaecac1b 100644 --- a/fs/sysfs/inode.c +++ b/fs/sysfs/inode.c | |||
@@ -111,20 +111,20 @@ int sysfs_setattr(struct dentry *dentry, struct iattr *iattr) | |||
111 | if (!sd) | 111 | if (!sd) |
112 | return -EINVAL; | 112 | return -EINVAL; |
113 | 113 | ||
114 | mutex_lock(&sysfs_mutex); | ||
114 | error = inode_change_ok(inode, iattr); | 115 | error = inode_change_ok(inode, iattr); |
115 | if (error) | 116 | if (error) |
116 | return error; | 117 | goto out; |
117 | 118 | ||
118 | iattr->ia_valid &= ~ATTR_SIZE; /* ignore size changes */ | 119 | iattr->ia_valid &= ~ATTR_SIZE; /* ignore size changes */ |
119 | 120 | ||
120 | error = inode_setattr(inode, iattr); | 121 | error = inode_setattr(inode, iattr); |
121 | if (error) | 122 | if (error) |
122 | return error; | 123 | goto out; |
123 | 124 | ||
124 | mutex_lock(&sysfs_mutex); | ||
125 | error = sysfs_sd_setattr(sd, iattr); | 125 | error = sysfs_sd_setattr(sd, iattr); |
126 | out: | ||
126 | mutex_unlock(&sysfs_mutex); | 127 | mutex_unlock(&sysfs_mutex); |
127 | |||
128 | return error; | 128 | return error; |
129 | } | 129 | } |
130 | 130 | ||
@@ -283,6 +283,7 @@ static void sysfs_init_inode(struct sysfs_dirent *sd, struct inode *inode) | |||
283 | 283 | ||
284 | /** | 284 | /** |
285 | * sysfs_get_inode - get inode for sysfs_dirent | 285 | * sysfs_get_inode - get inode for sysfs_dirent |
286 | * @sb: super block | ||
286 | * @sd: sysfs_dirent to allocate inode for | 287 | * @sd: sysfs_dirent to allocate inode for |
287 | * | 288 | * |
288 | * Get inode for @sd. If such inode doesn't exist, a new inode | 289 | * Get inode for @sd. If such inode doesn't exist, a new inode |
@@ -295,11 +296,11 @@ static void sysfs_init_inode(struct sysfs_dirent *sd, struct inode *inode) | |||
295 | * RETURNS: | 296 | * RETURNS: |
296 | * Pointer to allocated inode on success, NULL on failure. | 297 | * Pointer to allocated inode on success, NULL on failure. |
297 | */ | 298 | */ |
298 | struct inode * sysfs_get_inode(struct sysfs_dirent *sd) | 299 | struct inode * sysfs_get_inode(struct super_block *sb, struct sysfs_dirent *sd) |
299 | { | 300 | { |
300 | struct inode *inode; | 301 | struct inode *inode; |
301 | 302 | ||
302 | inode = iget_locked(sysfs_sb, sd->s_ino); | 303 | inode = iget_locked(sb, sd->s_ino); |
303 | if (inode && (inode->i_state & I_NEW)) | 304 | if (inode && (inode->i_state & I_NEW)) |
304 | sysfs_init_inode(sd, inode); | 305 | sysfs_init_inode(sd, inode); |
305 | 306 | ||