All of lore.kernel.org
 help / color / mirror / Atom feed
* [Ocfs2-devel] [PATCH]2.6 fixes in journal.c
@ 2004-02-26 20:16 Rusty Lynch
  2004-03-01 10:54 ` Rusty Lynch
  0 siblings, 1 reply; 5+ messages in thread
From: Rusty Lynch @ 2004-02-26 20:16 UTC (permalink / raw)
  To: ocfs2-devel

The following is a patch that fixes some small 2.6 issues with
journal.c

* journal_get_write_access now has an additional "credits" argument
  that appears to be safe to pass in as null.  (Other people are
  doing it and the code in the latest bk tree always test for null
  before attempting to incrementing it.)
* small typo in an ocfs_iget call
* remaining call to daemonize that is moved to the 2.6 safe
  ocfs_daemonize call
* WARNING!!! Here is the thing I am not sure about!
  The lock_journal/unlock_journal calls do not exist anymore.
  There is a journal_[un]lock_updates() function, but it is 
  unclear when to use that function.

  I just removed the [un]lock_journal calls around a line where
  we were tweaking the commit interval.

    --rusty

Index: src/journal.c
===================================================================
--- src/journal.c	(revision 36)
+++ src/journal.c	(working copy)
@@ -656,7 +656,7 @@
 		break;
 
 	case OCFS_JOURNAL_ACCESS_WRITE:
-		status = journal_get_write_access(handle->k_handle, bh);
+		status = journal_get_write_access(handle->k_handle, bh, NULL);
 		break;
 
 	default:
@@ -898,7 +898,7 @@
 	OCFS_BH_PUT_DATA(bh);
 	fe = NULL;
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-	inode = ocfs_iget (sb, &args);
+	inode = ocfs_iget (osb->sb, &args);
 #else
 	inode = ocfs_get_inode_from_offset(osb, args.offset, bh);
 #endif
@@ -934,9 +934,13 @@
 
 	LOG_TRACE_STR("Returned from journal_init_inode");
 	LOG_TRACE_ARGS("k_journal->j_maxlen = %u\n", k_journal->j_maxlen);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+	k_journal->j_commit_interval = OCFS_DEFAULT_COMMIT_INTERVAL;
+#else
 	lock_journal(k_journal);
 	k_journal->j_commit_interval = OCFS_DEFAULT_COMMIT_INTERVAL;
 	unlock_journal(k_journal);
+#endif
 
 	/* yay, pass the proper info back to our journal structure. */
 	osb->journal.osb = osb;
@@ -1368,12 +1372,14 @@
 	ocfs_super *osb = ((struct ocfs_recover_arg *) arg)->osb;
 	int node_num = ((struct ocfs_recover_arg *) arg)->node_num;
 	int status = 0;
+	char proc[16];
 
 	LOG_ENTRY_ARGS("(node_num=%d, osb->node_num = %d)\n", node_num,
 		       osb->node_num);
 
-	daemonize();
-	reparent_to_init();
+	sprintf (proc, "ocfs2rec-%d", osb->osb_id);
+	ocfs_daemonize (proc, strlen(proc));
+
 #ifdef HAVE_NPTL
 	spin_lock_irq (&current->sighand->siglock);
 	sigfillset(&current->blocked);
@@ -1522,7 +1528,7 @@
 	OCFS_BH_PUT_DATA(bh);
 	fe = NULL;
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-	inode = ocfs_iget (sb, &args);
+	inode = ocfs_iget (osb->sb, &args);
 #else
 	inode = ocfs_get_inode_from_offset(osb, args.offset, bh);
 #endif

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Ocfs2-devel] [PATCH]2.6 fixes in journal.c
  2004-02-26 20:16 [Ocfs2-devel] [PATCH]2.6 fixes in journal.c Rusty Lynch
@ 2004-03-01 10:54 ` Rusty Lynch
  2004-03-01 16:06   ` Mark Fasheh
  2004-03-01 16:36   ` Rusty Lynch
  0 siblings, 2 replies; 5+ messages in thread
From: Rusty Lynch @ 2004-03-01 10:54 UTC (permalink / raw)
  To: ocfs2-devel

On Thu, Feb 26, 2004 at 06:16:49PM -0800, Rusty Lynch wrote:
> The following is a patch that fixes some small 2.6 issues with
> journal.c
> 
> * journal_get_write_access now has an additional "credits" argument
>   that appears to be safe to pass in as null.  (Other people are
>   doing it and the code in the latest bk tree always test for null
>   before attempting to incrementing it.)
> * small typo in an ocfs_iget call
> * remaining call to daemonize that is moved to the 2.6 safe
>   ocfs_daemonize call
> * WARNING!!! Here is the thing I am not sure about!
>   The lock_journal/unlock_journal calls do not exist anymore.
>   There is a journal_[un]lock_updates() function, but it is 
>   unclear when to use that function.
> 
>   I just removed the [un]lock_journal calls around a line where
>   we were tweaking the commit interval.
> 
>     --rusty
> 

