On 7 Sep 2015 23:25, <Valdis.Kletnieks@xxxxxx> wrote:
>
> On Mon, 07 Sep 2015 12:10:56 +0530, Pria Mn said:
>
> > return valid dentry value. My requirement is to fetch directory name from
> > filepath.
>
> First off, unless this is a class assignment, your *requirement* isn't
> to fetch a directory name.
>
> Fetching the directory name is a *solution* you're thinking of using for
> a problem you're trying to solve.
>
> So take a step back, and explain what you're trying to do, and why you thought
> getting the directory name from filepath was a solution - it's quite
> likely that you should be using some other API and approach entirely.
>
> (I'd estimate that 75% of the "I can't get this API to work" questions
> on the Linux kernel are because the person should be using a different API....)
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies@xxxxxxxxxxxxxxxxx
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
Yes Valdis is absolutely right about being clear as to what you want to do and why you would be doing that. Also for what does the api do you need to understand the code and browse using tools(cscope ctags maybe others) to check for other APIs doing the same and you would definitely find one for your need.
The way I would suggest is don't rush through, enjoy the process and not the result.
Enjoy life,
Rohan
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@xxxxxxxxxxxxxxxxx http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies