LINUX下最大同时支持多少个U盘 (高分求救)

qq277541717 2014-05-19 11:08:24
最近项目需要支持50个U盘同时插入使用, 在linux下, 找了些资料说是支持sd[a..p], 不知道此说法对不对???
LINUX下最大同时支持多少个U盘??? 如何突破a-z的限制???


...全文
336 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
qq277541717 2014-06-25
  • 打赏
  • 举报
回复
一定给分...
senioryzc 2014-06-25
  • 打赏
  • 举报
回复
人家 6 楼不是回答了么,即使你懒得看代码,看下注释也可以啊 * SCSI disk names starts at sda. The 26th device is sdz and the * 27th is sdaa. The last one for two lettered suffix is sdzz * which is followed by sdaaa.
qq277541717 2014-06-25
  • 打赏
  • 举报
回复
始终没有结果, 反正是多U盘.
yulinlang 2014-05-26
  • 打赏
  • 举报
回复

/**
 *	sd_format_disk_name - format disk name
 *	@prefix: name prefix - ie. "sd" for SCSI disks
 *	@index: index of the disk to format name for
 *	@buf: output buffer
 *	@buflen: length of the output buffer
 *
 *	SCSI disk names starts at sda.  The 26th device is sdz and the
 *	27th is sdaa.  The last one for two lettered suffix is sdzz
 *	which is followed by sdaaa.
 *
 *	This is basically 26 base counting with one extra 'nil' entry
 *	at the beginning from the second digit on and can be
 *	determined using similar method as 26 base conversion with the
 *	index shifted -1 after each digit is computed.
 *
 *	CONTEXT:
 *	Don't care.
 *
 *	RETURNS:
 *	0 on success, -errno on failure.
 */
static int sd_format_disk_name(char *prefix, int index, char *buf, int buflen)
{
	const int base = 'z' - 'a' + 1;
	char *begin = buf + strlen(prefix);
	char *end = buf + buflen;
	char *p;
	int unit;

	p = end - 1;
	*p = '\0';
	unit = base;
	do {
		if (p == begin)
			return -EINVAL;
		*--p = 'a' + (index % unit);
		index = (index / unit) - 1;
	} while (index >= 0);

	memmove(begin, p, end - p);
	memcpy(buf, prefix, strlen(prefix));

	return 0;
}
c_sdn_shang_bu_qi 2014-05-26
  • 打赏
  • 举报
回复
我去,工业计算机吗?要求这么搞笑 你以为插的多就爽了吗
FancyMouse 2014-05-22
  • 打赏
  • 举报
回复
sdz后面不是sdaa么
LouisScola 2014-05-22
  • 打赏
  • 举报
回复
确实奇葩,插个硬盘不行吗
GrubLinux 2014-05-22
  • 打赏
  • 举报
回复
为什么会有这么奇葩的需求
qq277541717 2014-05-21
  • 打赏
  • 举报
回复
同求.........
qq277541717 2014-05-19
  • 打赏
  • 举报
回复
坐等......

4,436

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 内核源代码研究区
社区管理员
  • 内核源代码研究区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