On Mon, Sep 1, 2014 at 9:40 AM, <Valdis.Kletnieks@xxxxxx> wrote: > On Sat, 30 Aug 2014 10:41:16 +0530, Joshi said: >> I am trying to obtain file name at block layer level (above IO scheduler). > > Nope. Won't work. There is no single unique name for a file. > > Consider: > > touch a > ln a b > > There's now 2 names for the same inode. Yes, I ignore hard-link case. No harm. > And why should the block level care about the file name, anyhow? It doesn't > even know if it's a file or metadata... or even if there's a filesystem > on the partition at all..... I do this only when I know that I am working on a partition which has filesystem If it's metadata, file name is not associated with it. Either I would find inode or dentry as NULL, that's all. I just want to eliminate the possibility of crash while accessing inode/dentry if it exists. -- Joshi _______________________________________________ Kernelnewbies mailing list Kernelnewbies@xxxxxxxxxxxxxxxxx http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies