[Ocfs2-tools-devel] [PATCH 1/1] OCFS2-TOOLS: NFS Sync support to tools.
wengang wang
wen.gang.wang at oracle.com
Tue Apr 14 20:31:22 PDT 2009
This patch adds NFS Sync support to ocfs2-tools.
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---
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..25c8c9a 100644
--- a/include/ocfs2-kernel/ocfs2_lockid.h
+++ b/include/ocfs2-kernel/ocfs2_lockid.h
@@ -46,6 +46,7 @@ enum ocfs2_lock_type {
OCFS2_LOCK_TYPE_DENTRY,
OCFS2_LOCK_TYPE_OPEN,
OCFS2_LOCK_TYPE_FLOCK,
+ OCFS2_LOCK_TYPE_NFS_SYNC,
OCFS2_NUM_LOCK_TYPES
};
@@ -77,6 +78,9 @@ static inline char ocfs2_lock_type_char(enum ocfs2_lock_type type)
case OCFS2_LOCK_TYPE_FLOCK:
c = 'F';
break;
+ case OCFS2_LOCK_TYPE_NFS_SYNC:
+ c = 'Y';
+ break;
default:
c = '\0';
}
@@ -95,6 +99,7 @@ static char *ocfs2_lock_type_strings[] = {
[OCFS2_LOCK_TYPE_DENTRY] = "Dentry",
[OCFS2_LOCK_TYPE_OPEN] = "Open",
[OCFS2_LOCK_TYPE_FLOCK] = "Flock",
+ [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..b49cdbd 100644
--- a/libocfs2/lockid.c
+++ b/libocfs2/lockid.c
@@ -47,6 +47,8 @@ enum ocfs2_lock_type ocfs2_get_lock_type(char c)
return OCFS2_LOCK_TYPE_OPEN;
case 'F':
return OCFS2_LOCK_TYPE_FLOCK;
+ case 'Y':
+ return OCFS2_LOCK_TYPE_NFS_SYNC;
default:
return OCFS2_NUM_LOCK_TYPES;
}
More information about the Ocfs2-tools-devel
mailing list