On 16-Jun-2017 11:21 AM, "Shrikant Giridhar" <[email protected]> wrote:
I'm a little confused about how the mount_bdev() call works. The VFS documentation lists it as a generic method to mount a block device. Based on what I understood from the source, it seems to open a block device whose path is passed via the mount() syscall and later associates it with the superblock, finally returning the corresponding dentry to the caller. The documentation also mentions that mount() can return a subtree of an existing filesystem on the block device. However, in the very next line it mentions that the caller also receives a pointer to the dentry of the root node. I can see from the source (fs/super.c:1099) that the mount_bdev call does check if the superblock's s_root == NULL or not and proceeds to set a new superblock if it is. I know my question sounds a little vague but I'm having trouble understanding how mount() can return a dentry for something other than the root? --- Shrikant _______________________________________________ Kernelnewbies mailing list [email protected] https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies Hi Shrikant, I just had a quick look at mount_bdev() code for Linux v3.15, mount_bdev() can return only root dentry or error. Also please include the kernel version to which you are referring. - Rohan
_______________________________________________ Kernelnewbies mailing list [email protected] https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
