sysfs: Pass super_block to sysfs_get_inode

Currently sysfs_get_inode magically returns an inode on
sysfs_sb. Make the super_block parameter explicit and
the code becomes clearer.

Acked-by: Tejun Heo <tj@kernel.org>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by Eric W. Biederman and committed by Greg Kroah-Hartman fac2622b 2354dcc7

+6 -5
+1 -1
fs/sysfs/dir.c
··· 645 645 } 646 646 647 647 /* attach dentry and inode */ 648 - inode = sysfs_get_inode(sd); 648 + inode = sysfs_get_inode(dir->i_sb, sd); 649 649 if (!inode) { 650 650 ret = ERR_PTR(-ENOMEM); 651 651 goto out_unlock;
+3 -2
fs/sysfs/inode.c
··· 283 283 284 284 /** 285 285 * sysfs_get_inode - get inode for sysfs_dirent 286 + * @sb: super block 286 287 * @sd: sysfs_dirent to allocate inode for 287 288 * 288 289 * Get inode for @sd. If such inode doesn't exist, a new inode ··· 296 295 * RETURNS: 297 296 * Pointer to allocated inode on success, NULL on failure. 298 297 */ 299 - struct inode * sysfs_get_inode(struct sysfs_dirent *sd) 298 + struct inode * sysfs_get_inode(struct super_block *sb, struct sysfs_dirent *sd) 300 299 { 301 300 struct inode *inode; 302 301 303 - inode = iget_locked(sysfs_sb, sd->s_ino); 302 + inode = iget_locked(sb, sd->s_ino); 304 303 if (inode && (inode->i_state & I_NEW)) 305 304 sysfs_init_inode(sd, inode); 306 305
+1 -1
fs/sysfs/mount.c
··· 54 54 55 55 /* get root inode, initialize and unlock it */ 56 56 mutex_lock(&sysfs_mutex); 57 - inode = sysfs_get_inode(&sysfs_root); 57 + inode = sysfs_get_inode(sb, &sysfs_root); 58 58 mutex_unlock(&sysfs_mutex); 59 59 if (!inode) { 60 60 pr_debug("sysfs: could not get root inode\n");
+1 -1
fs/sysfs/sysfs.h
··· 172 172 /* 173 173 * inode.c 174 174 */ 175 - struct inode *sysfs_get_inode(struct sysfs_dirent *sd); 175 + struct inode *sysfs_get_inode(struct super_block *sb, struct sysfs_dirent *sd); 176 176 void sysfs_delete_inode(struct inode *inode); 177 177 int sysfs_sd_setattr(struct sysfs_dirent *sd, struct iattr *iattr); 178 178 int sysfs_permission(struct inode *inode, int mask);