xfs
[Top] [All Lists]

seeking advice on sparse files on xfs

To: "xfs@xxxxxxxxxxx" <xfs@xxxxxxxxxxx>
Subject: seeking advice on sparse files on xfs
From: Joe Landman <joe.landman@xxxxxxxxx>
Date: Wed, 19 Dec 2012 17:17:45 -0500
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=FMHQz0Z47NOSzlX91YCv80QyiP/Wb+Ebr18TZzZC2m0=; b=oK6/1Yvc4zOdG3Xi4yOB46Jt619LkxCbBzbjG7MraF7bMjLm7HJcjjDTBSyGr2FDM+ FZPDYcAOXKATMOtLmq53N6TXuVGX01zickzUMLvIzqm6z9Z4WxNkjoYOgwi8GMsXJHZd DE5TYWtgsWwVXNhQqiPK9xGZBDIgFlI3ygoB06GuVd9BSIVrAe6SL2gl4mL7siJ7N6m2 Cl0CqyDfeJFpPOXeQNySwJCPb2ZPIl9dUsgW5tsR7zOg5I9WU9WmPBsPAd+mrfpf+AMK ZnCE/EJnX5SunKfPC5oXVr4ri4rcuR0M8ssWeT7xorW2eVL/JG0m5qCWnCNmOHLueVOU uXHw==
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0
Hi folks:

I've been using sparse files on xfs for a while, and every now and then have the pleasure of copying them. Using coreutils cp (standard linux cp) usually winds up with the utility seeking through the entire file (yes, even with with the --sparse=* options set).

It seems to me that the code is blissfully unware of the file extents, and its sparse implementation amounts to a read, a check to see if it needs to write it as a hole, write it, and the next seek. Iterate until done.

Here's my question. Is there a way to (easily) programmatically hand cp (or any other utility) something akin to the output of xfs_bmap, and thus save it potentially *gargantuan* amounts of seeking over known zero regions? File sparsity in these cases are from 80-99% in some cases (fills of 1-20%) for multi GB/TB sized files.

Pointers appreciated. I am looking at the copy routines in coreutils now, looking to see if we can increase its intelligence somewhat w.r.t. sparse files.

  Thanks!

Joe

<Prev in Thread] Current Thread [Next in Thread>