Here is the same patch cut against the new svn tree.


Index: src/journal.c
===================================================================
--- src/journal.c	(revision 738)
+++ src/journal.c	(working copy)
@@ -656,7 +656,7 @@
 		break;
 
 	case OCFS_JOURNAL_ACCESS_WRITE:
-		status = journal_get_write_access(handle->k_handle, bh);
+		status = journal_get_write_access(handle->k_handle, bh, NULL);
 		break;
 
 	default:
@@ -899,7 +899,7 @@
 	OCFS_BH_PUT_DATA(bh);
 	fe = NULL;
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-	inode = ocfs_iget (sb, &args);
+	inode = ocfs_iget (osb->sb, &args);
 #else
 	inode = ocfs_get_inode_from_offset(osb, args.offset, bh);
 #endif
@@ -935,9 +935,13 @@
 
 	LOG_TRACE_STR("Returned from journal_init_inode");
 	LOG_TRACE_ARGS("k_journal->j_maxlen = %u\n", k_journal->j_maxlen);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+	k_journal->j_commit_interval = OCFS_DEFAULT_COMMIT_INTERVAL;
+#else
 	lock_journal(k_journal);
 	k_journal->j_commit_interval = OCFS_DEFAULT_COMMIT_INTERVAL;
 	unlock_journal(k_journal);
+#endif
 
 	/* yay, pass the proper info back to our journal structure. */
 	osb->journal.osb = osb;
@@ -1376,12 +1380,14 @@
 	ocfs_super *osb = ((struct ocfs_recover_arg *) arg)->osb;
 	int node_num = ((struct ocfs_recover_arg *) arg)->node_num;
 	int status = 0;
+	char proc[16];
 
 	LOG_ENTRY_ARGS("(node_num=%d, osb->node_num = %d)\n", node_num,
 		       osb->node_num);
 
-	daemonize();
-	reparent_to_init();
+	sprintf (proc, "ocfs2rec-%d", osb->osb_id);
+	ocfs_daemonize (proc, strlen(proc));
+
 #ifdef HAVE_NPTL
 	spin_lock_irq (&current->sighand->siglock);
 	sigfillset(&current->blocked);
