Thread (13 messages) 13 messages, 5 authors, 2011-11-18

Re: [Patch] tmpfs: add fallocate support

From: Cong Wang <hidden>
Date: 2011-11-16 07:10:15
Also in: lkml

ao? 2011a1'11ae??15ae?JPY 19:23, Pekka Enberg a??e??:
Hello,

On Tue, Nov 15, 2011 at 10:42 AM, Amerigo Wang[off-list ref]  wrote:
quoted
This patch adds fallocate support to tmpfs. I tested this patch
with the following test case,

        % sudo mount -t tmpfs -o size=100 tmpfs /mnt
        % touch /mnt/foobar
        % echo hi>  /mnt/foobar
        % fallocate -o 3 -l 5000 /mnt/foobar
        fallocate: /mnt/foobar: fallocate failed: No space left on device
        % fallocate -o 3 -l 3000 /mnt/foobar
        % ls -l /mnt/foobar
        -rw-rw-r-- 1 wangcong wangcong 3003 Nov 15 16:10 /mnt/foobar
        % dd if=/dev/zero of=/mnt/foobar seek=3 bs=1 count=3000
        3000+0 records in
        3000+0 records out
        3000 bytes (3.0 kB) copied, 0.0153224 s, 196 kB/s
        % hexdump -C /mnt/foobar
        00000000  68 69 0a 00 00 00 00 00  00 00 00 00 00 00 00 00  |hi..............|
        00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
        *
        00000bb0  00 00 00 00 00 00 00 00  00 00 00                 |...........|
        00000bbb
        % cat /mnt/foobar
        hi

Signed-off-by: WANG Cong<redacted>
What's the use case for this?
Hi, Pekka,

Systemd needs it, see http://lkml.org/lkml/2011/10/20/275.
I am adding Kay into Cc.

Thanks.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help