Lines Matching refs:inode
20 struct inode *inode, u32 cnid) in hfsplus_instantiate() argument
23 d_instantiate(dentry, inode); in hfsplus_instantiate()
27 static struct dentry *hfsplus_lookup(struct inode *dir, struct dentry *dentry, in hfsplus_lookup()
30 struct inode *inode = NULL; in hfsplus_lookup() local
50 inode = NULL; in hfsplus_lookup()
100 inode = hfsplus_iget(dir->i_sb, cnid); in hfsplus_lookup()
101 if (IS_ERR(inode)) in hfsplus_lookup()
102 return ERR_CAST(inode); in hfsplus_lookup()
103 if (S_ISREG(inode->i_mode)) in hfsplus_lookup()
104 HFSPLUS_I(inode).dev = linkid; in hfsplus_lookup()
106 d_add(dentry, inode); in hfsplus_lookup()
115 struct inode *inode = filp->f_path.dentry->d_inode; in hfsplus_readdir() local
116 struct super_block *sb = inode->i_sb; in hfsplus_readdir()
124 if (filp->f_pos >= inode->i_size) in hfsplus_readdir()
128 hfsplus_cat_build_key(sb, fd.search_key, inode->i_ino, NULL); in hfsplus_readdir()
136 if (filldir(dirent, ".", 1, 0, inode->i_ino, DT_DIR)) in hfsplus_readdir()
158 if (filp->f_pos >= inode->i_size) in hfsplus_readdir()
166 if (be32_to_cpu(fd.key->cat.parent) != inode->i_ino) { in hfsplus_readdir()
205 if (filp->f_pos >= inode->i_size) in hfsplus_readdir()
220 list_add(&rd->list, &HFSPLUS_I(inode).open_dir_list); in hfsplus_readdir()
228 static int hfsplus_dir_release(struct inode *inode, struct file *file) in hfsplus_dir_release() argument
238 static int hfsplus_create(struct inode *dir, struct dentry *dentry, int mode, in hfsplus_create()
241 struct inode *inode; in hfsplus_create() local
244 inode = hfsplus_new_inode(dir->i_sb, mode); in hfsplus_create()
245 if (!inode) in hfsplus_create()
248 res = hfsplus_create_cat(inode->i_ino, dir, &dentry->d_name, inode); in hfsplus_create()
250 inode->i_nlink = 0; in hfsplus_create()
251 hfsplus_delete_inode(inode); in hfsplus_create()
252 iput(inode); in hfsplus_create()
255 hfsplus_instantiate(dentry, inode, inode->i_ino); in hfsplus_create()
256 mark_inode_dirty(inode); in hfsplus_create()
260 static int hfsplus_link(struct dentry *src_dentry, struct inode *dst_dir, in hfsplus_link()
264 struct inode *inode = src_dentry->d_inode; in hfsplus_link() local
265 struct inode *src_dir = src_dentry->d_parent->d_inode; in hfsplus_link()
271 if (HFSPLUS_IS_RSRC(inode)) in hfsplus_link()
274 if (inode->i_ino == (u32)(unsigned long)src_dentry->d_fsdata) { in hfsplus_link()
280 res = hfsplus_rename_cat(inode->i_ino, in hfsplus_link()
288 HFSPLUS_I(inode).dev = id; in hfsplus_link()
291 res = hfsplus_create_cat(cnid, src_dir, &src_dentry->d_name, inode); in hfsplus_link()
298 res = hfsplus_create_cat(cnid, dst_dir, &dst_dentry->d_name, inode); in hfsplus_link()
302 inc_nlink(inode); in hfsplus_link()
303 hfsplus_instantiate(dst_dentry, inode, cnid); in hfsplus_link()
304 atomic_inc(&inode->i_count); in hfsplus_link()
305 inode->i_ctime = CURRENT_TIME_SEC; in hfsplus_link()
306 mark_inode_dirty(inode); in hfsplus_link()
313 static int hfsplus_unlink(struct inode *dir, struct dentry *dentry) in hfsplus_unlink()
316 struct inode *inode = dentry->d_inode; in hfsplus_unlink() local
322 if (HFSPLUS_IS_RSRC(inode)) in hfsplus_unlink()
326 if (inode->i_ino == cnid && in hfsplus_unlink()
327 atomic_read(&HFSPLUS_I(inode).opencnt)) { in hfsplus_unlink()
329 str.len = sprintf(name, "temp%lu", inode->i_ino); in hfsplus_unlink()
330 res = hfsplus_rename_cat(inode->i_ino, in hfsplus_unlink()
334 inode->i_flags |= S_DEAD; in hfsplus_unlink()
341 if (inode->i_nlink > 0) in hfsplus_unlink()
342 drop_nlink(inode); in hfsplus_unlink()
343 if (inode->i_ino == cnid) in hfsplus_unlink()
344 clear_nlink(inode); in hfsplus_unlink()
345 if (!inode->i_nlink) { in hfsplus_unlink()
346 if (inode->i_ino != cnid) { in hfsplus_unlink()
348 if (!atomic_read(&HFSPLUS_I(inode).opencnt)) { in hfsplus_unlink()
349 res = hfsplus_delete_cat(inode->i_ino, in hfsplus_unlink()
353 hfsplus_delete_inode(inode); in hfsplus_unlink()
355 inode->i_flags |= S_DEAD; in hfsplus_unlink()
357 hfsplus_delete_inode(inode); in hfsplus_unlink()
360 inode->i_ctime = CURRENT_TIME_SEC; in hfsplus_unlink()
361 mark_inode_dirty(inode); in hfsplus_unlink()
366 static int hfsplus_mkdir(struct inode *dir, struct dentry *dentry, int mode) in hfsplus_mkdir()
368 struct inode *inode; in hfsplus_mkdir() local
371 inode = hfsplus_new_inode(dir->i_sb, S_IFDIR | mode); in hfsplus_mkdir()
372 if (!inode) in hfsplus_mkdir()
375 res = hfsplus_create_cat(inode->i_ino, dir, &dentry->d_name, inode); in hfsplus_mkdir()
377 inode->i_nlink = 0; in hfsplus_mkdir()
378 hfsplus_delete_inode(inode); in hfsplus_mkdir()
379 iput(inode); in hfsplus_mkdir()
382 hfsplus_instantiate(dentry, inode, inode->i_ino); in hfsplus_mkdir()
383 mark_inode_dirty(inode); in hfsplus_mkdir()
387 static int hfsplus_rmdir(struct inode *dir, struct dentry *dentry) in hfsplus_rmdir()
389 struct inode *inode; in hfsplus_rmdir() local
392 inode = dentry->d_inode; in hfsplus_rmdir()
393 if (inode->i_size != 2) in hfsplus_rmdir()
395 res = hfsplus_delete_cat(inode->i_ino, dir, &dentry->d_name); in hfsplus_rmdir()
398 clear_nlink(inode); in hfsplus_rmdir()
399 inode->i_ctime = CURRENT_TIME_SEC; in hfsplus_rmdir()
400 hfsplus_delete_inode(inode); in hfsplus_rmdir()
401 mark_inode_dirty(inode); in hfsplus_rmdir()
405 static int hfsplus_symlink(struct inode *dir, struct dentry *dentry, in hfsplus_symlink()
409 struct inode *inode; in hfsplus_symlink() local
413 inode = hfsplus_new_inode(sb, S_IFLNK | S_IRWXUGO); in hfsplus_symlink()
414 if (!inode) in hfsplus_symlink()
417 res = page_symlink(inode, symname, strlen(symname) + 1); in hfsplus_symlink()
419 inode->i_nlink = 0; in hfsplus_symlink()
420 hfsplus_delete_inode(inode); in hfsplus_symlink()
421 iput(inode); in hfsplus_symlink()
425 mark_inode_dirty(inode); in hfsplus_symlink()
426 res = hfsplus_create_cat(inode->i_ino, dir, &dentry->d_name, inode); in hfsplus_symlink()
429 hfsplus_instantiate(dentry, inode, inode->i_ino); in hfsplus_symlink()
430 mark_inode_dirty(inode); in hfsplus_symlink()
436 static int hfsplus_mknod(struct inode *dir, struct dentry *dentry, in hfsplus_mknod()
440 struct inode *inode; in hfsplus_mknod() local
444 inode = hfsplus_new_inode(sb, mode); in hfsplus_mknod()
445 if (!inode) in hfsplus_mknod()
448 res = hfsplus_create_cat(inode->i_ino, dir, &dentry->d_name, inode); in hfsplus_mknod()
450 inode->i_nlink = 0; in hfsplus_mknod()
451 hfsplus_delete_inode(inode); in hfsplus_mknod()
452 iput(inode); in hfsplus_mknod()
455 init_special_inode(inode, mode, rdev); in hfsplus_mknod()
456 hfsplus_instantiate(dentry, inode, inode->i_ino); in hfsplus_mknod()
457 mark_inode_dirty(inode); in hfsplus_mknod()
462 static int hfsplus_rename(struct inode *old_dir, struct dentry *old_dentry, in hfsplus_rename()
463 struct inode *new_dir, struct dentry *new_dentry) in hfsplus_rename()