[OracleOSS] [TitleIndex] [WordIndex]

OCFS2/CodingStyle

OCFS2 Coding Style

We follow the Linux Kernel Coding Style for both the modules and the tools. This is not optional. As OCFS2 is part of the mainline kernel, we have to ensure that all our code follows this generally accepted style.

Making a Patch

The following are a set of guidelines that apply towards making any patch against any tree.

ocfs2: move nlink check in ocfs2_mknod()

The dir nlink check in ocfs2_mknod() was being done outside of the cluster
lock, which means we could have been checking against a stale version of the
inode. Fix this by doing the check after the cluster lock instead.

Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>

GIT Patches

OCFS2 is in the mainline kernel, and the majority of file system patches will be against what is called "the git tree". Instructions and information on how git works with OCFS2 can be found at GitForOCFS2

The source control page also has a good overview of the structure of ocfs2.git: http://oss.oracle.com/projects/ocfs2/source.html

Also, please follow the kernel guidelines. As these patches will invariably be posted upstream, it is important we follow these guidelines.

SVN Patches

For patches against the svn tree, please follow the following:

Index: tunefs.ocfs2/tunefs.c
===================================================================
--- tunefs.ocfs2/tunefs.c.orig  2006-07-18 14:31:39.927014000 -0700
+++ tunefs.ocfs2/tunefs.c       2006-07-18 14:35:19.133806000 -0700

Configuring SVN diff

By default svn diff does not show the function name where the change has occurred. This makes reviewing patches a bit tedious as one has to apply the patch to make sense of it.

To make svn diff show the function names, do as follows:

$ cat ~/bin/svn_diff_wrapper
#!/bin/bash
exec /usr/bin/diff -u -p "$@"

[helpers]
diff-cmd = <path>/svn_diff_wrapper

Links

How to print u64s


2011-12-23 01:01