Skip to content

Commit

Permalink
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6
Browse files Browse the repository at this point in the history
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6:
  modules: better error messages when modules fail to load due to a sysfs problem.
  kobject: update documentation
  kset: kernel-doc cleanups
  driver core: revert "device" link creation check
  stable_api_nonsense.txt: Disambiguate the use of "this" by using "that" to refer to the syscall interface
  Fix Doc/sysfs-rules typos
  kernel-doc fixes for PCI and drivers/base/
  kobject: put kobject_actions in kobject.h
  kobject: fix link error when CONFIG_HOTPLUG is disabled
  HOWTO: sync Japanese HOWTO
  HOWTO: adjust translation header of Japanese stable_api_nonsense.txt
  • Loading branch information
Linus Torvalds committed Jul 30, 2007
2 parents 9f8e35f + 74c5b59 commit af94731
Show file tree
Hide file tree
Showing 11 changed files with 171 additions and 224 deletions.
66 changes: 35 additions & 31 deletions Documentation/ja_JP/HOWTO
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
NOTE:
This is Japanese translated version of "Documentation/HOWTO".
This one is maintained by Tsugikazu Shibata <[email protected]>
and JF Project team <www.linux.or.jp/JF>.
If you find difference with original file or problem in translation,
please contact maintainer of this file or JF project.

Please also note that purpose of this file is easier to read for non
English natives and not to be intended to fork. So, if you have any
comments or updates of this file, please try to update Original(English)
file at first.

Last Updated: 2007/06/04
NOTE:
This is a version of Documentation/HOWTO translated into Japanese.
This document is maintained by Tsugikazu Shibata <[email protected]>
and the JF Project team <www.linux.or.jp/JF>.
If you find any difference between this document and the original file
or a problem with the translation,
please contact the maintainer of this file or JF project.

Please also note that the purpose of this file is to be easier to read
for non English (read: Japanese) speakers and is not intended as a
fork. So if you have any comments or updates for this file, please try
to update the original English file first.

Last Updated: 2007/07/18
==================================
これは、
linux-2.6.21/Documentation/HOWTO
linux-2.6.22/Documentation/HOWTO
の和訳です。

翻訳団体: JF プロジェクト < http://www.linux.or.jp/JF/ >
翻訳日: 2007/06/04
翻訳日: 2007/07/16
翻訳者: Tsugikazu Shibata <tshibata at ab dot jp dot nec dot com>
校正者: 松倉さん <nbh--mats at nifty dot com>
小林 雅典さん (Masanori Kobayasi) <zap03216 at nifty dot ne dot jp>
Expand Down Expand Up @@ -52,6 +53,7 @@ Linux カーネル開発コミュニティと共に活動するやり方を学
また、このコミュニティがなぜ今うまくまわっているのかという理由の一部も
説明しようと試みています。


カーネルは 少量のアーキテクチャ依存部分がアセンブリ言語で書かれている
以外は大部分は C 言語で書かれています。C言語をよく理解していることはカー
ネル開発者には必要です。アーキテクチャ向けの低レベル部分の開発をするの
Expand Down Expand Up @@ -141,6 +143,7 @@ Linux カーネルソースツリーは幅広い範囲のドキュメントを
これらのルールに従えばうまくいくことを保証することではありません
が (すべてのパッチは内容とスタイルについて精査を受けるので)、
ルールに従わなければ間違いなくうまくいかないでしょう。

この他にパッチを作る方法についてのよくできた記述は-

"The Perfect Patch"
Expand Down Expand Up @@ -360,44 +363,42 @@ linux-kernel メーリングリストで収集された多数のパッチと同

git ツリー-
- Kbuild の開発ツリー、Sam Ravnborg <[email protected]>
kernel.org:/pub/scm/linux/kernel/git/sam/kbuild.git
git.kernel.org:/pub/scm/linux/kernel/git/sam/kbuild.git

- ACPI の開発ツリー、 Len Brown <[email protected]>
kernel.org:/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6.git
git.kernel.org:/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6.git

- Block の開発ツリー、Jens Axboe <[email protected]>
kernel.org:/pub/scm/linux/kernel/git/axboe/linux-2.6-block.git
git.kernel.org:/pub/scm/linux/kernel/git/axboe/linux-2.6-block.git

- DRM の開発ツリー、Dave Airlie <[email protected]>
kernel.org:/pub/scm/linux/kernel/git/airlied/drm-2.6.git
git.kernel.org:/pub/scm/linux/kernel/git/airlied/drm-2.6.git

- ia64 の開発ツリー、Tony Luck <[email protected]>
kernel.org:/pub/scm/linux/kernel/git/aegl/linux-2.6.git

- ieee1394 の開発ツリー、Jody McIntyre <[email protected]>
kernel.org:/pub/scm/linux/kernel/git/scjody/ieee1394.git
git.kernel.org:/pub/scm/linux/kernel/git/aegl/linux-2.6.git

- infiniband, Roland Dreier <[email protected]>
kernel.org:/pub/scm/linux/kernel/git/roland/infiniband.git
git.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband.git