@@ -1531,7 +1537,7 @@
 	OCFS_BH_PUT_DATA(bh);
 	fe = NULL;
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-	inode = ocfs_iget (sb, &args);
+	inode = ocfs_iget (osb->sb, &args);
 #else
 	inode = ocfs_get_inode_from_offset(osb, args.offset, bh);
 #endif

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Ocfs2-devel] [PATCH]2.6 fixes in journal.c
  2004-03-01 10:54 ` Rusty Lynch
@ 2004-03-01 16:06   ` Mark Fasheh
  2004-03-01 16:36   ` Rusty Lynch
  1 sibling, 0 replies; 5+ messages in thread
From: Mark Fasheh @ 2004-03-01 16:06 UTC (permalink / raw)
  To: ocfs2-devel

On Mon, Mar 01, 2004 at 08:54:47AM -0800, Rusty Lynch wrote:
> Here is the same patch cut against the new svn tree.
> 
> 
> Index: src/journal.c
> ===================================================================
> --- src/journal.c	(revision 738)
> +++ src/journal.c	(working copy)
> @@ -656,7 +656,7 @@
>  		break;
>  
>  	case OCFS_JOURNAL_ACCESS_WRITE:
> -		status = journal_get_write_access(handle->k_handle, bh);
> +		status = journal_get_write_access(handle->k_handle, bh, NULL);
>  		break;
Can we put an #if LINUX_VERSION_CODE around that one please? Passing NULL in
2.6 for the credits argument is fine.

>  
>  	default:
> @@ -899,7 +899,7 @@
>  	OCFS_BH_PUT_DATA(bh);
>  	fe = NULL;
>  #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
> -	inode = ocfs_iget (sb, &args);
> +	inode = ocfs_iget (osb->sb, &args);
>  #else
>  	inode = ocfs_get_inode_from_offset(osb, args.offset, bh);
>  #endif
> @@ -935,9 +935,13 @@
>  
>  	LOG_TRACE_STR("Returned from journal_init_inode");
>  	LOG_TRACE_ARGS("k_journal->j_maxlen = %u\n", k_journal->j_maxlen);
> +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
> +	k_journal->j_commit_interval = OCFS_DEFAULT_COMMIT_INTERVAL;
> +#else
>  	lock_journal(k_journal);
>  	k_journal->j_commit_interval = OCFS_DEFAULT_COMMIT_INTERVAL;
>  	unlock_journal(k_journal);
> +#endif
Ok, you can actually just remove that lock_journal/unlock_journal pair. At
that point in the JBD init cycle, we don't have to worry about protecting
that variable.

The rest of the patch looks good, so if you could just fix those two things,
I'll commit.
	--Mark

--
Mark Fasheh
Software Developer, Oracle Corp
mark.fasheh@oracle.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Ocfs2-devel] [PATCH]2.6 fixes in journal.c
  2004-03-01 10:54 ` Rusty Lynch
  2004-03-01 16:06   ` Mark Fasheh
@ 2004-03-01 16:36   ` Rusty Lynch
  2004-03-01 17:43     ` Mark Fasheh
  1 sibling, 1 reply; 5+ messages in thread
From: Rusty Lynch @ 2004-03-01 16:36 UTC (permalink / raw)
  To: ocfs2-devel

On Mon, Mar 01, 2004 at 08:54:47AM -0800, Rusty Lynch wrote:
> On Thu, Feb 26, 2004 at 06:16:49PM -0800, Rusty Lynch wrote:
> > The following is a patch that fixes some small 2.6 issues with
> > journal.c
> > 
> > * journal_get_write_access now has an additional "credits" argument
> >   that appears to be safe to pass in as null.  (Other people are
> >   doing it and the code in the latest bk tree always test for null
> >   before attempting to incrementing it.)
> > * small typo in an ocfs_iget call
> > * remaining call to daemonize that is moved to the 2.6 safe
> >   ocfs_daemonize call
> > * WARNING!!! Here is the thing I am not sure about!
> >   The lock_journal/unlock_journal calls do not exist anymore.
> >   There is a journal_[un]lock_updates() function, but it is 
> >   unclear when to use that function.
> > 
> >   I just removed the [un]lock_journal calls around a line where
> >   we were tweaking the commit interval.

The following patch addes #if LINUX_VERSION_CODE wrappers around the
journal_get_write_access() call, and drops the journal locking calls for
both the 2.4 and 2.6 code when the commit interval is set durring journal
initialization.


Index: src/journal.c
===================================================================
--- src/journal.c	(revision 738)
+++ src/journal.c	(working copy)
@@ -656,7 +656,11 @@
 		break;
 
 	case OCFS_JOURNAL_ACCESS_WRITE:
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+		status = journal_get_write_access(handle->k_handle, bh, NULL);
+#else
 		status = journal_get_write_access(handle->k_handle, bh);
+#endif
 		break;
 
 	default:
@@ -899,7 +903,7 @@
 	OCFS_BH_PUT_DATA(bh);
 	fe = NULL;
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-	inode = ocfs_iget (sb, &args);
+	inode = ocfs_iget (osb->sb, &args);
 #else
 	inode = ocfs_get_inode_from_offset(osb, args.offset, bh);
 #endif
@@ -935,9 +939,7 @@
 
 	LOG_TRACE_STR("Returned from journal_init_inode");
 	LOG_TRACE_ARGS("k_journal->j_maxlen = %u\n", k_journal->j_maxlen);
-	lock_journal(k_journal);
 	k_journal->j_commit_interval = OCFS_DEFAULT_COMMIT_INTERVAL;
-	unlock_journal(k_journal);
 
 	/* yay, pass the proper info back to our journal structure. */
 	osb->journal.osb = osb;
@@ -1376,12 +1378,14 @@
 	ocfs_super *osb = ((struct ocfs_recover_arg *) arg)->osb;
 	int node_num = ((struct ocfs_recover_arg *) arg)->node_num;
 	int status = 0;
+	char proc[16];
 
 	LOG_ENTRY_ARGS("(node_num=%d, osb->node_num = %d)\n", node_num,
 		       osb->node_num);
 
-	daemonize();
-	reparent_to_init();
+	sprintf (proc, "ocfs2rec-%d", osb->osb_id);
+	ocfs_daemonize (proc, strlen(proc));
+
 #ifdef HAVE_NPTL
 	spin_lock_irq (&current->sighand->siglock);
 	sigfillset(&current->blocked);
@@ -1531,7 +1535,7 @@
 	OCFS_BH_PUT_DATA(bh);
 	fe = NULL;
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-	inode = ocfs_iget (sb, &args);
+	inode = ocfs_iget (osb->sb, &args);
 #else
 	inode = ocfs_get_inode_from_offset(osb, args.offset, bh);
 #endif

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Ocfs2-devel] [PATCH]2.6 fixes in journal.c
  2004-03-01 16:36   ` Rusty Lynch
@ 2004-03-01 17:43     ` Mark Fasheh
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Fasheh @ 2004-03-01 17:43 UTC (permalink / raw)
  To: ocfs2-devel

On Mon, Mar 01, 2004 at 02:36:27PM -0800, Rusty Lynch wrote:
> The following patch addes #if LINUX_VERSION_CODE wrappers around the
> journal_get_write_access() call, and drops the journal locking calls for
> both the 2.4 and 2.6 code when the commit interval is set durring journal
> initialization.
Alright, committed.
	--Mark

--
Mark Fasheh
Software Developer, Oracle Corp
mark.fasheh@oracle.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-03-01 17:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-26 20:16 [Ocfs2-devel] [PATCH]2.6 fixes in journal.c Rusty Lynch
2004-03-01 10:54 ` Rusty Lynch
2004-03-01 16:06   ` Mark Fasheh
2004-03-01 16:36   ` Rusty Lynch
2004-03-01 17:43     ` Mark Fasheh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.