示例#1
0
文件: onloadfs.c 项目: ido/openonload
/* Re-target existing file to the new endpoint.
 * Caller is responsible for refcounts of the old and the new thr. */
void
oo_move_file(ci_private_t* priv, tcp_helper_resource_t *new_thr,
             oo_sp new_sockid)
{
  priv->thr = new_thr;
  priv->sock_id = new_sockid;
#ifndef EFX_HAVE_D_DNAME
  {
    /* tell everybody that we've changed the name.
     * Assume the name is short (DNAME_INLINE_LEN_MIN=36). */
    struct dentry *dentry = priv->_filp->f_dentry;
    if( dname_external(dentry) ) {
      /* We do not want to handle memory free/allocation,
       * so just go out.
       * Unlucky user gets incorrect name in /proc - it is much better
       * than memory corruption. */
      return;
    }
    d_drop(dentry);
    dentry->d_name.len = onloadfs_name(priv, dentry->d_iname,
                                       sizeof(dentry->d_iname));
    d_rehash(dentry);
  }
#endif
}
示例#2
0
static inline void d_free(struct dentry *dentry)
{
	if (dentry->d_op && dentry->d_op->d_release)
		dentry->d_op->d_release(dentry);
	if (dname_external(dentry)) 
		kfree(dentry->d_name.name);
	kmem_cache_free(dentry_cache, dentry); 
}