dir.c (9a87ffc99ec8eb8d35eed7c4f816d75f5cc9662e) dir.c (101fa821ab7d1a1ae353da41f8a2455409e35e2d)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * linux/fs/hfsplus/dir.c
4 *
5 * Copyright (C) 2001
6 * Brad Boyer (flar@allandria.com)
7 * (C) 2003 Ardis Technologies <roman@ardistech.com>
8 *

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

341 cnid = sbi->next_cnid++;
342 res = hfsplus_create_cat(cnid, dst_dir, &dst_dentry->d_name, inode);
343 if (res)
344 goto out;
345
346 inc_nlink(inode);
347 hfsplus_instantiate(dst_dentry, inode, cnid);
348 ihold(inode);
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * linux/fs/hfsplus/dir.c
4 *
5 * Copyright (C) 2001
6 * Brad Boyer (flar@allandria.com)
7 * (C) 2003 Ardis Technologies <roman@ardistech.com>
8 *

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

341 cnid = sbi->next_cnid++;
342 res = hfsplus_create_cat(cnid, dst_dir, &dst_dentry->d_name, inode);
343 if (res)
344 goto out;
345
346 inc_nlink(inode);
347 hfsplus_instantiate(dst_dentry, inode, cnid);
348 ihold(inode);
349 inode->i_ctime = current_time(inode);
349 inode_set_ctime_current(inode);
350 mark_inode_dirty(inode);
351 sbi->file_count++;
352 hfsplus_mark_mdb_dirty(dst_dir->i_sb);
353out:
354 mutex_unlock(&sbi->vh_mutex);
355 return res;
356}
357

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

400 if (!res)
401 hfsplus_delete_inode(inode);
402 } else
403 inode->i_flags |= S_DEAD;
404 } else
405 hfsplus_delete_inode(inode);
406 } else
407 sbi->file_count--;
350 mark_inode_dirty(inode);
351 sbi->file_count++;
352 hfsplus_mark_mdb_dirty(dst_dir->i_sb);
353out:
354 mutex_unlock(&sbi->vh_mutex);
355 return res;
356}
357

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

400 if (!res)
401 hfsplus_delete_inode(inode);
402 } else
403 inode->i_flags |= S_DEAD;
404 } else
405 hfsplus_delete_inode(inode);
406 } else
407 sbi->file_count--;
408 inode->i_ctime = current_time(inode);
408 inode_set_ctime_current(inode);
409 mark_inode_dirty(inode);
410out:
411 mutex_unlock(&sbi->vh_mutex);
412 return res;
413}
414
415static int hfsplus_rmdir(struct inode *dir, struct dentry *dentry)
416{

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

421 if (inode->i_size != 2)
422 return -ENOTEMPTY;
423
424 mutex_lock(&sbi->vh_mutex);
425 res = hfsplus_delete_cat(inode->i_ino, dir, &dentry->d_name);
426 if (res)
427 goto out;
428 clear_nlink(inode);
409 mark_inode_dirty(inode);
410out:
411 mutex_unlock(&sbi->vh_mutex);
412 return res;
413}
414
415static int hfsplus_rmdir(struct inode *dir, struct dentry *dentry)
416{

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

421 if (inode->i_size != 2)
422 return -ENOTEMPTY;
423
424 mutex_lock(&sbi->vh_mutex);
425 res = hfsplus_delete_cat(inode->i_ino, dir, &dentry->d_name);
426 if (res)
427 goto out;
428 clear_nlink(inode);
429 inode->i_ctime = current_time(inode);
429 inode_set_ctime_current(inode);
430 hfsplus_delete_inode(inode);
431 mark_inode_dirty(inode);
432out:
433 mutex_unlock(&sbi->vh_mutex);
434 return res;
435}
436
437static int hfsplus_symlink(struct mnt_idmap *idmap, struct inode *dir,

--- 146 unchanged lines hidden ---
430 hfsplus_delete_inode(inode);
431 mark_inode_dirty(inode);
432out:
433 mutex_unlock(&sbi->vh_mutex);
434 return res;
435}
436
437static int hfsplus_symlink(struct mnt_idmap *idmap, struct inode *dir,

--- 146 unchanged lines hidden ---