ext4

Is lseek() O(1) complexity?

久未见 提交于 2019-12-04 01:55:01
I know that my question has an answer here: QFile seek performance . But I am not completely satisfied with the answer. Even after looking at the following implementation of generic_file_llseek() for ext4, I can't seem to understand how can the complexity be measured. /** * generic_file_llseek - generic llseek implementation for regular files * @file: file structure to seek on * @offset: file offset to seek to * @origin: type of seek * * This is a generic implemenation of ->llseek useable for all normal local * filesystems. It just updates the file offset to the value specified by * @offset

Linux AIO: Poor Scaling

只谈情不闲聊 提交于 2019-12-02 23:22:29
I am writing a library that uses the Linux asynchronous I/O system calls, and would like to know why the io_submit function is exhibiting poor scaling on the ext4 file system. If possible, what can I do to get io_submit not to block for large IO request sizes? I already do the following (as described here ): Use O_DIRECT . Align the IO buffer to a 512-byte boundary. Set the buffer size to a multiple of the page size. In order to observe how long the kernel spends in io_submit , I ran a test in which I created a 1 Gb test file using dd and /dev/urandom , and repeatedly dropped the system cache

Storing & accessing up to 10 million files in Linux

♀尐吖头ヾ 提交于 2019-12-02 17:30:20
I'm writing an app that needs to store lots of files up to approx 10 million. They are presently named with a UUID and are going to be around 4MB each but always the same size. Reading and writing from/to these files will always be sequential. 2 main questions I am seeking answers for: 1) Which filesystem would be best for this. XFS or ext4? 2) Would it be necessary to store the files beneath subdirectories in order to reduce the numbers of files within a single directory? For question 2, I note that people have attempted to discover the XFS limit for number of files you can store in a single

Why can't I access this folder? [closed]

本小妞迷上赌 提交于 2019-12-02 17:26:24
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 7 years ago . A while back I bought a 1TB USB external drive. I formatted it ext4 in Ubuntu and copied a bunch of files / folders to it from several machines, all to /home/machinename/whatever, respectively. At some point I ran a chmod -R shell command on it to change the permissions. That was months ago and I don't remember

Why can't I access this folder? [closed]

五迷三道 提交于 2019-12-02 11:55:26
A while back I bought a 1TB USB external drive. I formatted it ext4 in Ubuntu and copied a bunch of files / folders to it from several machines, all to /home/machinename/whatever, respectively. At some point I ran a chmod -R shell command on it to change the permissions. That was months ago and I don't remember what I typed but it made the drive so I could only access its /home folder as root. This wasn't a problem because I could still access everything, but today I decided to try to fix it. I went to my shell as root, went to that drive and typed: chown -R rick:rick ./ chmod -R 666 ./ It

python: complexity of os.path.exists with a ext4 filesystem?

て烟熏妆下的殇ゞ 提交于 2019-12-01 04:25:27
问题 Does anyone know what the complexity of the os.path.exists function is in python with a ext4 filesystem? 回答1: Underlying directory structure used by Ext4 (and Ext3 ) is exactly the same as in Ext2 . Ext3 adds journaling, Ext4 improves that journaling. Journaling is irrelevant to your question. Originally Ext2 used to store that as list, but that of course was inefficient for large directories. So it's has been changed to tweaked version of B-tree called HTree. Unlike standard B-tree, HTree

How to durably rename a file in POSIX?

♀尐吖头ヾ 提交于 2019-11-30 10:39:58
问题 What's the correct way to durably rename a file in a POSIX file system? Specifically wondering about fsyncs on the directories . (If this depends on the OS/FS, I'm asking about Linux and ext3/ext4). Note : there are other questions on StackOverflow about durable renames, but AFAICT they don't address fsync-ing the directories (which is what matters to me - I'm not even modifying file data). I currently have (in Python): dstdirfd = open(dstdirpath, O_DIRECTORY|O_RDONLY) rename(srcdirpath + '/'

timestamp accuracy on EXT4 (sub millsecond)

我的梦境 提交于 2019-11-30 08:26:59
问题 I was writing some code in Vala where I would first get the system time, then create a file, then retrieve the time stamp of that file. The timestamp would always be earlier that the system time, somewhere between 500 and 1500 micro seconds which didn't make sense. I then wrote a simple shell script: while true; do touch ~/tmp/fred.txt stat ~/tmp/fred.txt|grep ^C done With the the following result: Change: 2013-01-18 16:02:44.290787250 +1100 Change: 2013-01-18 16:02:44.293787250 +1100 Change:

How to durably rename a file in POSIX?

不羁的心 提交于 2019-11-29 21:48:36
What's the correct way to durably rename a file in a POSIX file system? Specifically wondering about fsyncs on the directories . (If this depends on the OS/FS, I'm asking about Linux and ext3/ext4). Note : there are other questions on StackOverflow about durable renames, but AFAICT they don't address fsync-ing the directories (which is what matters to me - I'm not even modifying file data). I currently have (in Python): dstdirfd = open(dstdirpath, O_DIRECTORY|O_RDONLY) rename(srcdirpath + '/' + filename, dstdirpath + '/' + filename) fsync(dstdirfd) Specific questions : Does this also

Unix File System: How are file names translated to disk sectors?

匆匆过客 提交于 2019-11-29 12:47:36
A very basic question. What is the exact sequence of steps executed when I try to open a file-descriptor, by providing fully-qualified path to the file. I am looking for how this works on Linux given a file name - how is it translated to inode and disk-sector does linux file system (specifically ext3 and ext4) maintain some kind of filename to inode mapping? Basile Starynkevitch In addition of tmp's answer : Files really are inodes . Usually, a given file has some entry in some directory pointing to its inode. Directories are mapping names to inodes, and directories are a kind of file. See