Lines Matching full:dir

12 static void hpfs_update_directory_times(struct inode *dir)  in hpfs_update_directory_times()  argument
14 time64_t t = local_to_gmt(dir->i_sb, local_get_seconds(dir->i_sb)); in hpfs_update_directory_times()
15 if (t == inode_get_mtime_sec(dir) && in hpfs_update_directory_times()
16 t == inode_get_ctime_sec(dir)) in hpfs_update_directory_times()
18 inode_set_mtime_to_ts(dir, inode_set_ctime(dir, t, 0)); in hpfs_update_directory_times()
19 hpfs_write_inode_nolock(dir); in hpfs_update_directory_times()
22 static int hpfs_mkdir(struct mnt_idmap *idmap, struct inode *dir, in hpfs_mkdir() argument
39 hpfs_lock(dir->i_sb); in hpfs_mkdir()
41 fnode = hpfs_alloc_fnode(dir->i_sb, hpfs_i(dir)->i_dno, &fno, &bh); in hpfs_mkdir()
44 dnode = hpfs_alloc_dnode(dir->i_sb, fno, &dno, &qbh0); in hpfs_mkdir()
53 dee.creation_date = dee.write_date = dee.read_date = cpu_to_le32(local_get_seconds(dir->i_sb)); in hpfs_mkdir()
54 result = new_inode(dir->i_sb); in hpfs_mkdir()
59 hpfs_i(result)->i_parent_dir = dir->i_ino; in hpfs_mkdir()
62 …inode_set_atime_to_ts(result, inode_set_ctime(result, local_to_gmt(dir->i_sb, le32_to_cpu(dee.crea… in hpfs_mkdir()
73 r = hpfs_add_dirent(dir, name, len, &dee); in hpfs_mkdir()
82 fnode->up = cpu_to_le32(dir->i_ino); in hpfs_mkdir()
91 de = hpfs_add_de(dir->i_sb, dnode, "\001\001", 2, 0); in hpfs_mkdir()
92 de->creation_date = de->write_date = de->read_date = cpu_to_le32(local_get_seconds(dir->i_sb)); in hpfs_mkdir()
101 inc_nlink(dir); in hpfs_mkdir()
112 hpfs_update_directory_times(dir); in hpfs_mkdir()
114 hpfs_unlock(dir->i_sb); in hpfs_mkdir()
120 hpfs_free_dnode(dir->i_sb, dno); in hpfs_mkdir()
123 hpfs_free_sectors(dir->i_sb, fno, 1); in hpfs_mkdir()
125 hpfs_unlock(dir->i_sb); in hpfs_mkdir()
129 static int hpfs_create(struct mnt_idmap *idmap, struct inode *dir, in hpfs_create() argument
143 hpfs_lock(dir->i_sb); in hpfs_create()
145 fnode = hpfs_alloc_fnode(dir->i_sb, hpfs_i(dir)->i_dno, &fno, &bh); in hpfs_create()
153 dee.creation_date = dee.write_date = dee.read_date = cpu_to_le32(local_get_seconds(dir->i_sb)); in hpfs_create()
155 result = new_inode(dir->i_sb); in hpfs_create()
166 hpfs_i(result)->i_parent_dir = dir->i_ino; in hpfs_create()
168 …inode_set_atime_to_ts(result, inode_set_ctime(result, local_to_gmt(dir->i_sb, le32_to_cpu(dee.crea… in hpfs_create()
177 r = hpfs_add_dirent(dir, name, len, &dee); in hpfs_create()
186 fnode->up = cpu_to_le32(dir->i_ino); in hpfs_create()
200 hpfs_update_directory_times(dir); in hpfs_create()
202 hpfs_unlock(dir->i_sb); in hpfs_create()
209 hpfs_free_sectors(dir->i_sb, fno, 1); in hpfs_create()
211 hpfs_unlock(dir->i_sb); in hpfs_create()
215 static int hpfs_mknod(struct mnt_idmap *idmap, struct inode *dir, in hpfs_mknod() argument
228 if (hpfs_sb(dir->i_sb)->sb_eas < 2) return -EPERM; in hpfs_mknod()
229 hpfs_lock(dir->i_sb); in hpfs_mknod()
231 fnode = hpfs_alloc_fnode(dir->i_sb, hpfs_i(dir)->i_dno, &fno, &bh); in hpfs_mknod()
239 dee.creation_date = dee.write_date = dee.read_date = cpu_to_le32(local_get_seconds(dir->i_sb)); in hpfs_mknod()
241 result = new_inode(dir->i_sb); in hpfs_mknod()
247 hpfs_i(result)->i_parent_dir = dir->i_ino; in hpfs_mknod()
249 …inode_set_atime_to_ts(result, inode_set_ctime(result, local_to_gmt(dir->i_sb, le32_to_cpu(dee.crea… in hpfs_mknod()
258 r = hpfs_add_dirent(dir, name, len, &dee); in hpfs_mknod()
267 fnode->up = cpu_to_le32(dir->i_ino); in hpfs_mknod()
273 hpfs_update_directory_times(dir); in hpfs_mknod()
276 hpfs_unlock(dir->i_sb); in hpfs_mknod()
282 hpfs_free_sectors(dir->i_sb, fno, 1); in hpfs_mknod()
284 hpfs_unlock(dir->i_sb); in hpfs_mknod()
288 static int hpfs_symlink(struct mnt_idmap *idmap, struct inode *dir, in hpfs_symlink() argument
301 hpfs_lock(dir->i_sb); in hpfs_symlink()
302 if (hpfs_sb(dir->i_sb)->sb_eas < 2) { in hpfs_symlink()
303 hpfs_unlock(dir->i_sb); in hpfs_symlink()
307 fnode = hpfs_alloc_fnode(dir->i_sb, hpfs_i(dir)->i_dno, &fno, &bh); in hpfs_symlink()
314 dee.creation_date = dee.write_date = dee.read_date = cpu_to_le32(local_get_seconds(dir->i_sb)); in hpfs_symlink()
316 result = new_inode(dir->i_sb); in hpfs_symlink()
321 hpfs_i(result)->i_parent_dir = dir->i_ino; in hpfs_symlink()
323 …inode_set_atime_to_ts(result, inode_set_ctime(result, local_to_gmt(dir->i_sb, le32_to_cpu(dee.crea… in hpfs_symlink()
335 r = hpfs_add_dirent(dir, name, len, &dee); in hpfs_symlink()
344 fnode->up = cpu_to_le32(dir->i_ino); in hpfs_symlink()
352 hpfs_update_directory_times(dir); in hpfs_symlink()
354 hpfs_unlock(dir->i_sb); in hpfs_symlink()
360 hpfs_free_sectors(dir->i_sb, fno, 1); in hpfs_symlink()
362 hpfs_unlock(dir->i_sb); in hpfs_symlink()
366 static int hpfs_unlink(struct inode *dir, struct dentry *dentry) in hpfs_unlink() argument
377 hpfs_lock(dir->i_sb); in hpfs_unlink()
381 de = map_dirent(dir, hpfs_i(dir)->i_dno, name, len, &dno, &qbh); in hpfs_unlink()
393 r = hpfs_remove_dirent(dir, dno, de, &qbh, 1); in hpfs_unlink()
396 hpfs_error(dir->i_sb, "there was error when removing dirent"); in hpfs_unlink()
412 hpfs_update_directory_times(dir); in hpfs_unlink()
413 hpfs_unlock(dir->i_sb); in hpfs_unlink()
417 static int hpfs_rmdir(struct inode *dir, struct dentry *dentry) in hpfs_rmdir() argument
430 hpfs_lock(dir->i_sb); in hpfs_rmdir()
432 de = map_dirent(dir, hpfs_i(dir)->i_dno, name, len, &dno, &qbh); in hpfs_rmdir()
444 hpfs_count_dnodes(dir->i_sb, hpfs_i(inode)->i_dno, NULL, NULL, &n_items); in hpfs_rmdir()
449 r = hpfs_remove_dirent(dir, dno, de, &qbh, 1); in hpfs_rmdir()
452 hpfs_error(dir->i_sb, "there was error when removing dirent"); in hpfs_rmdir()
459 drop_nlink(dir); in hpfs_rmdir()
468 hpfs_update_directory_times(dir); in hpfs_rmdir()
469 hpfs_unlock(dir->i_sb); in hpfs_rmdir()