lkml.org 
[lkml]   [2007]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch] epoll use a single inode ...
On Tue, 6 Mar 2007, Avi Kivity wrote:

> > /* File callbacks that implement the eventpoll file behaviour */
> > static const struct file_operations eventpoll_fops = {
> > .release = ep_eventpoll_close,
> > @@ -763,15 +767,18 @@
> > * using the inode number.
> > */
> > error = -ENOMEM;
> > - sprintf(name, "[%lu]", inode->i_ino);
> > + sprintf(name, "[%p]", ep);
> > this.name = name;
> > this.len = strlen(name);
> > - this.hash = inode->i_ino;
> > + this.hash = 0;
> > dentry = d_alloc(eventpoll_mnt->mnt_sb->s_root, &this);
> > if (!dentry)
> > goto eexit_4;
> > dentry->d_op = &eventpollfs_dentry_operations;
> > - d_add(dentry, inode);
> > + /* Do not publish this dentry inside the global dentry hash table */
> > + dentry->d_flags &= ~DCACHE_UNHASHED;
> > + d_instantiate(dentry, inode);
> > +
> >
>
> I've used d_alloc_anon() in similar code in kvmfs. You lose the ep
> pointer in the name, but as a kernel address it isn't particularly
> useful to userspace.

That ends up calling two times the find alias for an unhashed dentry, no?
And this linearly scans the inode's dentry list, no?



- Davide


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-03-06 08:31    [W:0.029 / U:0.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site