linux 函数 获取内核版本,linux2.6.38之后内核版本调用open_by_devnum()函数出错

Subject: [PATCH 7/5] block: clean up blkdev_get() wrappers and their users

References: <1288628129-12811-1-git-send-email…@kernel.org>

In-Reply-To: <1288628129-12811-1-git-send-email…@kernel.org>

X-Enigmail-Version: 1.1.1

Content-Type: text/plain; charset=ISO-8859-1

Content-Transfer-Encoding: 7bit

X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00

autolearn=ham version=3.3.1

X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on hera.kernel.org

X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.3 (hera.kernel.org [127.0.0.1]); Thu, 11 Nov 2010 17:11:26 +0000 (UTC)

Sender: linux-kernel-ow…@vger.kernel.org

Precedence: bulk

List-ID:

X-Mailing-List: linux-ker…@vger.kernel.org

After recent blkdev_get() modifications, open_by_devnum() and

open_bdev_exclusive() are simple wrappers around blkdev_get().

Replace them with blkdev_get_by_dev() and blkdev_get_by_path().

blkdev_get_by_dev() is identical to open_by_devnum().

blkdev_get_by_path() is slightly different in that it doesn't

automatically add %FMODE_EXCL to @mode.

All users are converted.  Most conversions are mechanical and don't

introduce any behavior difference.  There are several exceptions.

* btrfs now sets FMODE_EXCL in btrfs_device->mode, so there's no

reason to or it explicitly on blkdev_put().

* gfs2, nilfs2 and the generic mount_bdev() now set FMODE_EXCL in

sb->s_mode.

* With the above changes, sb->s_mode now always should contain

FMODE_EXCL.  WARN_ON_ONCE() added to kill_block_super() to detect

errors.

The new blkdev_get_*() functions are with proper docbook comments.

While at it, add function description to blkdev_get() too.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值