linux-nilfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Rohner <andreas.rohner-hi6Y0CQ0nG0@public.gmane.org>
To: Vyacheslav Dubeyko <slava-yeENwD64cLxBDgjK7y7TUQ@public.gmane.org>
Cc: linux-nilfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 4/6] nilfs2: add ioctl() to clean snapshot flags from dat entries
Date: Tue, 18 Mar 2014 09:38:31 +0100	[thread overview]
Message-ID: <53280607.4060201@gmx.net> (raw)
In-Reply-To: <1395126628.2190.3.camel@slavad-CELSIUS-H720>

On 2014-03-18 08:10, Vyacheslav Dubeyko wrote:
> On Mon, 2014-03-17 at 14:49 +0100, Andreas Rohner wrote:
> 
>>>
>>>>   */
>>>>  struct nilfs_vdesc {
>>>>  	__u64 vd_ino;
>>>> @@ -873,9 +873,55 @@ struct nilfs_vdesc {
>>>>  	__u64 vd_blocknr;
>>>>  	__u64 vd_offset;
>>>>  	__u32 vd_flags;
>>>> -	__u32 vd_pad;
>>>> +	/* vd_flags2 needed because of backwards compatibility */
>>>
>>> Completely, misunderstand comment. Usually, it keeps old fields for
>>> backward compatibility. But this flag is new.
>>
>> I will rewrite the comment. I need vd_flags2 because I can't use
>> vd_flags because of backwards compatibility.
>>
>>>> +	__u32 vd_flags2;
> 
> What about vd_blk_state instead of vd_flags2?

Yes sounds good to me.

>>>>  };
>>>>  
>>>> +/* vdesc flags */
>>>
>>> To be honest, I misunderstand why such number of flags and why namely
>>> such flags? Comments are really necessary.
>>>
>>>> +enum {
>>>> +	NILFS_VDESC_DATA,
>>>> +	NILFS_VDESC_NODE,
>>>> +	/* ... */
>>>
>>> What does it mean?
>>
>> NILFS_VDESC_DATA = 0 and NILFS_VDESC_NODE = 1. This represents the type
>> of block. These two already existed, in the previous version, but they
>> were not explicit. See "[Patch 4/4] nilfs-utils: add extra flags to
>> nilfs_vdesc and update sui_nblocks":
>>
>> @@ -148,17 +149,19 @@ static int nilfs_acc_blocks_file(struct nilfs_file
>> *file,
>> -				vdesc->vd_flags = 0;	/* data */
>> +				nilfs_vdesc_set_data(vdesc);
>>  			} else {
>>  				vdesc->vd_vblocknr =
>>  					le64_to_cpu(*(__le64 *)blk.b_binfo);
>> -				vdesc->vd_flags = 1;	/* node */
>> +				nilfs_vdesc_set_node(vdesc);
>>  			}
>>
>>>> +};
>>>> +enum {
>>>> +	NILFS_VDESC_SNAPSHOT,
>>>> +	__NR_NILFS_VDESC_FIELDS,
>>>> +	/* ... */
>>>
>>> What does it mean?
> 
> I asked here about strange comment. What does it mean?

Sorry for the misunderstanding. I copied the comment from other flags like:

enum {
	NILFS_SEGMENT_USAGE_ACTIVE,
	NILFS_SEGMENT_USAGE_DIRTY,
	NILFS_SEGMENT_USAGE_ERROR,

	/* ... */
};

I guess it means "additional flags come here".

But you are right it is confusing it should be like that:

enum {
	NILFS_VDESC_SNAPSHOT,
	NILFS_VDESC_PROTECTION_PERIOD,

	/* ... */

	__NR_NILFS_VDESC_FIELDS,
};

> Moreover, I slightly confused by NILFS_VDESC_SNAPSHOT. Is it bit-based
> flag? I mean NILFS_VDESC_SNAPSHOT = (1 << 0). Or am I incorrect?

Yes NILFS_VDESC_SNAPSHOT and NILFS_VDESC_PROTECTION_PERIOD are
bit-based. NILFS_VDESC_DATA and NILFS_VDESC_NODE are not bit-based
because of backwards compatibility.

Please also note, that [PATCH 5/6] adds another flag, namely
NILFS_VDESC_PROTECTION_PERIOD.

Best regards,
Andreas Rohner

--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2014-03-18  8:38 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-16 10:47 [PATCH 0/6] nilfs2: implement tracking of live blocks Andreas Rohner
     [not found] ` <cover.1394966728.git.andreas.rohner-hi6Y0CQ0nG0@public.gmane.org>
2014-03-16 10:47   ` [PATCH 1/6] nilfs2: add helper function to go through all entries of meta data file Andreas Rohner
     [not found]     ` <2adbf1034ab4b129223553746577f6ec0e699869.1394966729.git.andreas.rohner-hi6Y0CQ0nG0@public.gmane.org>
2014-03-17  6:51       ` Vyacheslav Dubeyko
2014-03-17  9:24         ` Andreas Rohner
2014-03-16 10:47   ` [PATCH 2/6] nilfs2: add new timestamp to seg usage and function to change su_nblocks Andreas Rohner
     [not found]     ` <12561ce5e2cf8ae07fdda05e16c357f37d17c62f.1394966729.git.andreas.rohner-hi6Y0CQ0nG0@public.gmane.org>
2014-03-16 13:00       ` Vyacheslav Dubeyko
     [not found]         ` <2FD47FE0-3468-4EF4-AAAE-4A636C640C44-yeENwD64cLxBDgjK7y7TUQ@public.gmane.org>
2014-03-16 12:24           ` Andreas Rohner
     [not found]             ` <53259801.5080409-hi6Y0CQ0nG0@public.gmane.org>
2014-03-16 13:34               ` Vyacheslav Dubeyko
     [not found]                 ` <0ED0D5DA-9AE9-44B8-8936-1680DE2B64C5-yeENwD64cLxBDgjK7y7TUQ@public.gmane.org>
2014-03-16 16:02                   ` Andreas Rohner
2014-03-16 14:06               ` Vyacheslav Dubeyko
     [not found]                 ` <ED41900C-6380-44C1-AC7E-EB8DF74EBFBD-yeENwD64cLxBDgjK7y7TUQ@public.gmane.org>
2014-03-16 13:31                   ` Ryusuke Konishi
     [not found]                     ` <20140316.223111.52181167.konishi.ryusuke-Zyj7fXuS5i5L9jVzuh4AOg@public.gmane.org>
2014-03-16 16:19                       ` Andreas Rohner
2014-03-16 10:47   ` [PATCH 3/6] nilfs2: scan dat entries at snapshot creation/deletion time Andreas Rohner
     [not found]     ` <29dee92595249b713fff1e4903d5d76556926eec.1394966729.git.andreas.rohner-hi6Y0CQ0nG0@public.gmane.org>
2014-03-17  7:04       ` Vyacheslav Dubeyko
2014-03-17  9:35         ` Andreas Rohner
     [not found]           ` <5326C1E5.10108-hi6Y0CQ0nG0@public.gmane.org>
2014-03-17  9:54             ` Vyacheslav Dubeyko
2014-03-16 10:47   ` [PATCH 4/6] nilfs2: add ioctl() to clean snapshot flags from dat entries Andreas Rohner
     [not found]     ` <be7d3bd13015117222aac43194c0fdb9c5d0046f.1394966729.git.andreas.rohner-hi6Y0CQ0nG0@public.gmane.org>
2014-03-17 13:19       ` Vyacheslav Dubeyko
2014-03-17 13:49         ` Andreas Rohner
     [not found]           ` <5326FD51.7000209-hi6Y0CQ0nG0@public.gmane.org>
2014-03-18  7:10             ` Vyacheslav Dubeyko
2014-03-18  8:38               ` Andreas Rohner [this message]
2014-03-16 10:47   ` [PATCH 5/6] nilfs2: add counting of live blocks for blocks that are overwritten Andreas Rohner
     [not found]     ` <25dd8a8bb6943ffa3e0663848363135585a48109.1394966729.git.andreas.rohner-hi6Y0CQ0nG0@public.gmane.org>
2014-03-18 11:50       ` Vyacheslav Dubeyko
2014-03-18 14:02         ` Andreas Rohner
2014-03-16 10:47   ` [PATCH 6/6] nilfs2: add counting of live blocks for deleted files Andreas Rohner
2014-03-16 10:49   ` [PATCH 1/4] nilfs-utils: remove reliance on sui_nblocks to read segment Andreas Rohner
     [not found]     ` <36b7f57861b69c7fdb9d9e54a21df6f5c7f21061.1394966935.git.andreas.rohner-hi6Y0CQ0nG0@public.gmane.org>
2014-03-16 10:49       ` [PATCH 2/4] nilfs-utils: add cost-benefit and greedy policies Andreas Rohner
     [not found]         ` <cc43be2e6bba5367fd2982dc0df5255b884bdace.1394966935.git.andreas.rohner-hi6Y0CQ0nG0@public.gmane.org>
2014-03-16 12:55           ` Ryusuke Konishi
     [not found]             ` <20140316.215545.291456562.konishi.ryusuke-Zyj7fXuS5i5L9jVzuh4AOg@public.gmane.org>
2014-03-16 15:50               ` Andreas Rohner
2014-03-16 10:49       ` [PATCH 3/4] nilfs-utils: add support for nilfs_clean_snapshot_flags() Andreas Rohner
2014-03-16 10:49       ` [PATCH 4/4] nilfs-utils: add extra flags to nilfs_vdesc and update sui_nblocks Andreas Rohner
2014-03-16 11:01   ` [PATCH 0/6] nilfs2: implement tracking of live blocks Andreas Rohner
     [not found]     ` <532584A2.8000004-hi6Y0CQ0nG0@public.gmane.org>
2014-03-16 12:34       ` Vyacheslav Dubeyko
     [not found]         ` <3EC9549C-84A7-49B5-9BE1-34A7337BFFDC-yeENwD64cLxBDgjK7y7TUQ@public.gmane.org>
2014-03-16 11:36           ` Andreas Rohner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53280607.4060201@gmx.net \
    --to=andreas.rohner-hi6y0cq0ng0@public.gmane.org \
    --cc=linux-nilfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=slava-yeENwD64cLxBDgjK7y7TUQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).