[Ocfs2-tools-devel] [PATCH 1/1] OCFS2-TOOLS: NFS Sync(and QINFO) support to tools.
Sunil Mushran
sunil.mushran at oracle.com
Tue Apr 14 19:45:11 PDT 2009
Don't mix quota with nfs sync. Mainly because quota requires
another change to allow it to show quota types too.
wengang wang wrote:
> This patch adds NFS Sync support to ocfs2-tools.
> and since the support QINFO is not there yet, add it too.
>
> TEST:
> I tested with the followings:
> ---cut---
> [wwg at localhost ocfs2-tools]$ debugfs.ocfs2/debugfs.ocfs2 -d Y00000000000000000000002fab
> Lockres: Y00000000000000000000002fab
> Type: NFS_Sync
> Generation: 0x00002fab
> ---cut end---
>
> please point me what is missed.
> thank you.
>
> Signed-off-by: Wengang Wang <wen.gang.wang at oracle.com>
> --
> diff --git a/include/ocfs2-kernel/ocfs2_lockid.h b/include/ocfs2-kernel/ocfs2_lockid.h
> index 82c200f..e95cc7b 100644
> --- a/include/ocfs2-kernel/ocfs2_lockid.h
> +++ b/include/ocfs2-kernel/ocfs2_lockid.h
> @@ -46,6 +46,8 @@ enum ocfs2_lock_type {
> OCFS2_LOCK_TYPE_DENTRY,
> OCFS2_LOCK_TYPE_OPEN,
> OCFS2_LOCK_TYPE_FLOCK,
> + OCFS2_LOCK_TYPE_QINFO,
> + OCFS2_LOCK_TYPE_NFS_SYNC,
> OCFS2_NUM_LOCK_TYPES
> };
>
> @@ -77,6 +79,12 @@ static inline char ocfs2_lock_type_char(enum ocfs2_lock_type type)
> case OCFS2_LOCK_TYPE_FLOCK:
> c = 'F';
> break;
> + case OCFS2_LOCK_TYPE_QINFO:
> + c = 'Q';
> + break;
> + case OCFS2_LOCK_TYPE_NFS_SYNC:
> + c = 'Y';
> + break;
> default:
> c = '\0';
> }
> @@ -95,6 +103,8 @@ static char *ocfs2_lock_type_strings[] = {
> [OCFS2_LOCK_TYPE_DENTRY] = "Dentry",
> [OCFS2_LOCK_TYPE_OPEN] = "Open",
> [OCFS2_LOCK_TYPE_FLOCK] = "Flock",
> + [OCFS2_LOCK_TYPE_QINFO] = "Quota",
> + [OCFS2_LOCK_TYPE_NFS_SYNC] = "NFS_Sync",
> };
>
> static inline const char *ocfs2_lock_type_string(enum ocfs2_lock_type type)
> diff --git a/libocfs2/lockid.c b/libocfs2/lockid.c
> index 01ae2d2..96c07d6 100644
> --- a/libocfs2/lockid.c
> +++ b/libocfs2/lockid.c
> @@ -47,6 +47,10 @@ enum ocfs2_lock_type ocfs2_get_lock_type(char c)
> return OCFS2_LOCK_TYPE_OPEN;
> case 'F':
> return OCFS2_LOCK_TYPE_FLOCK;
> + case 'Q':
> + return OCFS2_LOCK_TYPE_QINFO;
> + case 'Y':
> + return OCFS2_LOCK_TYPE_NFS_SYNC;
> default:
> return OCFS2_NUM_LOCK_TYPES;
> }
>
> _______________________________________________
> Ocfs2-tools-devel mailing list
> Ocfs2-tools-devel at oss.oracle.com
> http://oss.oracle.com/mailman/listinfo/ocfs2-tools-devel
>
More information about the Ocfs2-tools-devel
mailing list