Lines Matching refs:dentry
67 static int xattr_create(struct inode *dir, struct dentry *dentry, int mode) in xattr_create() argument
70 return dir->i_op->create(&nop_mnt_idmap, dir, dentry, mode, true); in xattr_create()
74 static int xattr_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) in xattr_mkdir() argument
77 return dir->i_op->mkdir(&nop_mnt_idmap, dir, dentry, mode); in xattr_mkdir()
86 static int xattr_unlink(struct inode *dir, struct dentry *dentry) in xattr_unlink() argument
92 inode_lock_nested(d_inode(dentry), I_MUTEX_CHILD); in xattr_unlink()
93 error = dir->i_op->unlink(dir, dentry); in xattr_unlink()
94 inode_unlock(d_inode(dentry)); in xattr_unlink()
97 d_delete(dentry); in xattr_unlink()
101 static int xattr_rmdir(struct inode *dir, struct dentry *dentry) in xattr_rmdir() argument
107 inode_lock_nested(d_inode(dentry), I_MUTEX_CHILD); in xattr_rmdir()
108 error = dir->i_op->rmdir(dir, dentry); in xattr_rmdir()
110 d_inode(dentry)->i_flags |= S_DEAD; in xattr_rmdir()
111 inode_unlock(d_inode(dentry)); in xattr_rmdir()
113 d_delete(dentry); in xattr_rmdir()
120 static struct dentry *open_xa_root(struct super_block *sb, int flags) in open_xa_root()
122 struct dentry *privroot = REISERFS_SB(sb)->priv_root; in open_xa_root()
123 struct dentry *xaroot; in open_xa_root()
148 static struct dentry *open_xa_dir(const struct inode *inode, int flags) in open_xa_dir()
150 struct dentry *xaroot, *xadir; in open_xa_dir()
187 struct dentry *xadir;
190 struct dentry *dentries[8];
199 struct dentry *dentry; in fill_with_dentries() local
210 dentry = lookup_one_len(name, dbuf->xadir, namelen); in fill_with_dentries()
211 if (IS_ERR(dentry)) { in fill_with_dentries()
212 dbuf->err = PTR_ERR(dentry); in fill_with_dentries()
214 } else if (d_really_is_negative(dentry)) { in fill_with_dentries()
216 reiserfs_error(dentry->d_sb, "xattr-20003", in fill_with_dentries()
219 dentry, dbuf->xadir); in fill_with_dentries()
220 dput(dentry); in fill_with_dentries()
225 dbuf->dentries[dbuf->count++] = dentry; in fill_with_dentries()
240 int (*action)(struct dentry *, void *), in reiserfs_for_each_xattr() argument
243 struct dentry *dir; in reiserfs_for_each_xattr()
276 struct dentry *dentry = buf.dentries[i]; in reiserfs_for_each_xattr() local
278 if (!d_is_dir(dentry)) in reiserfs_for_each_xattr()
279 err = action(dentry, data); in reiserfs_for_each_xattr()
281 dput(dentry); in reiserfs_for_each_xattr()
333 static int delete_one_xattr(struct dentry *dentry, void *data) in delete_one_xattr() argument
335 struct inode *dir = d_inode(dentry->d_parent); in delete_one_xattr()
338 if (d_is_dir(dentry)) in delete_one_xattr()
339 return xattr_rmdir(dir, dentry); in delete_one_xattr()
341 return xattr_unlink(dir, dentry); in delete_one_xattr()
344 static int chown_one_xattr(struct dentry *dentry, void *data) in chown_one_xattr() argument
356 err = reiserfs_setattr(&nop_mnt_idmap, dentry, attrs); in chown_one_xattr()
390 static struct dentry *xattr_lookup(struct inode *inode, const char *name, in xattr_lookup()
393 struct dentry *xadir, *xafile; in xattr_lookup()
482 struct dentry *dentry, *xadir; in lookup_and_delete_xattr() local
489 dentry = lookup_one_len(name, xadir, strlen(name)); in lookup_and_delete_xattr()
490 if (IS_ERR(dentry)) { in lookup_and_delete_xattr()
491 err = PTR_ERR(dentry); in lookup_and_delete_xattr()
495 if (d_really_is_positive(dentry)) { in lookup_and_delete_xattr()
496 err = xattr_unlink(d_inode(xadir), dentry); in lookup_and_delete_xattr()
500 dput(dentry); in lookup_and_delete_xattr()
519 struct dentry *dentry; in reiserfs_xattr_set_handle() local
535 dentry = xattr_lookup(inode, name, flags); in reiserfs_xattr_set_handle()
536 if (IS_ERR(dentry)) in reiserfs_xattr_set_handle()
537 return PTR_ERR(dentry); in reiserfs_xattr_set_handle()
552 page = reiserfs_get_page(d_inode(dentry), file_pos); in reiserfs_xattr_set_handle()
592 if (!err && new_size < i_size_read(d_inode(dentry))) { in reiserfs_xattr_set_handle()
599 inode_lock_nested(d_inode(dentry), I_MUTEX_XATTR); in reiserfs_xattr_set_handle()
600 inode_dio_wait(d_inode(dentry)); in reiserfs_xattr_set_handle()
602 err = reiserfs_setattr(&nop_mnt_idmap, dentry, &newattrs); in reiserfs_xattr_set_handle()
603 inode_unlock(d_inode(dentry)); in reiserfs_xattr_set_handle()
608 dput(dentry); in reiserfs_xattr_set_handle()
655 struct dentry *dentry; in reiserfs_xattr_get() local
679 dentry = xattr_lookup(inode, name, XATTR_REPLACE); in reiserfs_xattr_get()
680 if (IS_ERR(dentry)) { in reiserfs_xattr_get()
681 err = PTR_ERR(dentry); in reiserfs_xattr_get()
687 isize = i_size_read(d_inode(dentry)); in reiserfs_xattr_get()
710 page = reiserfs_get_page(d_inode(dentry), file_pos); in reiserfs_xattr_get()
755 dput(dentry); in reiserfs_xattr_get()
776 struct dentry *dentry) in reiserfs_posix_acl_list() argument
779 IS_POSIXACL(d_backing_inode(dentry)); in reiserfs_posix_acl_list()
784 const char *name, struct dentry *dentry) in reiserfs_xattr_list() argument
795 if (!xattr_handler_can_list(xah, dentry)) in reiserfs_xattr_list()
802 return reiserfs_posix_acl_list(name, dentry); in reiserfs_xattr_list()
810 struct dentry *dentry; member
823 if (!reiserfs_xattr_list(b->dentry->d_sb->s_xattr, name, in listxattr_filler()
824 b->dentry)) in listxattr_filler()
847 ssize_t reiserfs_listxattr(struct dentry * dentry, char *buffer, size_t size) in reiserfs_listxattr() argument
849 struct dentry *dir; in reiserfs_listxattr()
853 .dentry = dentry, in reiserfs_listxattr()
858 if (d_really_is_negative(dentry)) in reiserfs_listxattr()
861 if (get_inode_sd_version(d_inode(dentry)) == STAT_DATA_V1) in reiserfs_listxattr()
864 dir = open_xa_dir(d_inode(dentry), XATTR_REPLACE); in reiserfs_listxattr()
884 static int create_privroot(struct dentry *dentry) in create_privroot() argument
887 struct inode *inode = d_inode(dentry->d_parent); in create_privroot()
891 err = xattr_mkdir(inode, dentry, 0700); in create_privroot()
892 if (err || d_really_is_negative(dentry)) { in create_privroot()
893 reiserfs_warning(dentry->d_sb, "jdm-20006", in create_privroot()
900 reiserfs_init_priv_inode(d_inode(dentry)); in create_privroot()
901 reiserfs_info(dentry->d_sb, "Created %s - reserved for xattr " in create_privroot()
910 static int create_privroot(struct dentry *dentry) { return 0; } in create_privroot() argument
961 static int xattr_hide_revalidate(struct dentry *dentry, unsigned int flags) in xattr_hide_revalidate() argument
972 struct dentry *dentry; in reiserfs_lookup_privroot() local
977 dentry = lookup_one_len(PRIVROOT_NAME, s->s_root, in reiserfs_lookup_privroot()
979 if (!IS_ERR(dentry)) { in reiserfs_lookup_privroot()
980 REISERFS_SB(s)->priv_root = dentry; in reiserfs_lookup_privroot()
981 d_set_d_op(dentry, &xattr_lookup_poison_ops); in reiserfs_lookup_privroot()
982 if (d_really_is_positive(dentry)) in reiserfs_lookup_privroot()
983 reiserfs_init_priv_inode(d_inode(dentry)); in reiserfs_lookup_privroot()
985 err = PTR_ERR(dentry); in reiserfs_lookup_privroot()
999 struct dentry *privroot = REISERFS_SB(s)->priv_root; in reiserfs_xattr_init()
1014 struct dentry *dentry; in reiserfs_xattr_init() local
1016 dentry = lookup_one_len(XAROOT_NAME, privroot, in reiserfs_xattr_init()
1018 if (!IS_ERR(dentry)) in reiserfs_xattr_init()
1019 REISERFS_SB(s)->xattr_root = dentry; in reiserfs_xattr_init()
1021 err = PTR_ERR(dentry); in reiserfs_xattr_init()