Lines Matching defs:dentry

28  * eventfs_mutex protects the eventfs_inode (ei) dentry. Any access
29 * to the ei->dentry must be done under this mutex and after checking
30 * if ei->is_freed is not set. When ei->is_freed is set, the dentry
40 struct dentry *events_dir;
98 * form 'dentry->d_fsdata'. There are also references from
99 * directory inodes ('ti->private'), but the dentry reference
151 static struct dentry *eventfs_root_lookup(struct inode *dir,
152 struct dentry *dentry,
175 static int eventfs_set_attr(struct mnt_idmap *idmap, struct dentry *dentry,
184 ei = dentry->d_fsdata;
190 if (!(dentry->d_inode->i_mode & S_IFDIR)) {
199 ret = simple_setattr(idmap, dentry, iattr);
208 if (dentry->d_inode->i_mode & S_IFDIR) {
214 name = dentry->d_name.name;
319 static struct inode *eventfs_get_inode(struct dentry *dentry, struct eventfs_attr *attr,
327 inode = tracefs_get_inode(dentry->d_sb);
335 /* Find the top dentry that holds the "events" directory */
337 dentry = dentry->d_parent;
339 pei = dentry->d_fsdata;
352 * @dentry: the dentry to look up
358 * This function creates a dentry that represents a file in the eventsfs_inode
362 static struct dentry *lookup_file(struct eventfs_inode *parent_ei,
363 struct dentry *dentry,
378 inode = eventfs_get_inode(dentry, attr, mode, NULL);
390 dentry->d_fsdata = get_ei(parent_ei);
392 return d_splice_alias(inode, dentry);
397 * @dentry: the directory to look up
401 * This function will look up a dentry for a directory represented by
404 static struct dentry *lookup_dir_entry(struct dentry *dentry,
410 inode = eventfs_get_inode(dentry, &ei->attr, mode, ei);
420 dentry->d_fsdata = get_ei(ei);
422 return d_splice_alias(inode, dentry);
466 * eventfs_d_release - dentry is going away
467 * @dentry: dentry which has the reference to remove.
469 * Remove the association between a dentry from an eventfs_inode.
471 void eventfs_d_release(struct dentry *dentry)
473 put_ei(dentry->d_fsdata);
477 * lookup_file_dentry - create a dentry for a file of an eventfs_inode
478 * @dentry: The parent dentry under which the new file's dentry will be created
485 * This function creates a dentry for a file associated with an
490 * Return: Returns a pointer to the newly created file's dentry or an error
493 static struct dentry *
494 lookup_file_dentry(struct dentry *dentry,
504 return lookup_file(ei, dentry, mode, attr, data, fops);
510 * @dentry: file/dir dentry
514 * list, if @dentry found go ahead and create the file/dir
517 static struct dentry *eventfs_root_lookup(struct inode *dir,
518 struct dentry *dentry,
524 const char *name = dentry->d_name.name;
542 return lookup_dir_entry(dentry, ei, ei_child);
558 return lookup_file_dentry(dentry, ei, i, mode, data, fops);
722 * @parent: Parent dentry for this file in the tracefs directory.
731 struct eventfs_inode *eventfs_create_events_dir(const char *name, struct dentry *parent,
735 struct dentry *dentry;
746 dentry = tracefs_start_creating(name, parent);
747 if (IS_ERR(dentry))
748 return ERR_CAST(dentry);
754 inode = tracefs_get_inode(dentry->d_sb);
758 // Note: we have a ref to the dentry from tracefs_start_creating()
760 rei->events_dir = dentry;
767 uid = d_inode(dentry->d_parent)->i_uid;
768 gid = d_inode(dentry->d_parent)->i_gid;
790 dentry->d_fsdata = get_ei(ei);
794 * Due to the dynamic nature of the dentry creations and not
801 d_make_persistent(dentry, inode);
802 /* The dentry of the "events" parent does keep track though */
803 inc_nlink(dentry->d_parent->d_inode);
804 fsnotify_mkdir(dentry->d_parent->d_inode, dentry);
805 tracefs_end_creating(dentry);
811 tracefs_failed_creating(dentry);
869 struct dentry *dentry;
872 dentry = rei->events_dir;
873 if (!dentry)
881 * in eventfs_create_events_dir() when it the dentry was
882 * created. In other words, it's a normal dentry that
883 * sticks around while the other ei->dentry are created
886 d_invalidate(dentry);
887 d_make_discardable(dentry);