Re: [PATCH RFCv2 1/3] fs: introduce helper d_path_fast()

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

 



On Fri, May 28, 2021 at 07:39:49PM +0800, Jia He wrote:

> +/**
> + * d_path_fast - fast return the full path of a dentry without taking
> + * any seqlock/spinlock. This helper is typical for debugging purpose
> + */
> +char *d_path_fast(const struct path *path, char *buf, int buflen)
> +{
> +	struct path root;
> +	struct mount *mnt = real_mount(path->mnt);
> +	DECLARE_BUFFER(b, buf, buflen);
> +
> +	rcu_read_lock();
> +	get_fs_root_rcu(current->fs, &root);
> +
> +	prepend(&b, "", 1);
> +	__prepend_path(path->dentry, mnt, &root, &b);
> +	rcu_read_unlock();
> +
> +	return extract_string(&b);
> +}
> +EXPORT_SYMBOL(d_path_fast);

Umm...  I'd suggest failing if __prepend_path() returns 3 (at least)...



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux