Lines Matching refs:dentry

66 static int xattr_create(struct inode *dir, struct dentry *dentry, int mode)  in xattr_create()  argument
69 return dir->i_op->create(&init_user_ns, dir, dentry, mode, true); in xattr_create()
73 static int xattr_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) in xattr_mkdir() argument
76 return dir->i_op->mkdir(&init_user_ns, dir, dentry, mode); in xattr_mkdir()
85 static int xattr_unlink(struct inode *dir, struct dentry *dentry) in xattr_unlink() argument
91 inode_lock_nested(d_inode(dentry), I_MUTEX_CHILD); in xattr_unlink()
92 error = dir->i_op->unlink(dir, dentry); in xattr_unlink()
93 inode_unlock(d_inode(dentry)); in xattr_unlink()
96 d_delete(dentry); in xattr_unlink()
100 static int xattr_rmdir(struct inode *dir, struct dentry *dentry) in xattr_rmdir() argument
106 inode_lock_nested(d_inode(dentry), I_MUTEX_CHILD); in xattr_rmdir()
107 error = dir->i_op->rmdir(dir, dentry); in xattr_rmdir()
109 d_inode(dentry)->i_flags |= S_DEAD; in xattr_rmdir()
110 inode_unlock(d_inode(dentry)); in xattr_rmdir()
112 d_delete(dentry); in xattr_rmdir()
119 static struct dentry *open_xa_root(struct super_block *sb, int flags) in open_xa_root()
121 struct dentry *privroot = REISERFS_SB(sb)->priv_root; in open_xa_root()
122 struct dentry *xaroot; in open_xa_root()
147 static struct dentry *open_xa_dir(const struct inode *inode, int flags) in open_xa_dir()
149 struct dentry *xaroot, *xadir; in open_xa_dir()
186 struct dentry *xadir;
189 struct dentry *dentries[8];
198 struct dentry *dentry; in fill_with_dentries() local
209 dentry = lookup_one_len(name, dbuf->xadir, namelen); in fill_with_dentries()
210 if (IS_ERR(dentry)) { in fill_with_dentries()
211 dbuf->err = PTR_ERR(dentry); in fill_with_dentries()
212 return PTR_ERR(dentry); in fill_with_dentries()
213 } else if (d_really_is_negative(dentry)) { in fill_with_dentries()
215 reiserfs_error(dentry->d_sb, "xattr-20003", in fill_with_dentries()
218 dentry, dbuf->xadir); in fill_with_dentries()
219 dput(dentry); in fill_with_dentries()
224 dbuf->dentries[dbuf->count++] = dentry; in fill_with_dentries()
239 int (*action)(struct dentry *, void *), in reiserfs_for_each_xattr() argument
242 struct dentry *dir; in reiserfs_for_each_xattr()
275 struct dentry *dentry = buf.dentries[i]; in reiserfs_for_each_xattr() local
277 if (!d_is_dir(dentry)) in reiserfs_for_each_xattr()
278 err = action(dentry, data); in reiserfs_for_each_xattr()
280 dput(dentry); in reiserfs_for_each_xattr()
332 static int delete_one_xattr(struct dentry *dentry, void *data) in delete_one_xattr() argument
334 struct inode *dir = d_inode(dentry->d_parent); in delete_one_xattr()
337 if (d_is_dir(dentry)) in delete_one_xattr()
338 return xattr_rmdir(dir, dentry); in delete_one_xattr()
340 return xattr_unlink(dir, dentry); in delete_one_xattr()
343 static int chown_one_xattr(struct dentry *dentry, void *data) in chown_one_xattr() argument
355 err = reiserfs_setattr(&init_user_ns, dentry, attrs); in chown_one_xattr()
389 static struct dentry *xattr_lookup(struct inode *inode, const char *name, in xattr_lookup()
392 struct dentry *xadir, *xafile; in xattr_lookup()
487 struct dentry *dentry, *xadir; in lookup_and_delete_xattr() local
494 dentry = lookup_one_len(name, xadir, strlen(name)); in lookup_and_delete_xattr()
495 if (IS_ERR(dentry)) { in lookup_and_delete_xattr()
496 err = PTR_ERR(dentry); in lookup_and_delete_xattr()
500 if (d_really_is_positive(dentry)) { in lookup_and_delete_xattr()
501 err = xattr_unlink(d_inode(xadir), dentry); in lookup_and_delete_xattr()
505 dput(dentry); in lookup_and_delete_xattr()
524 struct dentry *dentry; in reiserfs_xattr_set_handle() local
540 dentry = xattr_lookup(inode, name, flags); in reiserfs_xattr_set_handle()
541 if (IS_ERR(dentry)) in reiserfs_xattr_set_handle()
542 return PTR_ERR(dentry); in reiserfs_xattr_set_handle()
557 page = reiserfs_get_page(d_inode(dentry), file_pos); in reiserfs_xattr_set_handle()
597 if (!err && new_size < i_size_read(d_inode(dentry))) { in reiserfs_xattr_set_handle()
604 inode_lock_nested(d_inode(dentry), I_MUTEX_XATTR); in reiserfs_xattr_set_handle()
605 inode_dio_wait(d_inode(dentry)); in reiserfs_xattr_set_handle()
607 err = reiserfs_setattr(&init_user_ns, dentry, &newattrs); in reiserfs_xattr_set_handle()
608 inode_unlock(d_inode(dentry)); in reiserfs_xattr_set_handle()
613 dput(dentry); in reiserfs_xattr_set_handle()
660 struct dentry *dentry; in reiserfs_xattr_get() local
684 dentry = xattr_lookup(inode, name, XATTR_REPLACE); in reiserfs_xattr_get()
685 if (IS_ERR(dentry)) { in reiserfs_xattr_get()
686 err = PTR_ERR(dentry); in reiserfs_xattr_get()
692 isize = i_size_read(d_inode(dentry)); in reiserfs_xattr_get()
715 page = reiserfs_get_page(d_inode(dentry), file_pos); in reiserfs_xattr_get()
760 dput(dentry); in reiserfs_xattr_get()
804 struct dentry *dentry; member
819 handler = find_xattr_handler_prefix(b->dentry->d_sb->s_xattr, in listxattr_filler()
822 (handler->list && !handler->list(b->dentry))) in listxattr_filler()
845 ssize_t reiserfs_listxattr(struct dentry * dentry, char *buffer, size_t size) in reiserfs_listxattr() argument
847 struct dentry *dir; in reiserfs_listxattr()
851 .dentry = dentry, in reiserfs_listxattr()
856 if (d_really_is_negative(dentry)) in reiserfs_listxattr()
859 if (get_inode_sd_version(d_inode(dentry)) == STAT_DATA_V1) in reiserfs_listxattr()
862 dir = open_xa_dir(d_inode(dentry), XATTR_REPLACE); in reiserfs_listxattr()
882 static int create_privroot(struct dentry *dentry) in create_privroot() argument
885 struct inode *inode = d_inode(dentry->d_parent); in create_privroot()
889 err = xattr_mkdir(inode, dentry, 0700); in create_privroot()
890 if (err || d_really_is_negative(dentry)) { in create_privroot()
891 reiserfs_warning(dentry->d_sb, "jdm-20006", in create_privroot()
898 d_inode(dentry)->i_flags |= S_PRIVATE; in create_privroot()
899 d_inode(dentry)->i_opflags &= ~IOP_XATTR; in create_privroot()
900 reiserfs_info(dentry->d_sb, "Created %s - reserved for xattr " in create_privroot()
909 static int create_privroot(struct dentry *dentry) { return 0; } in create_privroot() argument
964 static int xattr_hide_revalidate(struct dentry *dentry, unsigned int flags) in xattr_hide_revalidate() argument
975 struct dentry *dentry; in reiserfs_lookup_privroot() local
980 dentry = lookup_one_len(PRIVROOT_NAME, s->s_root, in reiserfs_lookup_privroot()
982 if (!IS_ERR(dentry)) { in reiserfs_lookup_privroot()
983 REISERFS_SB(s)->priv_root = dentry; in reiserfs_lookup_privroot()
984 d_set_d_op(dentry, &xattr_lookup_poison_ops); in reiserfs_lookup_privroot()
985 if (d_really_is_positive(dentry)) { in reiserfs_lookup_privroot()
986 d_inode(dentry)->i_flags |= S_PRIVATE; in reiserfs_lookup_privroot()
987 d_inode(dentry)->i_opflags &= ~IOP_XATTR; in reiserfs_lookup_privroot()
990 err = PTR_ERR(dentry); in reiserfs_lookup_privroot()
1004 struct dentry *privroot = REISERFS_SB(s)->priv_root; in reiserfs_xattr_init()
1019 struct dentry *dentry; in reiserfs_xattr_init() local
1021 dentry = lookup_one_len(XAROOT_NAME, privroot, in reiserfs_xattr_init()
1023 if (!IS_ERR(dentry)) in reiserfs_xattr_init()
1024 REISERFS_SB(s)->xattr_root = dentry; in reiserfs_xattr_init()
1026 err = PTR_ERR(dentry); in reiserfs_xattr_init()