[Gluster-devel] unify's return "struct stat" scheme

LI Daobing lidaobing at gmail.com
Thu Jan 10 02:51:36 UTC 2008


Hello,

this letter is relative with the last letter post by me in [1]
[1] http://tinyurl.com/2lsa24

unify adopt 4 schemes to return struct stat* in 18 functions.

1. struct stat* is returned from the data node: readv, writev
2. struct stat* is returned from the NS node: mknod, mkdir, symlink,
link, create
3. most part of struct stat* is returned from the NS node, but mtime,
st_size, st_blocks is returned from data node: lookup, stat, fstat,
fchmod, fchown, ftruncate
4. if it's a directory, return struct stat* from the NS node,
otherwise same with 3: chmod, chown, truncate, utimens, rename
(I don't know whether I have made mistake in this paragraph, :) )

Hmm, the unstable returned time will make vim give a warning (as I
descripted in last letter). So I propose another scheme for returning
struct stat*:

1. if it's a file: return struct stat* from the data node
2. if it's a dir: return struct stat* from the NS node

under this scheme, at least the returned stat* can be stable.

Any comment or suggestion? Thanks.

-- 
Best Regards,
 LI Daobing





More information about the Gluster-devel mailing list