[Ocfs2-tools-commits] jlbec commits r576 - trunk/libocfs2
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Tue Jan 25 15:51:14 CST 2005
Author: jlbec
Date: 2005-01-25 15:51:12 -0600 (Tue, 25 Jan 2005)
New Revision: 576
Added:
trunk/libocfs2/truncate.c
Modified:
trunk/libocfs2/extend_file.c
Log:
o Added truncate.c skel
Modified: trunk/libocfs2/extend_file.c
===================================================================
--- trunk/libocfs2/extend_file.c 2005-01-25 01:14:10 UTC (rev 575)
+++ trunk/libocfs2/extend_file.c 2005-01-25 21:51:12 UTC (rev 576)
@@ -25,7 +25,6 @@
#define _XOPEN_SOURCE 600 /* Triggers magic in features.h */
#define _LARGEFILE64_SOURCE
-#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
#include <unistd.h>
Added: trunk/libocfs2/truncate.c
===================================================================
--- trunk/libocfs2/truncate.c 2005-01-25 01:14:10 UTC (rev 575)
+++ trunk/libocfs2/truncate.c 2005-01-25 21:51:12 UTC (rev 576)
@@ -0,0 +1,58 @@
+/* -*- mode: c; c-basic-offset: 8; -*-
+ * vim: noexpandtab sw=8 ts=8 sts=0:
+ *
+ * truncate.c
+ *
+ * Truncate an OCFS2 inode. For the OCFS2 userspace library.
+ *
+ * Copyright (C) 2004 Oracle. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License, version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 021110-1307, USA.
+ */
+
+#define _XOPEN_SOURCE 600 /* Triggers magic in features.h */
+#define _LARGEFILE64_SOURCE
+
+#include <string.h>
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#include "ocfs2.h"
+
+
+struct truncate_context {
+ ocfs2_dinode *di;
+ uint32_t clusters;
+};
+
+
+static int truncate_iterate(ocfs2_filesys *fs, ocfs2_extent_rec *rec,
+ int tree_depth, uint32_t ccount,
+ uint64_t ref_blkno, int ref_recno,
+ void *priv_data)
+{
+ int iret;
+ uint32_t cluster;
+ struct truncate_context *ctxt = priv_data;
+
+ if ((rec->e_cpos + rec->e_clusters) <= ctxt->clusters)
+ return 0;
+
+ if (!tree_depth) {
+ }
+
+ return iret;
+}
More information about the Ocfs2-tools-commits
mailing list