Главная страница


ru.linux

 
 - RU.LINUX ---------------------------------------------------------------------
 From : Alexander Lubyagin                   2:5056/16.70   08 Jan 2005  13:25:34
 To : Fedor Lizunkov
 Subject : /dev/loop
 -------------------------------------------------------------------------------- 
 
 08 Jan 05 00:32, you wrote to Sergei Dubarev:
 FL>>> Jan  7 18:54:53 slack kernel: attempt to access beyond end of
 FL>>> device Jan  7 18:54:53 slack kernel: loop0: rw=0, want=15727264,
 FL>>> limit=8388604
 
 SD>> [skip]
 
 FL> А ограничение на размер /dev/loop0 не может быть (ну мало ли)?
 
 % bc
 8388604*512
 4294965248
 15727264*512
 8052359168
 scale=12
 15727264/8388604
 1.874836862009
 2^32
 4294967296
 
 Очевидно, что это - ограничение 2^32 с точностью до размера страницы
 виртуальной памяти, 4096 байт при попытке доступа к байту номер 8052359168
 (видимо, диск двухслойный).
 
 Ограничений со стороны ext2 нет -
 /usr/src/linux-2.4.23/Documentation/filesystems/ext2.txt
 -----------
 Limitations
 -----------
 
 There are various limits imposed by the on-disk layout of ext2.  Other
 limits are imposed by the current implementation of the kernel code.
 Many of the limits are determined at the time the filesystem is first
 created, and depend upon the block size chosen.  The ratio of inodes to
 data blocks is fixed at filesystem creation time, so the only way to
 increase the number of inodes is to increase the size of the filesystem.
 No tools currently exist which can change the ratio of inodes to blocks.
 
 Most of these limits could be overcome with slight changes in the on-disk
 format and using a compatibility flag to signal the format change (at
 the expense of some compatibility).
 
 Filesystem block size:     1kB        2kB        4kB        8kB
 
 File size limit:          16GB      256GB     2048GB     2048GB
 Filesystem size limit:  2047GB     8192GB    16384GB    32768GB
 
 There is a 2.4 kernel limit of 2048GB for a single block device, so no
 filesystem larger than that can be created at this time.  There is also
 an upper limit on the block size imposed by the page size of the kernel,
 so 8kB blocks are only allowed on Alpha systems (and other architectures
 which support larger pages).
 
 There is an upper limit of 32768 subdirectories in a single directory.
 
 There is a "soft" upper limit of about 10-15k files in a single directory
 with the current linear linked-list directory implementation.  This limit
 stems from performance problems when creating and deleting (and also
 finding) files in such large directories.  Using a hashed directory index
 (under development) allows 100k-1M+ files in a single directory without
 performance problems (although RAM size becomes an issue at this point).
 
 The (meaningless) absolute upper limit of files in a single directory
 (imposed by the file size, the realistic limit is obviously much less)
 is over 130 trillion files.  It would be higher except there are not
 enough 4-character names to make up unique directory entries, so they
 have to be 8 character filenames, even then we are fairly close to
 running out of unique filenames.
 -----------
 
 Однако, исходник drivers/block/loop.c содержит код такого типа:
 -----------
 #include <linux/fs.h>
  ....
 
 #define MAX_DISK_SIZE 1024*1024*1024
 
 static int compute_loop_size(struct loop_device *lo, struct dentry * lo_dentry, 
 kdev_t lodev)
 {
         if (S_ISREG(lo_dentry->d_inode->i_mode))
                 return (lo_dentry->d_inode->i_size - lo->lo_offset) >>
 BLOCK_SIZE_BITS;
         if (blk_size[MAJOR(lodev)])
                 return blk_size[MAJOR(lodev)][MINOR(lodev)] -
                                 (lo->lo_offset >> BLOCK_SIZE_BITS);
         return MAX_DISK_SIZE;
 }
 -----------
 
 include/linux/fs.h
 -----------
 #define BLOCK_SIZE_BITS 10
 #define BLOCK_SIZE (1<<BLOCK_SIZE_BITS)
 -----------
 По-умолчанию, размер эмулируемой файловой системы равен 1 Гбайт,
 для 32-битного int - до 4 Гбайт.
 --- GoldED+/LNX Debian
  * Origin: KOSC/Kirov Open Source Community (2:5056/16.70)
 
 

Вернуться к списку тем, сортированных по: возрастание даты  уменьшение даты  тема  автор 

 Тема:    Автор:    Дата:  
 /dev/loop   Fedor Lizunkov   07 Jan 2005 20:10:08 
 /dev/loop   Sergei Dubarev   07 Jan 2005 23:27:02 
 /dev/loop   Fedor Lizunkov   08 Jan 2005 01:32:18 
 /dev/loop   Alexander Lubyagin   08 Jan 2005 13:25:34 
 /dev/loop   Fedor Lizunkov   09 Jan 2005 08:51:22 
 /dev/loop   Sergei Dubarev   09 Jan 2005 03:21:24 
Архивное /ru.linux/333941dfb18e.html, оценка 2 из 5, голосов 10
Яндекс.Метрика
Valid HTML 4.01 Transitional