xfs
[Top] [All Lists]

Trouble using IOC_XFS_FREESP

To: "linux-xfs@xxxxxxxxxxx" <linux-xfs@xxxxxxxxxxx>
Subject: Trouble using IOC_XFS_FREESP
From: "Ian S. Nelson" <ian.nelson@xxxxxxxxxxxx>
Date: Tue, 02 Oct 2001 18:26:30 -0600
Organization: Echostar
Reply-to: ian.nelson@xxxxxxxxxxxx
Sender: owner-linux-xfs@xxxxxxxxxxx
I'm hacking together a little "trim()" function and I'm having trouble
getting it to work.


Here is my code:

int trim(int fd, unsigned long long offset)
{
        struct xfs_flock64 flock;
        int rc;

        flock.l_whence = 0;
        flock.l_start = 0;
        flock.l_len = offset;

        rc = ioctl( fd, XFS_IOC_FREESP, &flock );
        printf("rc: %d\n", rc);
}


And I'm always ending up with 0 length files when I'm done.  I'm
creating a file of 20000 bytes and then trying to poke a hole in the
first 10000 bytes.  Am I missing something?  I don't have the irix man
pages so I'm kind of guessing.  rc is 0 (zero) when I run it.

thanks,
Ian


<Prev in Thread] Current Thread [Next in Thread>
  • Trouble using IOC_XFS_FREESP, Ian S. Nelson <=