Re: Linux Kernel readlink equivalent

2015-01-30 Thread David Legault
On Thu, Jan 29, 2015 at 2:37 PM, Greg KH g...@kroah.com wrote: On Thu, Jan 29, 2015 at 01:11:13PM -0500, David Legault wrote: Hello, I'm working on some linux kernel driver stuff and I have a fake path called / dev/blah/whatever that points to /dev/block/real_device. That's a

Re: Linux Kernel readlink equivalent

2015-01-30 Thread Greg KH
On Fri, Jan 30, 2015 at 11:02:01AM -0500, David Legault wrote: The path used is generic in that it never changes, but the pointed block device underneath changes based on the hardware/configuration in place. So the idea was to load a module passing the path as a module argument so I could

Linux Kernel readlink equivalent

2015-01-29 Thread David Legault
Hello, I'm working on some linux kernel driver stuff and I have a fake path called /dev/blah/whatever that points to /dev/block/real_device. The issue is that lookup_bdev will fail to follow the symlink so I'd like to massage the path upfront by getting the real path (/dev/block/real_device) so

Re: Linux Kernel readlink equivalent

2015-01-29 Thread Valdis . Kletnieks
On Thu, 29 Jan 2015 13:11:13 -0500, David Legault said: I'm working on some linux kernel driver stuff and I have a fake path called /dev/blah/whatever that points to /dev/block/real_device. And *why* is kernel code trying to follow a symlink, anyhow? (Hint: there's probably (a) data you want

Re: Linux Kernel readlink equivalent

2015-01-29 Thread Greg KH
On Thu, Jan 29, 2015 at 01:11:13PM -0500, David Legault wrote: Hello, I'm working on some linux kernel driver stuff and I have a fake path called / dev/blah/whatever that points to /dev/block/real_device. That's a userspace path, right? Why would the kernel care about this? The issue is

Re: Linux Kernel readlink equivalent

2015-01-29 Thread Aruna Hewapathirane
Hello, I'm working on some linux kernel driver stuff and I have a fake path called /dev/blah/whatever that points to /dev/block/real_device. The issue is that lookup_bdev will fail to follow the symlink so I'd like to massage the path upfront by getting the real path