inode.c (728d90bdc9e480dc93913e59a0aa3c896c7aa697) | inode.c (67c0496e87d193b8356d2af49ab95e8a1b954b3c) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * fs/kernfs/inode.c - kernfs inode implementation 4 * 5 * Copyright (c) 2001-3 Patrick Mochel 6 * Copyright (c) 2007 SUSE Linux Products GmbH 7 * Copyright (c) 2007, 2013 Tejun Heo <tj@kernel.org> 8 */ --- 187 unchanged lines hidden (view full) --- 196} 197 198static void kernfs_init_inode(struct kernfs_node *kn, struct inode *inode) 199{ 200 kernfs_get(kn); 201 inode->i_private = kn; 202 inode->i_mapping->a_ops = &kernfs_aops; 203 inode->i_op = &kernfs_iops; | 1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * fs/kernfs/inode.c - kernfs inode implementation 4 * 5 * Copyright (c) 2001-3 Patrick Mochel 6 * Copyright (c) 2007 SUSE Linux Products GmbH 7 * Copyright (c) 2007, 2013 Tejun Heo <tj@kernel.org> 8 */ --- 187 unchanged lines hidden (view full) --- 196} 197 198static void kernfs_init_inode(struct kernfs_node *kn, struct inode *inode) 199{ 200 kernfs_get(kn); 201 inode->i_private = kn; 202 inode->i_mapping->a_ops = &kernfs_aops; 203 inode->i_op = &kernfs_iops; |
204 inode->i_generation = kn->id.generation; | 204 inode->i_generation = kernfs_gen(kn); |
205 206 set_default_inode_attr(inode, kn->mode); 207 kernfs_refresh_inode(kn, inode); 208 209 /* initialize inode according to type */ 210 switch (kernfs_type(kn)) { 211 case KERNFS_DIR: 212 inode->i_op = &kernfs_dir_iops; --- 29 unchanged lines hidden (view full) --- 242 * 243 * RETURNS: 244 * Pointer to allocated inode on success, NULL on failure. 245 */ 246struct inode *kernfs_get_inode(struct super_block *sb, struct kernfs_node *kn) 247{ 248 struct inode *inode; 249 | 205 206 set_default_inode_attr(inode, kn->mode); 207 kernfs_refresh_inode(kn, inode); 208 209 /* initialize inode according to type */ 210 switch (kernfs_type(kn)) { 211 case KERNFS_DIR: 212 inode->i_op = &kernfs_dir_iops; --- 29 unchanged lines hidden (view full) --- 242 * 243 * RETURNS: 244 * Pointer to allocated inode on success, NULL on failure. 245 */ 246struct inode *kernfs_get_inode(struct super_block *sb, struct kernfs_node *kn) 247{ 248 struct inode *inode; 249 |
250 inode = iget_locked(sb, kn->id.ino); | 250 inode = iget_locked(sb, kernfs_ino(kn)); |
251 if (inode && (inode->i_state & I_NEW)) 252 kernfs_init_inode(kn, inode); 253 254 return inode; 255} 256 257/* 258 * The kernfs_node serves as both an inode and a directory entry for --- 88 unchanged lines hidden --- | 251 if (inode && (inode->i_state & I_NEW)) 252 kernfs_init_inode(kn, inode); 253 254 return inode; 255} 256 257/* 258 * The kernfs_node serves as both an inode and a directory entry for --- 88 unchanged lines hidden --- |