[Ocfs2-tools-commits] manish commits r265 - trunk/ocfs2tool
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Mon Sep 27 01:53:37 CDT 2004
Author: manish
Date: 2004-09-27 01:53:35 -0500 (Mon, 27 Sep 2004)
New Revision: 265
Modified:
trunk/ocfs2tool/main.py
trunk/ocfs2tool/ocfs2module.c
trunk/ocfs2tool/ocfsplist.c
trunk/ocfs2tool/ocfsplist.h
Log:
Remove vestigal ocfs1 awareness
Modified: trunk/ocfs2tool/main.py
===================================================================
--- trunk/ocfs2tool/main.py 2004-09-27 06:52:37 UTC (rev 264)
+++ trunk/ocfs2tool/main.py 2004-09-27 06:53:35 UTC (rev 265)
@@ -18,7 +18,6 @@
COLUMN_DEVICE = 0
COLUMN_MOUNTPOINT = 1
-COLUMN_TYPE = 2
MODE_BASIC = 0
MODE_ADVANCED = 1
@@ -46,14 +45,11 @@
gtk.TreeView.__init__(self, store)
self.toplevel = toplevel
- self.advanced = MODE_BASIC
+ self.advanced = False
self.insert_column_with_attributes(-1, 'Device',
gtk.CellRendererText(),
text=COLUMN_DEVICE)
- self.insert_column_with_attributes(-1, 'Type',
- gtk.CellRendererText(),
- text=COLUMN_TYPE)
self.insert_column_with_attributes(-1, 'Mountpoint',
gtk.CellRendererText(),
text=COLUMN_MOUNTPOINT)
@@ -79,7 +75,7 @@
return None
def on_select(self, sel):
- device, mountpoint, type = self.get_sel_values()
+ device, mountpoint = self.get_sel_values()
if mountpoint:
self.mount_button.set_sensitive(False)
@@ -98,8 +94,8 @@
def refresh_partitions(self):
def list_compare(store, a, b):
- d1, m1, t1 = store[a]
- d2, m2, t1 = store[b]
+ d1, m1 = store[a]
+ d2, m2 = store[b]
if m1 and not m2:
return -1
@@ -113,7 +109,7 @@
old_device = self.get_device()
- store = gtk.ListStore(str, str, str)
+ store = gtk.ListStore(str, str)
self.set_model(store)
sel = self.get_selection()
@@ -133,13 +129,13 @@
sel.select_iter(store.get_iter_first())
def mount(button, pv):
- device, mountpoint, type = pv.get_sel_values()
+ device, mountpoint = pv.get_sel_values()
mountpoint = query_text(pv.toplevel, 'Mountpoint')
if not mountpoint:
return
- command = ('mount', '-t', type, device, mountpoint)
+ command = ('mount', '-t', 'ocfs2', device, mountpoint)
p = Process(command, 'Mount', 'Mounting...', pv.toplevel, spin_now=False)
success, output, killed = p.reap()
@@ -156,7 +152,7 @@
pv.refresh_partitions()
def unmount(button, pv):
- device, mountpoint, type = pv.get_sel_values()
+ device, mountpoint = pv.get_sel_values()
command = ('umount', mountpoint)
@@ -221,10 +217,15 @@
pass
def level(pv, action, w):
- if pv.advanced == action:
+ if action == MODE_ADVANCED:
+ advanced = True
+ else:
+ advanced = False
+
+ if pv.advanced == advanced:
return
- pv.advanced = action
+ pv.advanced = advanced
def about(pv, a, w):
dialog = gtk.MessageDialog(parent=pv.toplevel,
Modified: trunk/ocfs2tool/ocfs2module.c
===================================================================
--- trunk/ocfs2tool/ocfs2module.c 2004-09-27 06:52:37 UTC (rev 264)
+++ trunk/ocfs2tool/ocfs2module.c 2004-09-27 06:53:35 UTC (rev 265)
@@ -72,10 +72,7 @@
if (!unmounted)
{
info = list->data;
- val = Py_BuildValue ("(sss)",
- info->device, info->mountpoint,
- info->type == OCFS_FS_TYPE_OCFS2 ? "ocfs2"
- : "ocfs");
+ val = Py_BuildValue ("(ss)", info->device, info->mountpoint);
}
else
val = PyString_FromString (list->data);
Modified: trunk/ocfs2tool/ocfsplist.c
===================================================================
--- trunk/ocfs2tool/ocfsplist.c 2004-09-27 06:52:37 UTC (rev 264)
+++ trunk/ocfs2tool/ocfsplist.c 2004-09-27 06:53:35 UTC (rev 265)
@@ -48,20 +48,17 @@
};
-static gboolean check_partition_type (const gchar *device,
- OcfsFSType *type);
-static gboolean valid_device (const gchar *device,
- gboolean no_ocfs_check,
- OcfsFSType *type);
-static void partition_info_fill (GHashTable *info);
-static gboolean list_builder (gpointer key,
- gpointer value,
- gpointer user_data);
+static gboolean is_ocfs2_partition (const gchar *device);
+static gboolean valid_device (const gchar *device,
+ gboolean no_ocfs_check);
+static void partition_info_fill (GHashTable *info);
+static gboolean list_builder (gpointer key,
+ gpointer value,
+ gpointer user_data);
static gboolean
-check_partition_type (const gchar *device,
- OcfsFSType *type)
+is_ocfs2_partition (const gchar *device)
{
errcode_t ret;
ocfs2_filesys *fs;
@@ -69,14 +66,7 @@
ret = ocfs2_open (device, OCFS2_FLAG_RO, 0, 0, &fs);
if (ret)
- {
- if (ret == OCFS2_ET_OCFS_REV)
- *type = OCFS_FS_TYPE_OCFS;
- else
- return FALSE;
- }
- else
- *type = OCFS_FS_TYPE_OCFS2;
+ return FALSE;
ocfs2_close (fs);
return TRUE;
@@ -84,8 +74,7 @@
static gboolean
valid_device (const gchar *device,
- gboolean no_ocfs_check,
- OcfsFSType *type)
+ gboolean no_ocfs_check)
{
gboolean is_bad = FALSE;
struct stat sbuf;
@@ -128,10 +117,9 @@
return FALSE;
close (fd);
- return no_ocfs_check ? TRUE : check_partition_type (device, type);
+ return no_ocfs_check ? TRUE : is_ocfs2_partition (device);
#else
fd = 0;
- *type = OCFS_FS_TYPE_OCFS2;
return TRUE;
#endif
}
@@ -206,7 +194,6 @@
gchar mountpoint[PATH_MAX];
OcfsPartitionInfo *info;
gint flags;
- OcfsFSType type;
errcode_t ret;
bdata = user_data;
@@ -216,12 +203,11 @@
{
device = list->data;
- if (valid_device (device, bdata->unmounted, &type))
+ if (valid_device (device, bdata->unmounted))
{
info = g_new (OcfsPartitionInfo, 1);
info->device = g_strdup (device);
- info->type = type;
ret = ocfs2_check_mount_point (device, &flags, mountpoint, PATH_MAX);
@@ -314,9 +300,7 @@
for (list = plist; list; list = list->next)
{
info = list->data;
- g_print ("Device: %s; Mountpoint %s; Type %s\n",
- info->device, info->mountpoint,
- info->type == OCFS_FS_TYPE_OCFS2 ? "ocfs2" : "ocfs");
+ g_print ("Device: %s; Mountpoint %s\n", info->device, info->mountpoint);
}
g_print ("Unmounted:\n");
Modified: trunk/ocfs2tool/ocfsplist.h
===================================================================
--- trunk/ocfs2tool/ocfsplist.h 2004-09-27 06:52:37 UTC (rev 264)
+++ trunk/ocfs2tool/ocfsplist.h 2004-09-27 06:53:35 UTC (rev 265)
@@ -29,23 +29,16 @@
#include <glib.h>
-typedef enum
-{
- OCFS_FS_TYPE_OCFS,
- OCFS_FS_TYPE_OCFS2
-} OcfsFSType;
-
typedef struct _OcfsPartitionInfo OcfsPartitionInfo;
struct _OcfsPartitionInfo
{
gchar *device;
gchar *mountpoint;
- OcfsFSType type;
};
-GList *ocfs_partition_list (gboolean unmounted);
+GList *ocfs_partition_list (gboolean unmounted);
#endif /* __OCFS_PARTITION_LIST_H__ */
More information about the Ocfs2-tools-commits
mailing list