gluster-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gluster-devel] lseek


From: Xavier Hernandez
Subject: Re: [Gluster-devel] lseek
Date: Mon, 14 May 2012 09:48:17 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20120428 Thunderbird/12.0.1

Hello Ian,

there is no such thing as an explicit seek in glusterfs. Each readv, writev, (f)truncate and rchecksum have an offset parameter that tells you the position where the operation must be performed.

If you make something that changes the size of the file you must make it in a way that it is transparent to upper translators. This means that all offsets you will receive are "real" (in your case, offsets in the uncompressed version of the file). You should calculate in some way the equivalent offset in the compressed version of the file and send it to the correspoding fop of the lower translators.

In the same way, you must return in all iatt structures the real size of the file (not the compressed size).

I'm not sure what is the intended use of NONSEEKABLE, but I think it is for special file types, like devices or similar that are sequential in nature. Anyway, this is a fuse flag that you can't return from a regular translator open fop.

Xavi

On 05/14/2012 03:22 AM, Ian Latter wrote:
Hello,


   I'm looking for a seek (lseek) implementation in
one of the modules and I can't see one.

   Do I need to care about seeking if my module
changes the file size (i.e. compresses) in Gluster?
I would have thought that I did except that I believe
that what I'm reading is that Gluster returns a
NONSEEKABLE flag on file open (fuse_kernel.h at
line 149).  Does this mitigate the need to correct
the user seeks?


Cheers,



--
Ian Latter
Late night coder ..
http://midnightcode.org/

_______________________________________________
Gluster-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/gluster-devel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]