This commit is contained in:
Alastair Tse committed 2006-11-09 13:18:58 +00:00
commit 4b7d8cd407
3 files changed
+112 -36

No files matched your search

+9 -2
View File
@@ -23,8 +23,15 @@ def blkdev_name_to_number(name):
except Exception, ex:
pass
if re.match( '/dev/sd[a-p]([1-9]|1[0-5])?', n):
return 8 * 256 + 16 * (ord(n[7:8]) - ord('a')) + int(n[8:] or 0)
scsi_major = [ 8, 65, 66, 67, 68, 69, 70, 71, 128, 129, 130, 131, 132, 133, 134, 135 ]
if re.match( '/dev/sd[a-z]([1-9]|1[0-5])?$', n):
major = scsi_major[(ord(n[7:8]) - ord('a')) / 16]
minor = ((ord(n[7:8]) - ord('a')) % 16) * 16 + int(n[8:] or 0)
return major * 256 + minor
if re.match( '/dev/sd[a-i][a-z]([1-9]|1[0-5])?$', n):
major = scsi_major[((ord(n[7:8]) - ord('a') + 1) * 26 + (ord(n[8:9]) - ord('a'))) / 16 ]
minor = (((ord(n[7:8]) - ord('a') + 1 ) * 26 + (ord(n[8:9]) - ord('a'))) % 16) * 16 + int(n[9:] or 0)
return major * 256 + minor
if re.match( '/dev/hd[a-t]([1-9]|[1-5][0-9]|6[0-3])?', n):
ide_majors = [ 3, 22, 33, 34, 56, 57, 88, 89, 90, 91 ]
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.