xfs
[Top] [All Lists]

retrieving exteneded attributes speed issues

To: linux-xfs@xxxxxxxxxxx
Subject: retrieving exteneded attributes speed issues
From: Anmar Oueja <anmar@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 31 May 2002 13:20:23 -0700
Reply-to: anmar@xxxxxxxxxx
Sender: owner-linux-xfs@xxxxxxxxxxx
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0rc3) Gecko/20020523
What's the best way of efficiently retrieving all extended attributes of
a file on an XFS partition?

Now I'm doing what the utility getattr does:

        call listxattr() to get size of all attr names
        reallocate memory if necessary
        call listxattr() again to get all attr name strings
        for each attr name
                call getxattr() to get size of attr value
                reallocate memory if necessary
                call getxattr() again to get the attr value


The problem is that the approach is not good at handling large number of
files (in the order of 10000 or more.) Same application, without
retrieving extended attributes, took 7 minutes finishing its job; 20
minutes if retrieving extended attributes were included.

Profiling shows that system calls introduced by the retrieval (such as
listxattr and getxattr) take most extra time. From the pseudo code above
we can see this, too. At least 4 system calls are required to retrieve
all extended attributes of one file.

Is retrieving extended attributes inherently slow? Or is there better
way to do the job?


Anmar



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