[Ocfs2-test-devel] [PATCH 4/9] Ocfs2-test: Add utility funcs for both single-node and multi-nodes tests.
tristan.ye
tristan.ye at oracle.com
Mon Mar 23 20:28:55 PDT 2009
On Tue, 2009-03-24 at 10:51 +0800, Tao Ma wrote:
> Hi Tristan,
> Just some minor comments.
> I see a large part of this patch isn't concerned with reflink
> operation. Just about read/write and mmap.
Actually, there were no other generic funcs more than read/write/mmap
operations. Not sure if it deserves our efforts to build them to a lib
or not. maybe we can mainatain a C common lib like shell and python in
ocfs2-tests, but the situation was not like the ocfs2-tools somehow, our
current tests in ocfs2-tests seems a little bit independent and
separate.
> So is there any possibility
> that we can create a lib for it. So that our future test can use it(just
> like some general functions we create in libocfs2 of ocfs2-tools).
>
> Tristan Ye wrote:
> > All common funcs shared by single-node and multi-nodes testing binaries
> > gathered here.
> >
> > Signed-off-by: Tristan Ye <tristan.ye at oracle.com>
> <snip>
> > +extern int open_ocfs2_volume(char *device_name)
> > +{
> > + int open_flags = OCFS2_FLAG_HEARTBEAT_DEV_OK | OCFS2_FLAG_RO;
> > + int ret;
> > + uint64_t superblock = 0, block_size = 0;
> > +
> > + ret = ocfs2_open(device_name, open_flags, superblock, block_size,
> > + &fs);
> > + if (ret < 0) {
> > + fprintf(stderr, "Not a ocfs2 volume!\n");
> ocfs2_open's return value give the right answer. So use it please
> because it may be caused other issues.
I'll take care of this.
> > + return ret;
> > + }
> > +
> > + ocfs2_sb = OCFS2_RAW_SB(fs->fs_super);
> > + if (!(ocfs2_sb->s_feature_incompat &
> > + OCFS2_FEATURE_INCOMPAT_REFCOUNT_TREE)) {
> > + fprintf(stderr, "refcount is not supported"
> > + " on this ocfs2 volume\n");
> > + return -1;
> > + }
> > +
> > + blocksize = 1 << ocfs2_sb->s_blocksize_bits;
> > + clustersize = 1 << ocfs2_sb->s_clustersize_bits;
> > + max_inline_size = ocfs2_max_inline_data(blocksize);
> I never seen ocfs2_close in your patch. So it is in another file?
Good catch, thanks.
> > +
> > + return 0;
> > +}
>
> Regards,
> Tao
More information about the Ocfs2-test-devel
mailing list