hope you can help me: I m trying to determine whether the device is removable or not, all i have is device name (/dev/sdc). Actually, I need to determine when the file on removable media or on local disk by full path of this file.
I ve tryed to search in the current->fs->pwd and all I could find is a set of flags here: *current->fs->pwd.mnt->mnt_sb->s_bdev->bd_disk->flags* where GENHD_FL_REMOVABLE set for removable devices
But i always get the same flags set (as i understand, s_bdev always points to the same device (/dev/sda)).
因此,现在我拿着包含我档案的装置名称(dev/sdc),但现在仍然可以发现,可以去除。
Is there possible way to get block_device structure by device name? (for example, "file" structure may be obtained by calling fd = open("name") fl = fged(fd) where fl points to "file" structure)