File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed
Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -29,17 +29,18 @@ static void strbufAppendMountPoint(FFstrbuf* mountpoint, const char* source)
2929}
3030
3131#ifndef __ANDROID__
32- static bool isSubvolume (const char * options )
32+ static bool isSubvolume (const FFlist * allDisks , const FFDisk * currentDisk )
3333{
34- const char * prefix = "subvol=/@" ; //Btrfs subvolume
35- const char * subvolume = strstr ( options , prefix );
36- if (subvolume == NULL )
37- return false ;
34+ FF_LIST_FOR_EACH ( FFDisk , disk , * allDisks )
35+ {
36+ if (disk == currentDisk )
37+ continue ;
3838
39- subvolume += strlen (prefix );
39+ if (ffStrbufEqual (& disk -> mountpoint , & currentDisk -> mountpoint ))
40+ return true;
41+ }
4042
41- //If there is no space or comma after the @, it is a btrfs subvolume
42- return * subvolume != ' ' && * subvolume != ',' ;
43+ return false;
4344}
4445#endif
4546
@@ -104,7 +105,7 @@ void ffDetectDisksImpl(FFDiskResult* disks)
104105 else
105106 disk -> type = FF_DISK_TYPE_HIDDEN ;
106107 #else
107- if (isSubvolume (currentPos ))
108+ if (isSubvolume (& disks -> disks , disk ))
108109 disk -> type = FF_DISK_TYPE_SUBVOLUME ;
109110 else if (strstr (currentPos , "nosuid" ) != NULL || strstr (currentPos , "nodev" ) != NULL )
110111 disk -> type = FF_DISK_TYPE_EXTERNAL ;
You can’t perform that action at this time.
0 commit comments