Re: [PATCH][RFC] %pd - for printing dentry name

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Feb 02, 2010 at 06:32:31AM -0700, Matthew Wilcox wrote:
> How about doing this:
> 
>  struct qstr {
> -	const unsigned char *name;
> +	const unsigned char name[0];
>  }
> 
>  struct dentry {
> -	struct qstr d_name;
> +	struct qstr *d_name;
> -	unsigned char d_iname[DNAME_INLINE_LEN_MIN];    /* small names */
> +	union {
> +		struct qstr d_iname;
> +		char pad[DNAME_INLINE_LEN_MIN];
> +	};
>  }
> 
> Doesn't increase the size of struct dentry, and puts the hash and len
> with the name.  Increases long name allocations by 8 bytes each.
> 
> I think reusing the d_iname is OK.  As long as we always limit the
> number of characters printed to the 'len' element, we should never get
> an overrun.  At worst, we get a mixture of the previous name and the
> next name ... and that's a significant canary in itself.

You are creating an extra deref in normal case.  Inline names are common.
Putting len and hash with the name probably not a win - most of the time
you don't look at actual characters and rely on mismatches in other
components to skip the candidate during search.
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux