dir.c (664b0bae0b87f69bc9deb098f5e0158b9cf18e04) dir.c (e876c445df4009d7b1ebdd2a92ca23566ca05440)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * linux/fs/hpfs/dir.c
4 *
5 * Mikulas Patocka (mikulas@artax.karlin.mff.cuni.cz), 1998-1999
6 *
7 * directory VFS functions
8 */

--- 230 unchanged lines hidden (view full) ---

239
240 /*
241 * Go find or make an inode.
242 */
243
244 result = iget_locked(dir->i_sb, ino);
245 if (!result) {
246 hpfs_error(dir->i_sb, "hpfs_lookup: can't get inode");
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * linux/fs/hpfs/dir.c
4 *
5 * Mikulas Patocka (mikulas@artax.karlin.mff.cuni.cz), 1998-1999
6 *
7 * directory VFS functions
8 */

--- 230 unchanged lines hidden (view full) ---

239
240 /*
241 * Go find or make an inode.
242 */
243
244 result = iget_locked(dir->i_sb, ino);
245 if (!result) {
246 hpfs_error(dir->i_sb, "hpfs_lookup: can't get inode");
247 result = ERR_PTR(-ENOMEM);
247 goto bail1;
248 }
249 if (result->i_state & I_NEW) {
250 hpfs_init_inode(result);
251 if (de->directory)
252 hpfs_read_inode(result);
253 else if (le32_to_cpu(de->ea_size) && hpfs_sb(dir->i_sb)->sb_eas)
254 hpfs_read_inode(result);

--- 6 unchanged lines hidden (view full) ---

261 }
262 unlock_new_inode(result);
263 }
264 hpfs_result = hpfs_i(result);
265 if (!de->directory) hpfs_result->i_parent_dir = dir->i_ino;
266
267 if (de->has_acl || de->has_xtd_perm) if (!sb_rdonly(dir->i_sb)) {
268 hpfs_error(result->i_sb, "ACLs or XPERM found. This is probably HPFS386. This driver doesn't support it now. Send me some info on these structures");
248 goto bail1;
249 }
250 if (result->i_state & I_NEW) {
251 hpfs_init_inode(result);
252 if (de->directory)
253 hpfs_read_inode(result);
254 else if (le32_to_cpu(de->ea_size) && hpfs_sb(dir->i_sb)->sb_eas)
255 hpfs_read_inode(result);

--- 6 unchanged lines hidden (view full) ---

262 }
263 unlock_new_inode(result);
264 }
265 hpfs_result = hpfs_i(result);
266 if (!de->directory) hpfs_result->i_parent_dir = dir->i_ino;
267
268 if (de->has_acl || de->has_xtd_perm) if (!sb_rdonly(dir->i_sb)) {
269 hpfs_error(result->i_sb, "ACLs or XPERM found. This is probably HPFS386. This driver doesn't support it now. Send me some info on these structures");
270 iput(result);
271 result = ERR_PTR(-EINVAL);
269 goto bail1;
270 }
271
272 /*
273 * Fill in the info from the directory if this is a newly created
274 * inode.
275 */
276

--- 19 unchanged lines hidden (view full) ---

296 * anodes -- the disk heads are on the directory band
297 * and we want them to stay there.
298 */
299 result->i_blocks = 1 + ((result->i_size + 511) >> 9);
300 }
301 }
302 }
303
272 goto bail1;
273 }
274
275 /*
276 * Fill in the info from the directory if this is a newly created
277 * inode.
278 */
279

--- 19 unchanged lines hidden (view full) ---

299 * anodes -- the disk heads are on the directory band
300 * and we want them to stay there.
301 */
302 result->i_blocks = 1 + ((result->i_size + 511) >> 9);
303 }
304 }
305 }
306
307bail1:
304 hpfs_brelse4(&qbh);
305
306 /*
307 * Made it.
308 */
309
308 hpfs_brelse4(&qbh);
309
310 /*
311 * Made it.
312 */
313
310 end:
311 end_add:
314end:
315end_add:
312 hpfs_unlock(dir->i_sb);
316 hpfs_unlock(dir->i_sb);
313 d_add(dentry, result);
314 return NULL;
315
316 /*
317 * Didn't.
318 */
319 bail1:
320
321 hpfs_brelse4(&qbh);
322
323 /*bail:*/
324
325 hpfs_unlock(dir->i_sb);
326 return ERR_PTR(-ENOENT);
317 return d_splice_alias(result, dentry);
327}
328
329const struct file_operations hpfs_dir_ops =
330{
331 .llseek = hpfs_dir_lseek,
332 .read = generic_read_dir,
333 .iterate_shared = hpfs_readdir,
334 .release = hpfs_dir_release,
335 .fsync = hpfs_file_fsync,
336 .unlocked_ioctl = hpfs_ioctl,
337};
318}
319
320const struct file_operations hpfs_dir_ops =
321{
322 .llseek = hpfs_dir_lseek,
323 .read = generic_read_dir,
324 .iterate_shared = hpfs_readdir,
325 .release = hpfs_dir_release,
326 .fsync = hpfs_file_fsync,
327 .unlocked_ioctl = hpfs_ioctl,
328};