Question

What system call causes getattr() in memoryll.py to be called (on files in a memoryll filesystem)?...

What system call causes getattr() in memoryll.py to be called (on files in a memoryll filesystem)? How did you verify this?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Solution:

Use of getattr() and when it's get called ?

getattr() here is used to get the statistics of a file or directory.
getattr() is getting called when any operation has been made on file system.
These operations are open(), read(), readdir(), write() etc.

How to verify if getattr() is getting called ?
First put one print statement inside getattr() like below:
def getattr(self, req, ino, fi):
print 'getattr:', ino // Put a print statement like written here
attr = self.attr[ino]
if attr:
self.reply_attr(req, attr, 1.0)
else:
self.reply_err(req, ENOENT)

Then, you can verify this by calling any of above operation mentioned above. After calling any of above function, if you check logs, you will find that information printed.

Add a comment
Know the answer?
Add Answer to:
What system call causes getattr() in memoryll.py to be called (on files in a memoryll filesystem)?...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT