BBS水木清华站∶精华区
发信人: yuhj (勇 梦回唐朝), 信区: Linux
标 题: Re: 急问,怎么支持large-file(>2G)
发信站: BBS 水木清华站 (Wed Jan 26 18:09:51 2000)
最近在kerneltraffic上看到的讨论,我的印象是ext2fs修改为64bit
指针困难不大,但是off_t修改为64bit有很大困难,好像还根POSIX
的定义不严谨有关。具体的细节没有留心,只是个印象, I could
be wrong.
嗯,下面是原文的讨论:
> - why is there a 2G limit?
This should go into some FAQ/HOWTO ...
The limit comes from this line in <linux/ext2_fs.h>
__u32 i_size; /* Size in bytes */
> - can the 2G limit be _safely_ increased (to, say, about 5G)?
> - if so, what changes are needed in the ext2 code to do it?
You cannot safely change this to __u64, as you'll break the lay-out of
struct ext2_inode, then. About the best proposal I've seen is the one
of Albert Cahalan. You can use another 16 of the reserved bits to go
to an 48 bit inode size. You'd have to make sure you don't use
anything that's used by another system already.
I don't recall the details. One possibility is to recycle the fields
for the currently unimplemented fragmentation support, which would
give you enough free bits. Apart from this, it seems the Hurd already
occupies everything else.
In order to do this safely, you would have to mark the filesystem
with one of the incompatible flags (s_feature_incompat), and then
support the other size bits all over the place.
Good luck,
Martin
【 在 kxn (烤小牛~信号没糊系统糊了!) 的大作中提到: 】
∶ linux 好像是 ext2fs 的限制吧, 如果 > 2G 有人说会 crash 掉
∶ lseek 用的是 off_t , 还是留了一手的,
--
聚散无常,
得失随缘。
※ 修改:·yuhj 於 Jan 26 18:18:00 修改本文·[FROM: 202.204.7.235]
※ 来源:·BBS 水木清华站 smth.org·[FROM: 202.204.7.235]
BBS水木清华站∶精华区