[Ocfs2-devel] [PATCH 5/6] Framework for version LVB
Mark Fasheh
mfasheh at suse.de
Mon Nov 4 14:12:39 PST 2013
On Sun, Nov 03, 2013 at 09:46:47PM -0600, Goldwyn Rodrigues wrote:
> On 11/03/2013 07:10 PM, Mark Fasheh wrote:
>> On Fri, Oct 18, 2013 at 09:46:12AM -0500, Goldwyn Rodrigues wrote:
>>> +static void version_to_lvb(struct ocfs2_protocol_version *ver, char *lvb)
>>> +{
>>> + memcpy(lvb, ver, sizeof(struct ocfs2_protocol_version));
>>> +}
>>
>> You'll need to account for mixed-endian clusters here and above. Look at
>> ocfs_stuff_meta_lvb() and ocfs2_refresh_inode_from_lvb() to see what I'm
>> talking about. Since the lvb goes over the network we chose a big-endian
>> representation there.
>
> ocfs2_protocol_version has two variables, pv_major and pv_minor both of
> which are u8 :) Perhaps I could put in a comment if you like.
Ok, I feel silly :) A comment doesn't hurt.
>>> +static int version_lock(struct ocfs2_cluster_connection *conn, int mode,
>>> + int flags)
>>> +{
>>> + struct ocfs2_live_connection *lc = conn->cc_private;
>>> + return sync_lock(conn, mode, flags,
>>> + &lc->oc_version_lksb, "version_lock");
>>> +}
>>
>> #define VERSION_LOCK_NAME "version_lock"
>>
>> and take the "name" argument out of sync_lock().
>> --Mark
>>
>
> Understood.
Thanks,
--Mark
--
Mark Fasheh
More information about the Ocfs2-devel
mailing list