- libata, Jeff Garzik <[email protected]>
kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev.git
git.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev.git

- ネットワークドライバ, Jeff Garzik <[email protected]>
kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6.git
git.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6.git

- pcmcia, Dominik Brodowski <[email protected]>
kernel.org:/pub/scm/linux/kernel/git/brodo/pcmcia-2.6.git
git.kernel.org:/pub/scm/linux/kernel/git/brodo/pcmcia-2.6.git

- SCSI, James Bottomley <[email protected]>
kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6.git

その他の git カーネルツリーは http://kernel.org/git に一覧表がありま
す。
git.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6.git

quilt ツリー-
- USB, PCI ドライバコアと I2C, Greg Kroah-Hartman <[email protected]>
kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/
- x86-64 と i386 の仲間 Andi Kleen <[email protected]>

その他のカーネルツリーは http://git.kernel.org/ と MAINTAINERS ファ
イルに一覧表があります。

バグレポート
-------------
Expand Down Expand Up @@ -508,6 +509,7 @@ MAINTAINERS ファイルにリストがありますので参照してくださ
せん*。単に自分のパッチに対して指摘された問題を全て修正して再送すれば
いいのです。


カーネルコミュニティと企業組織のちがい
-----------------------------------------------------------------

Expand Down Expand Up @@ -577,6 +579,7 @@ Linux カーネルコミュニティは、一度に大量のコードの塊を
かし、500行のパッチは、正しいことをレビューするのに数時間かかるかも
しれません(時間はパッチのサイズなどにより指数関数に比例してかかりま
す)

小さいパッチは何かあったときにデバッグもとても簡単になります。パッ
チを1個1個取り除くのは、とても大きなパッチを当てた後に(かつ、何かお
かしくなった後で)解剖するのに比べればとても簡単です。
Expand All @@ -591,6 +594,7 @@ Linux カーネルコミュニティは、一度に大量のコードの塊を
う。先生は簡潔な最高の解をみたいのです。良い生徒はこれを知って
おり、そして最終解の前の中間作業を提出することは決してないので
す"

カーネル開発でもこれは同じです。メンテナー達とレビューア達は、
問題を解決する解の背後になる思考プロセスをみたいとは思いません。
彼らは単純であざやかな解決方法をみたいのです。
Expand Down
20 changes: 10 additions & 10 deletions Documentation/ja_JP/stable_api_nonsense.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
NOTE:
This is a Japanese translated version of
"Documentation/stable_api_nonsense.txt".
This one is maintained by
IKEDA, Munehiro <[email protected]>
and JF Project team <http://www.linux.or.jp/JF/>.
If you find difference with original file or problem in translation,
This is a version of Documentation/stable_api_nonsense.txt into Japanese.
This document is maintained by IKEDA, Munehiro <[email protected]>
and the JF Project team <http://www.linux.or.jp/JF/>.
If you find any difference between this document and the original file
or a problem with the translation,
please contact the maintainer of this file or JF project.

Please also note that purpose of this file is easier to read for non
English natives and not to be intended to fork. So, if you have any
comments or updates of this file, please try to update
Original(English) file at first.
Please also note that the purpose of this file is to be easier to read
for non English (read: Japanese) speakers and is not intended as a
fork. So if you have any comments or updates of this file, please try
to update the original English file first.

Last Updated: 2007/07/18
==================================
これは、
linux-2.6.22-rc4/Documentation/stable_api_nonsense.txt の和訳
Expand Down
178 changes: 59 additions & 119 deletions Documentation/kobject.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ in detail, and briefly here:
- kobjects a simple object.
- kset a set of objects of a certain type.
- ktype a set of helpers for objects of a common type.
- subsystem a controlling object for a number of ksets.


The kobject infrastructure maintains a close relationship with the
Expand All @@ -54,13 +53,15 @@ embedded in larger data structures and replace fields they duplicate.
1.2 Definition

struct kobject {
const char * k_name;
char name[KOBJ_NAME_LEN];
atomic_t refcount;
struct kref kref;
struct list_head entry;
struct kobject * parent;
struct kset * kset;
struct kobj_type * ktype;
struct dentry * dentry;
struct sysfs_dirent * sd;
wait_queue_head_t poll;
};

void kobject_init(struct kobject *);
Expand Down Expand Up @@ -137,8 +138,7 @@ If a kobject does not have a parent when it is registered, its parent
becomes its dominant kset.

If a kobject does not have a parent nor a dominant kset, its directory
is created at the top-level of the sysfs partition. This should only
happen for kobjects that are embedded in a struct subsystem.
is created at the top-level of the sysfs partition.



Expand All @@ -150,10 +150,10 @@ A kset is a set of kobjects that are embedded in the same type.


struct kset {
struct subsystem * subsys;
struct kobj_type * ktype;
struct list_head list;
struct kobject kobj;
struct kset_uevent_ops * uevent_ops;
};


Expand All @@ -169,8 +169,7 @@ struct kobject * kset_find_obj(struct kset *, char *);


