GFS2: Daemons and address space operations
PATCH 4/16 GFS2: Daemons and address space operations
[PATCH 04/16] GFS2: Daemons and address space operations
The GFS2 kernel threads, logging operations and page cache interface code.
fs/gfs2/daemon.c | 196 +++++++++++ fs/gfs2/daemon.h | 19 + fs/gfs2/lops.c | 811 +++++++++++++++++++++++++++++++++++++++++++++++++ fs/gfs2/lops.h | 96 +++++ fs/gfs2/main.c | 148 +++++++++ fs/gfs2/meta_io.c | 779 +++++++++++++++++++++++++++++++++++++++++++++++ fs/gfs2/meta_io.h | 74 ++++ fs/gfs2/ondisk.c | 308 ++++++++++++++++++ fs/gfs2/ops_address.c | 819 ++++++++++++++++++++++++++++++++++++++++++++++++++ fs/gfs2/ops_address.h | 18 + 10 files changed, 3268 insertions(+)
fs/gfs2/daemon.c new file +196 -0
@@ -0,0 +1,196 @@ +/* +* Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. +* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved. +* +* This copyrighted material is made available to anyone wishing to use, +* modify, copy, or redistribute it subject to the terms and conditions +* of the GNU General Public License v.2. +*/ + +#include <linux/sched.h> +#include <linux/slab.h> +#include <linux/spinlock.h> +#include <linux/completion.h> +#include <linux/buffer_head.h> +#include <linux/kthread.h> +#include <linux/delay.h> +#include <linux/gfs2_ondisk.h> + +#include "gfs2.h" +#include "lm_interface.h" +#include "incore.h" +#include "daemon.h" +#include "glock.h" +#include "log.h" +#include "quota.h" +#include "recovery.h" +#include "super.h" +#include "util.h" + +/* This uses schedule_timeout() instead of msleep() because it's good for +the daemons to wake up more often than the timeout when unmounting so +the user's unmount doesn't sit there forever. ++ The kthread functions used to start these daemons block and flush signals. */ + +/** +* gfs2_scand - Look for cached glocks and inodes to toss from memory +* @sdp: Pointer to GFS2 superblock +* +* One of these daemons runs, finding candidates to add to sd_reclaim_list. +* See gfs2_glockd() +*/ + +int gfs2_scand (void *data) +{ +struct gfs2_sbd *sdp = data; +unsigned long t; + +while (!kthread_should_stop ()) { +gfs2_scand_internal (sdp); + t =gfs2_tune_get (sdp, gt_scand_secs) *HZ ; +schedule_timeout_interruptible (t); + } + +return 0 ; +} + +/** +* gfs2_glockd - Reclaim unused glock structures +* @sdp: Pointer to GFS2 superblock +* +* One or more of these daemons run, reclaiming glocks on sd_reclaim_list. +* Number of daemons can be set by user, with num_glockd mount option. +*/ + +int gfs2_glockd (void *data) +{ +struct gfs2_sbd *sdp = data; + +while (!kthread_should_stop ()) { +while (atomic_read (&sdp->sd_reclaim_count)) +gfs2_reclaim_glock (sdp); + +wait_event_interruptible (sdp->sd_reclaim_wq, + (atomic_read (&sdp->sd_reclaim_count) || +kthread_should_stop ())); + } + +return 0 ; +} + +/** +* gfs2_recoverd - Recover dead machine's journals +* @sdp: Pointer to GFS2 superblock +* +*/ + +int gfs2_recoverd (void *data) +{ +struct gfs2_sbd *sdp = data; +unsigned long t; + +while (!kthread_should_stop ()) { +gfs2_check_journals (sdp); + t =gfs2_tune_get (sdp, gt_recoverd_secs) *HZ ; +schedule_timeout_interruptible (t); + } + +return 0 ; +} + +/** +* gfs2_logd - Update log tail as Active Items get flushed to in-place blocks +* @sdp: Pointer to GFS2 superblock +* +* Also, periodically check to make sure that we're using the most recent +* journal index. +*/ + +int gfs2_logd (void *data) +{ +struct gfs2_sbd *sdp = data; +struct gfs2_holder ji_gh; +unsigned long t; + +while (!kthread_should_stop ()) { +/* Advance the log tail */ + + t = sdp->sd_log_flush_time + +gfs2_tune_get (sdp, gt_log_flush_secs) *HZ ; + +gfs2_ail1_empty (sdp,DIO_ALL ); + +if (time_after_eq (jiffies, t)) { +gfs2_log_flush (sdp,NULL ); + sdp->sd_log_flush_time = jiffies; + } + +/* Check for latest journal index */ + + t = sdp->sd_jindex_refresh_time + +gfs2_tune_get (sdp, gt_jindex_refresh_secs) *HZ ; + +if (time_after_eq (jiffies, t)) { +if (!gfs2_jindex_hold (sdp, &ji_gh)) +gfs2_glock_dq_uninit (&ji_gh); + sdp->sd_jindex_refresh_time = jiffies; + } + + t =gfs2_tune_get (sdp, gt_logd_secs) *HZ ; +schedule_timeout_interruptible (t); + } + +return 0 ; +} + +/** +* gfs2_quotad - Write cached quota changes into the quota file +* @sdp: Pointer to GFS2 superblock +* +*/ + +int gfs2_quotad (void *data) +{ +struct gfs2_sbd *sdp = data; +unsigned long t; +int error; + +while (!kthread_should_stop ()) { +/* Update the master statfs file */ + + t = sdp->sd_statfs_sync_time + +gfs2_tune_get (sdp, gt_statfs_quantum) *HZ ; + +if (time_after_eq (jiffies, t)) { + error =gfs2_statfs_sync (sdp); +if (error && + error != -EROFS && + !test_bit (SDF_SHUTDOWN , &sdp->sd_flags)) +fs_err (sdp,"quotad: (1) error=%d\n" , error); + sdp->sd_statfs_sync_time = jiffies; + } + +/* Update quota file */ + + t = sdp->sd_quota_sync_time + +gfs2_tune_get (sdp, gt_quota_quantum) *HZ ; + +if (time_after_eq (jiffies, t)) { + error =gfs2_quota_sync (sdp); +if (error && + error != -EROFS && + !test_bit (SDF_SHUTDOWN , &sdp->sd_flags)) +fs_err (sdp,"quotad: (2) error=%d\n" , error); + sdp->sd_quota_sync_time = jiffies; + } + +gfs2_quota_scan (sdp); + + t =gfs2_tune_get (sdp, gt_quotad_secs) *HZ ; +schedule_timeout_interruptible (t); + } + +return 0 ; +} +
fs/gfs2/daemon.h new file +19 -0
@@ -0,0 +1,19 @@ +/* +* Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. +* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved. +* +* This copyrighted material is made available to anyone wishing to use, +* modify, copy, or redistribute it subject to the terms and conditions +* of the GNU General Public License v.2. +*/ + +#ifndef __DAEMON_DOT_H__ +#define __DAEMON_DOT_H__ + +int gfs2_scand (void *data); +int gfs2_glockd (void *data); +int gfs2_recoverd (void *data); +int gfs2_logd (void *data); +int gfs2_quotad (void *data); + +#endif /* __DAEMON_DOT_H__ */
fs/gfs2/lops.c new file +811 -0
811 lines not on this page · raw message
fs/gfs2/lops.h new file +96 -0
96 lines not on this page · raw message
fs/gfs2/main.c new file +148 -0
148 lines not on this page · raw message
fs/gfs2/meta_io.c new file +779 -0
779 lines not on this page · raw message
fs/gfs2/meta_io.h new file +74 -0
74 lines not on this page · raw message
fs/gfs2/ondisk.c new file +308 -0
308 lines not on this page · raw message
fs/gfs2/ops_address.c new file +819 -0
569 lines not on this page · raw message
fs/gfs2/ops_address.h new file +18 -0
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.
Quoted 4 lines
fs/gfs2/lops.c new file +3
-0+static void buf_lo_before_commit (struct gfs2_sbd *sdp) +{ +struct buffer_head *bh;
fs/gfs2/lops.c line 121
Quoted 10 lines
fs/gfs2/lops.c new file +10
-0+struct gfs2_log_descriptor *ld; +struct gfs2_bufdata *bd1 =NULL , *bd2; +unsigned int total = sdp->sd_log_num_buf; +unsigned int offset =sizeof (struct gfs2_log_descriptor ); +unsigned int limit; +unsigned int num; +unsigned n; +__be64 *ptr; + + offset += (sizeof (__be64) -1 );
-()
fs/gfs2/lops.c line 134
Quoted 2 lines
fs/gfs2/lops.c new file +2
-0+ ld = (struct gfs2_log_descriptor *)bh->b_data; + ptr = (__be64 *)(bh->b_data + offset);
Hm too bad that b_data (include/linux/buffer_head.h) is a char*.
fs/gfs2/lops.c line 223
Quoted 13 lines
fs/gfs2/lops.c new file +13
-0+gfs2_replay_incr_blk (sdp, &start); + +for (; blks;gfs2_replay_incr_blk (sdp, &start), blks--) { + blkno =be64_to_cpu (*ptr++); + + sdp->sd_found_blocks++; + +if (gfs2_revoke_check (sdp, blkno, start)) +continue ; + + error =gfs2_replay_read_block (jd, start, &bh_log); +if (error) +return error;
Last two lines do not match your usual indent.
fs/gfs2/lops.c line 252
Quoted 8 lines
fs/gfs2/lops.c new file +8
-0+static void buf_lo_after_scan (struct gfs2_jdesc *jd,int error,int pass) +{ +struct gfs2_inode *ip =GFS2_I (jd->jd_inode); +struct gfs2_sbd *sdp =GFS2_SB (jd->jd_inode); + +if (error) { +gfs2_meta_sync (ip->i_gl, +DIO_START |DIO_WAIT );
gfs2_meta_sync() would fit on one line.
fs/gfs2/lops.h line 11
Quoted 4 lines
fs/gfs2/lops.h new file +3
-0+ offset += (2 *sizeof (__be64) -1 ); +#ifndef __LOPS_DOT_H__ +#define __LOPS_DOT_H__
+struct gfs2_log_operations;
Making sure every .h file would "compile" on its own, this also means #include <linux/list.h> for the below, f.ex..
fs/gfs2/lops.h
Quoted 13 lines
fs/gfs2/lops.h new file +12
-0+ +static inline void lops_init_le (struct gfs2_log_element *le, +const struct gfs2_log_operations *lops) +{ +INIT_LIST_HEAD (&le->le_list); + le->le_ops = lops; +} + +#endif /* __LOPS_DOT_H__ */ +MODULE_DESCRIPTION ("Global File System" ); +MODULE_AUTHOR ("Red Hat, Inc." ); +MODULE_LICENSE ("GPL" );
Maybe there should be at least one humna person listen in AUTHOR.
fs/gfs2/meta_io.c line 57
Quoted 4 lines
fs/gfs2/meta_io.c new file +4
-0+static const struct address_space_operations aspace_aops = { + .writepage = gfs2_aspace_writepage, + .releasepage = gfs2_releasepage, +};
Not all multi-line structs (such as these) have a , on the last element.
Quoted 15 lines
fs/gfs2/meta_io.c new file +15
-0+void gfs2_attach_bufdata (struct gfs2_glock *gl,struct buffer_head *bh, +int meta) +{ +struct gfs2_bufdata *bd; + +if (meta) +lock_page (bh->b_page); + +if (bh->b_private) { +if (meta) +unlock_page (bh->b_page); +return ; + } + + bd = kmem_cache_alloc(gfs2_bufdata_cachep, GFP_NOFS | __GFP_NOFAIL),
fs/gfs2/meta_io.c line 467
Quoted 10 lines
fs/gfs2/meta_io.c new file +10
-0+memset (bd,0 ,sizeof (struct gfs2_bufdata )); + bd->bd_bh = bh; + bd->bd_gl = gl; + +INIT_LIST_HEAD (&bd->bd_list_tr); +if (meta) { +lops_init_le (&bd->bd_le, &gfs2_buf_lops); + }else { +lops_init_le (&bd->bd_le, &gfs2_databuf_lops); + }
-{}
fs/gfs2/ondisk.c line 41
Quoted 7 lines
fs/gfs2/ondisk.c new file +7
-0+void gfs2_inum_in (struct gfs2_inum *no,char *buf) +{ +struct gfs2_inum *str = (struct gfs2_inum *)buf; + + no->no_formal_ino =be64_to_cpu (str->no_formal_ino); + no->no_addr =be64_to_cpu (str->no_addr); +}
Hm, how about
void gfs2_inum_in(struct gfs2_inum *no, void *buf)
{
const struct gfs2_inum *str = buf;
no->no_formal_ino = be64_to_cpu(str->no_formal_ino);
no->no_addr = be64_to_cpu(str->no_addr);
}That is, making the 2nd argument a void*, and the cast can go away. The callers most likely also can have their casts dropped, since to-void* is also implicit. Also applies to
+void gfs2_inum_out(const struct gfs2_inum *no, char *buf) +static void gfs2_meta_header_in(struct gfs2_meta_header *mh, char *buf) +static void gfs2_meta_header_out(struct gfs2_meta_header *mh, char *buf) +void gfs2_sb_in(struct gfs2_sb *sb, char *buf)
+void gfs2_rindex_in(struct gfs2_rindex *ri, char *buf)
+void gfs2_rgrp_in(struct gfs2_rgrp *rg, char *buf)
+void gfs2_rgrp_out(struct gfs2_rgrp *rg, char *buf)
+void gfs2_quota_in(struct gfs2_quota *qu, char *buf)
+void gfs2_dinode_in(struct gfs2_dinode *di, char *buf)
+void gfs2_dinode_out(struct gfs2_dinode *di, char *buf) +void gfs2_log_header_in(struct gfs2_log_header *lh, char *buf) +void gfs2_inum_range_in(struct gfs2_inum_range *ir, char *buf) +void gfs2_inum_range_out(struct gfs2_inum_range *ir, char *buf) +void gfs2_statfs_change_in(struct gfs2_statfs_change *sc, char *buf) +void gfs2_statfs_change_out(struct gfs2_statfs_change *sc, char *buf) +void gfs2_quota_change_in(struct gfs2_quota_change *qc, char *buf)
Review
Quoted 2 lines
+++
b/fs/gfs2/ops_address.c(quoted diff) +1
-0+ if (likely(file != &gfs2_internal_file_sentinal)) {
The thing is usually called "sentinel". Alan might prove me wrong that both spelling variants are possible :-)
Quoted 18 lines
fs/gfs2/ops_address.c new file +18
-0+static int gfs2_commit_write (struct file *file,struct page *page, +unsigned from,unsigned to) +{ +struct inode *inode = page->mapping->host; +struct gfs2_inode *ip =GFS2_I (inode); +struct gfs2_sbd *sdp =GFS2_SB (inode); +int error = -EOPNOTSUPP ; +struct buffer_head *dibh; +struct gfs2_alloc *al = &ip->i_alloc;; + +if (gfs2_assert_withdraw (sdp,gfs2_glock_is_locked_by_me (ip->i_gl))) + goto fail_nounlock; + + error =gfs2_meta_inode_buffer (ip, &dibh); +if (error) + goto fail_endtrans; + +gfs2_trans_add_bh (ip->i_gl, dibh,1 );
fs/gfs2/ops_address.c line 520
Quoted 10 lines
fs/gfs2/ops_address.c new file +10
-0+ +if (gfs2_is_stuffed (ip)) { +uint64_t file_size; +void *kaddr; + + file_size = ((uint64_t )page->index <<PAGE_CACHE_SHIFT ) + to; + + kaddr =kmap_atomic (page,KM_USER0 ); +memcpy (dibh->b_data +sizeof (struct gfs2_dinode ) + from, + (char *)kaddr + from, to - from);
Nocast kaddr + from.
fs/gfs2/ops_address.c line 705
Quoted 3 lines
fs/gfs2/ops_address.c new file +3
-0+static void stuck_releasepage (struct buffer_head *bh) +{ +static unsigned limit =0 ;
Is this really ok to have?
Jan Engelhardt
Signature · 2 lines
-- VGER BF report: H 0.000958328
Hi,
Quoted 2 lines · Jan Engelhardt
Review
Quoted 2 lines
(quoted diff) +2
-0+static void buf_lo_before_commit(struct gfs2_sbd *sdp) +{
[some lines snipped]
Quoted 5 lines
fs/gfs2/lops.c line 121
Quoted 2 lines
fs/gfs2/lops.c new file +2
-0+ + offset += (sizeof (__be64) -1 );-()
ok.
Quoted 5 lines
fs/gfs2/lops.c line 134
Quoted 2 lines
fs/gfs2/lops.c new file +2
-0+ ld = (struct gfs2_log_descriptor *)bh->b_data; + ptr = (__be64 *)(bh->b_data + offset);Hm too bad that
b_data(include/linux/buffer_head.h) is a char*.
Indeed.
Quoted 7 lines
Quoted 7 lines
fs/gfs2/lops.c new file +7
-0+gfs2_replay_incr_blk (sdp, &start); + +for (; blks;gfs2_replay_incr_blk (sdp, &start), blks--) { + blkno =be64_to_cpu (*ptr++); + + sdp->sd_found_blocks++; +
Quoted 9 lines
fs/gfs2/lops.c line 223
Quoted 6 lines
fs/gfs2/lops.c new file +6
-0+if (gfs2_revoke_check (sdp, blkno, start)) +continue ; + + error =gfs2_replay_read_block (jd, start, &bh_log); +if (error) +return error;Last two lines do not match your usual indent.
ok, now fixed.
Quoted 10 lines
fs/gfs2/lops.c line 252
Quoted 8 lines
fs/gfs2/lops.c new file +8
-0+static void buf_lo_after_scan (struct gfs2_jdesc *jd,int error,int pass) +{ +struct gfs2_inode *ip =GFS2_I (jd->jd_inode); +struct gfs2_sbd *sdp =GFS2_SB (jd->jd_inode); + +if (error) { +gfs2_meta_sync (ip->i_gl, +DIO_START |DIO_WAIT );
gfs2_meta_sync()would fit on one line.
ok.
Quoted 10 lines
fs/gfs2/lops.h line 11
Quoted 4 lines
fs/gfs2/lops.h new file +3
-0+ offset += (2 *sizeof (__be64) -1 ); +#ifndef __LOPS_DOT_H__ +#define __LOPS_DOT_H__+struct
gfs2_log_operations;Making sure every .h file would "compile" on its own, this also means #include <
linux/list.h> for the below, f.ex..
Is this really a requirement? I suspect there are a fair few exception to this over the kernel code.
Quoted 10 lines
Quoted 9 lines
fs/gfs2/lops.h new file +9
-0+ +static inline void lops_init_le (struct gfs2_log_element *le, +const struct gfs2_log_operations *lops) +{ +INIT_LIST_HEAD (&le->le_list); + le->le_ops = lops; +} + +#endif /* __LOPS_DOT_H__ */
Quoted 6 lines
fs/gfs2/main.c line 144
Quoted 3 lines
fs/gfs2/main.c new file +3
-0+MODULE_DESCRIPTION ("Global File System" ); +MODULE_AUTHOR ("Red Hat, Inc." ); +MODULE_LICENSE ("GPL" );Maybe there should be at least one humna person listen in AUTHOR.
Ok, I'll get back to you on that one :-)
Quoted 7 lines
fs/gfs2/meta_io.c line 57
Quoted 4 lines
fs/gfs2/meta_io.c new file +4
-0+static const struct address_space_operations aspace_aops = { + .writepage = gfs2_aspace_writepage, + .releasepage = gfs2_releasepage, +};Not all multi-line structs (such as these) have a , on the last element.
Are you saying that they should all end in a , or that they should not, or even just that it should be consistent?
Quoted 3 lines
fs/gfs2/meta_io.c line 445
Quoted 3 lines
fs/gfs2/meta_io.c new file +3
-0+void gfs2_attach_bufdata (struct gfs2_glock *gl,struct buffer_head *bh, +int meta) +{
[code snipped]
Quoted 9 lines
fs/gfs2/meta_io.c line 467
Quoted 6 lines
fs/gfs2/meta_io.c new file +6
-0+INIT_LIST_HEAD (&bd->bd_list_tr); +if (meta) { +lops_init_le (&bd->bd_le, &gfs2_buf_lops); + }else { +lops_init_le (&bd->bd_le, &gfs2_databuf_lops); + }-{}
ok.
Quoted 10 lines
Hm, how about
void
gfs2_inum_in(struct gfs2_inum *no, void *buf){ const struct gfs2_inum *str = buf; no->no_formal_ino = be64_to_cpu(str->no_formal_ino); no->no_addr = be64_to_cpu(str->no_addr); }
Quoted 4 lines
That is, making the 2nd argument a void*, and the cast can go away. The callers most likely also can have their casts dropped, since to-void* is also implicit. Also applies to
Yes, and also I've updated all the other similar functions as requested.
Quoted 6 lines
Review
Quoted 2 lines
+++
b/fs/gfs2/ops_address.c(quoted diff) +1
-0+ if (likely(file != &gfs2_internal_file_sentinal)) {The thing is usually called "sentinel". Alan might prove me wrong that both spelling variants are possible :-)
I think you are right, so I've changed it.
Quoted 3 lines
fs/gfs2/ops_address.c line 495
Quoted 3 lines
fs/gfs2/ops_address.c new file +3
-0+static int gfs2_commit_write (struct file *file,struct page *page, +unsigned from,unsigned to) +{
[code snipped]
Quoted 6 lines
fs/gfs2/ops_address.c line 520
Quoted 3 lines
fs/gfs2/ops_address.c new file +3
-0+ kaddr =kmap_atomic (page,KM_USER0 ); +memcpy (dibh->b_data +sizeof (struct gfs2_dinode ) + from, + (char *)kaddr + from, to - from);Nocast kaddr + from.
ok.
Quoted 6 lines
fs/gfs2/ops_address.c line 705
Quoted 3 lines
fs/gfs2/ops_address.c new file +3
-0+static void stuck_releasepage (struct buffer_head *bh) +{ +static unsigned limit =0 ;Is this really ok to have?
I think so. I don't really care about the odd race here. All I want to do is ensure that in the (very unlikely, I hope) situation of this function being called, we don't land up generating huge amounts of debugging information. Usually only the first message will have the useful information in it, so this was just to ensure that we are not flooded. I have made a slight change to it though. Let me know if you'd like some further changes in this area.
Patches relating to this email:
http://www.kernel.org/git/?p=linux/kernel/git/steve/gfs2-2.6.git;a=commitdiff;h=82ffa51637f9239aaddd3151fb0d41c657f760db
http://www.kernel.org/git/?p=linux/kernel/git/steve/gfs2-2.6.git;a=commitdiff;h=38c60ef228596c8e331437ea9287ce035706b107
http://www.kernel.org/git/?p=linux/kernel/git/steve/gfs2-2.6.git;a=commitdiff;h=dd538c832aaf8e35c46c98a825fa9dacee3cf226
http://www.kernel.org/git/?p=linux/kernel/git/steve/gfs2-2.6.git;a=commitdiff;h=0bd5996a00346fee772cbdebc5666fd4e514089b
Steve.
Quoted 8 lines
Quoted 8 lines
fs/gfs2/lops.h line 11
Quoted 5 lines
fs/gfs2/lops.h new file +3
-0+ offset += (2 *sizeof (__be64) -1 ); +#ifndef __LOPS_DOT_H__ +#define __LOPS_DOT_H__+struct
gfs2_log_operations;
Quoted 5 lines
Quoted 3 lines
Making sure every .h file would "compile" on its own, this also means #include <
linux/list.h> for the below, f.ex..Is this really a requirement? I suspect there are a fair few exception to this over the kernel code.
A requirement - not yet. I could not find my own post about it, but this one is a similar one two years earlier http://lkml.org/lkml/2004/6/15/90
Quoted 3 lines
Quoted 2 lines
Maybe there should be at least one humna person listen in AUTHOR.
Ok, I'll get back to you on that one :-)
Should have been "human" of course.
Quoted 2 lines
Are you saying that they should all end in a , or that they should not, or even just that it should be consistent?
There seems to be no explicit CodingStyle rule at this point, so you are free to choose either. Just be consistent (like with the goto labels).
Quoted 7 lines
Quoted 6 lines
Review
Quoted 2 lines
+++
b/fs/gfs2/ops_address.c(quoted diff) +1
-0+ if (likely(file != &gfs2_internal_file_sentinal)) {The thing is usually called "sentinel". Alan might prove me wrong that both spelling variants are possible :-)
I think you are right, so I've changed it.
http://dictionary.reference.com/search?q=sentinal&x=0&y=0
W.W.W.W.W.
Quoted 10 lines
Quoted 6 lines
fs/gfs2/ops_address.c line 705
Quoted 3 lines
fs/gfs2/ops_address.c new file +3
-0+static void stuck_releasepage (struct buffer_head *bh) +{ +static unsigned limit =0 ;Is this really ok to have?
I think so. I don't really care about the odd race here. All I want to do is ensure that in the (very unlikely, I hope) situation of this function being called, we don't land up generating huge amounts of debugging information. Usually only the first message will have the
There is printk_ratelimit() and SUBSYSTEM_ratelimit().
Quoted 3 lines
useful information in it, so this was just to ensure that we are not flooded. I have made a slight change to it though. Let me know if you'd like some further changes in this area.
Jan Engelhardt
Hi,
Quoted 7 lines · Jan Engelhardt
Quoted 7 lines
Quoted 7 lines
fs/gfs2/lops.h line 11
Quoted 4 lines
fs/gfs2/lops.h new file +3
-0+ offset += (2 *sizeof (__be64) -1 ); +#ifndef __LOPS_DOT_H__ +#define __LOPS_DOT_H__+struct
gfs2_log_operations;
Quoted 9 lines
Quoted 5 lines
Quoted 3 lines
Making sure every .h file would "compile" on its own, this also means #include <
linux/list.h> for the below, f.ex..Is this really a requirement? I suspect there are a fair few exception to this over the kernel code.
A requirement - not yet. I could not find my own post about it, but this one is a similar one two years earlier http://lkml.org/lkml/2004/6/15/90
Ok. I've had a go at that:
http://www.kernel.org/git/?p=linux/kernel/git/steve/gfs2-2.6.git;a=commitdiff;h=f2f7ba5237e2fe10ba3e328a4f728b9e1ff141da
Quoted 6 lines
Quoted 3 lines
Quoted 2 lines
Maybe there should be at least one humna person listen in AUTHOR.
Ok, I'll get back to you on that one :-)
Should have been "human" of course.
Yes, I'd realised that, its a question of which one to put in. Even though I've been working on this for almost a year now, its still true to say that Ken Preslan's code is more numerous than mine. So I'm not sure that I should claim authorship for myself, on the other hand, if this is a statement of where bug fixes should be sent, then I'm probably as good a choice as any. There are of course a lot of other contributors both from within Red Hat, and particularly since the review process started, from outside Red Hat too.
Quoted 6 lines
Quoted 2 lines
Are you saying that they should all end in a , or that they should not, or even just that it should be consistent?
There seems to be no explicit CodingStyle rule at this point, so you are free to choose either. Just be consistent (like with the goto labels).
Ok, now fixed in:
http://www.kernel.org/git/?p=linux/kernel/git/steve/gfs2-2.6.git;a=commitdiff;h=ea67eedb211d3418fa62fe3477e0d19b2888225e
Quoted 11 lines
Quoted 7 lines
Quoted 6 lines
Review
Quoted 2 lines
+++
b/fs/gfs2/ops_address.c(quoted diff) +1
-0+ if (likely(file != &gfs2_internal_file_sentinal)) {The thing is usually called "sentinel". Alan might prove me wrong that both spelling variants are possible :-)
I think you are right, so I've changed it.
http://dictionary.reference.com/search?q=sentinal&x=0&y=0
W.W.W.W.W.
Yes, and my (rather small) treeware dictionary says likewise - its fixed now anyway.
Quoted 11 lines
Quoted 10 lines
Quoted 6 lines
fs/gfs2/ops_address.c line 705
Quoted 3 lines
fs/gfs2/ops_address.c new file +3
-0+static void stuck_releasepage (struct buffer_head *bh) +{ +static unsigned limit =0 ;Is this really ok to have?
I think so. I don't really care about the odd race here. All I want to do is ensure that in the (very unlikely, I hope) situation of this function being called, we don't land up generating huge amounts of debugging information. Usually only the first message will have the
Quoted 8 lines
There is
printk_ratelimit()andSUBSYSTEM_ratelimit().Quoted 3 lines
useful information in it, so this was just to ensure that we are not flooded. I have made a slight change to it though. Let me know if you'd like some further changes in this area.
Jan Engelhardt
Hmm. I'm not sure that this would really be the right thing... what I want is to limit the maximum number of times that this is triggered rather than limiting the rate at which its triggered. I think thats a subtle difference from the ratelimit functions,
Steve.