The type that the kobjects are embedded in is described by the ktype
pointer. The subsystem that the kobject belongs to is pointed to by the
subsys pointer.
pointer.

A kset contains a kobject itself, meaning that it may be registered in
the kobject hierarchy and exported via sysfs. More importantly, the
Expand Down Expand Up @@ -209,6 +208,58 @@ the hierarchy.
kset_find_obj() may be used to locate a kobject with a particular
name. The kobject, if found, is returned.

There are also some helper functions which names point to the formerly
existing "struct subsystem", whose functions have been taken over by
ksets.


decl_subsys(name,type,uevent_ops)

Declares a kset named '<name>_subsys' of type <type> with
uevent_ops <uevent_ops>. For example,

decl_subsys(devices, &ktype_device, &device_uevent_ops);

is equivalent to doing:

struct kset devices_subsys = {
.kobj = {
.name = "devices",
},
.ktype = &ktype_devices,
.uevent_ops = &device_uevent_ops,
};


The objects that are registered with a subsystem that use the
subsystem's default list must have their kset ptr set properly. These
objects may have embedded kobjects or ksets. The
following helpers make setting the kset easier:


kobj_set_kset_s(obj,subsys)

- Assumes that obj->kobj exists, and is a struct kobject.
- Sets the kset of that kobject to the kset <subsys>.


kset_set_kset_s(obj,subsys)

- Assumes that obj->kset exists, and is a struct kset.
- Sets the kset of the embedded kobject to the kset <subsys>.

subsys_set_kset(obj,subsys)

- Assumes obj->subsys exists, and is a struct subsystem.
- Sets obj->subsys.kset.kobj.kset to the subsystem's embedded kset.

void subsystem_init(struct kset *s);
int subsystem_register(struct kset *s);
void subsystem_unregister(struct kset *s);
struct kset *subsys_get(struct kset *s);
void kset_put(struct kset *s);

These are just wrappers around the respective kset_* functions.

2.3 sysfs

Expand Down Expand Up @@ -254,114 +305,3 @@ Instances of struct kobj_type are not registered; only referenced by
the kset. A kobj_type may be referenced by an arbitrary number of
ksets, as there may be disparate sets of identical objects.



4. subsystems

4.1 Description

A subsystem represents a significant entity of code that maintains an
arbitrary number of sets of objects of various types. Since the number
of ksets and the type of objects they contain are variable, a
generic representation of a subsystem is minimal.


struct subsystem {
struct kset kset;
struct rw_semaphore rwsem;
};

int subsystem_register(struct subsystem *);
void subsystem_unregister(struct subsystem *);

struct subsystem * subsys_get(struct subsystem * s);
void subsys_put(struct subsystem * s);


A subsystem contains an embedded kset so:

- It can be represented in the object hierarchy via the kset's
embedded kobject.

- It can maintain a default list of objects of one type.

Additional ksets may attach to the subsystem simply by referencing the
subsystem before they are registered. (This one-way reference means
that there is no way to determine the ksets that are attached to the
subsystem.)

All ksets that are attached to a subsystem share the subsystem's R/W
semaphore.


4.2 subsystem Programming Interface.

The subsystem programming interface is simple and does not offer the
flexibility that the kset and kobject programming interfaces do. They
may be registered and unregistered, as well as reference counted. Each
call forwards the calls to their embedded ksets (which forward the
calls to their embedded kobjects).


4.3 Helpers

A number of macros are available to make dealing with subsystems and
their embedded objects easier.


decl_subsys(name,type)

Declares a subsystem named '<name>_subsys', with an embedded kset of
type <type>. For example,

decl_subsys(devices,&ktype_devices);

is equivalent to doing:

struct subsystem device_subsys = {
.kset = {
.kobj = {
.name = "devices",
},
.ktype = &ktype_devices,
}
};


The objects that are registered with a subsystem that use the
subsystem's default list must have their kset ptr set properly. These
objects may have embedded kobjects, ksets, or other subsystems. The
following helpers make setting the kset easier:


kobj_set_kset_s(obj,subsys)

- Assumes that obj->kobj exists, and is a struct kobject.
- Sets the kset of that kobject to the subsystem's embedded kset.


kset_set_kset_s(obj,subsys)

- Assumes that obj->kset exists, and is a struct kset.
- Sets the kset of the embedded kobject to the subsystem's
embedded kset.

subsys_set_kset(obj,subsys)

- Assumes obj->subsys exists, and is a struct subsystem.
- Sets obj->subsys.kset.kobj.kset to the subsystem's embedded kset.


4.4 sysfs

subsystems are represented in sysfs via their embedded kobjects. They
follow the same rules as previously mentioned with no exceptions. They
typically receive a top-level directory in sysfs, except when their
embedded kobject is part of another kset, or the parent of the
embedded kobject is explicitly set.

Note that the subsystem's embedded kset must be 'attached' to the
subsystem itself in order to use its rwsem. This is done after
kset_add() has been called. (Not before, because kset_add() uses its
subsystem for a default parent if it doesn't already have one).

Loading

0 comments on commit af94731

Please sign in to comment.