01 Aug, 2011
36 commits
-
Instead of unconditionally creating a fixed number of dead loop
devices which need to be investigated by storage handling services,
even when they are never used, we allow distros start with 0
loop devices and have losetup(8) and similar switch to the dynamic
/dev/loop-control interface instead of searching /dev/loop%i for free
devices.Signed-off-by: Kay Sievers
Signed-off-by: Jens Axboe -
Loop devices today have a fixed pre-allocated number of usually 8.
The number can only be changed at module init time. To find a free
device to use, /dev/loop%i needs to be scanned, and all devices need
to be opened until a free one is possibly found.This adds a new /dev/loop-control device node, that allows to
dynamically find or allocate a free device, and to add and remove loop
devices from the running system:
LOOP_CTL_ADD adds a specific device. Arg is the number
of the device. It returns the device i or a negative
error code.LOOP_CTL_REMOVE removes a specific device, Arg is the
number the device. It returns the device i or a negative
error code.LOOP_CTL_GET_FREE finds the next unbound device or allocates
a new one. No arg is given. It returns the device i or a
negative error code.The loop kernel module gets automatically loaded when
/dev/loop-control is accessed the first time. The alias
specified in the module, instructs udev to create this
'dead' device node, even when the module is not loaded.Example:
cfd = open("/dev/loop-control", O_RDWR);# add a new specific loop device
err = ioctl(cfd, LOOP_CTL_ADD, devnr);# remove a specific loop device
err = ioctl(cfd, LOOP_CTL_REMOVE, devnr);# find or allocate a free loop device to use
devnr = ioctl(cfd, LOOP_CTL_GET_FREE);sprintf(loopname, "/dev/loop%i", devnr);
ffd = open("backing-file", O_RDWR);
lfd = open(loopname, O_RDWR);
err = ioctl(lfd, LOOP_SET_FD, ffd);Cc: Tejun Heo
Cc: Karel Zak
Signed-off-by: Kay Sievers
Signed-off-by: Jens Axboe -
Replace the linked list, that keeps track of allocated devices, with an
idr index to allow a more efficient lookup of devices.Cc: Tejun Heo
Signed-off-by: Kay Sievers
Signed-off-by: Jens Axboe -
This moves the FC classes bsg code to the block layer and
makes it a lib so that other classes like iscsi and SAS can use it.It is helpful because working with the request queue, bios,
creating scatterlists, etc are a pain that the LLD does not
have to worry about with normal IOs and should not have to
worry about for bsg requests.Signed-off-by: Mike Christie
Signed-off-by: Jens Axboe -
* 'nfs-for-3.1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (28 commits)
pnfsblock: write_pagelist handle zero invalid extents
pnfsblock: note written INVAL areas for layoutcommit
pnfsblock: bl_write_pagelist
pnfsblock: bl_read_pagelist
pnfsblock: cleanup_layoutcommit
pnfsblock: encode_layoutcommit
pnfsblock: merge rw extents
pnfsblock: add extent manipulation functions
pnfsblock: bl_find_get_extent
pnfsblock: xdr decode pnfs_block_layout4
pnfsblock: call and parse getdevicelist
pnfsblock: merge extents
pnfsblock: lseg alloc and free
pnfsblock: remove device operations
pnfsblock: add device operations
pnfsblock: basic extent code
pnfsblock: use pageio_ops api
pnfsblock: add blocklayout Kconfig option, Makefile, and stubs
pnfs: cleanup_layoutcommit
pnfs: ask for layout_blksize and save it in nfs_server
... -
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg/slab-2.6:
slab: use NUMA_NO_NODE
slab: remove one NR_CPUS dependency -
* 'urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/wfg/writeback:
don't busy retry the inode on failed grab_super_passive() -
* git://git.infradead.org/battery-2.6:
gpio-charger: Fix checking return value of request_any_context_irq
power_supply: MAX17042: Support additional properties
max8903_charger: Allow platform data to be __initdata
power_supply: Add charger driver for MAX8998/LP3974
power_supply: Add charger driver for MAX8997/8966
max17042_battery: Remove obsolete cleanup for clientdata
twl4030_charger: Fix warnings
wm831x_power: Support multiple instances
wm831x_backup: Support multiple instances
apm_power: Fix style error in macros
s3c_adc_battery: Fix annotation for s3c_adc_battery_probe()
bq20z75: Enable detection after registering
bq20z75: Add support for external notification -
* git://git.kernel.org/pub/scm/linux/kernel/git/brodo/cpupowerutils:
cpupower: Do detect IDA (opportunistic processor performance) via cpuid
cpupower: Show Intel turbo ratio support via ./cpupower frequency-info
cpupowerutils: increase MAX_LINE_LEN
cpupower: Rename package from cpupowerutils to cpupower
cpupowerutils: Rename: libcpufreq->libcpupower
cpupowerutils: use kernel version-derived version string
cpupowerutils: utils - ConfigStyle bugfixes
cpupowerutils: helpers - ConfigStyle bugfixes
cpupowerutils: idle_monitor - ConfigStyle bugfixes
cpupowerutils: lib - ConfigStyle bugfixes
cpupowerutils: bench - ConfigStyle bugfixes
cpupowerutils: do not update po files on each and every compile
cpupowerutils: remove ccdv, use kernel quiet/verbose mechanism
cpupowerutils: use COPYING, CREDITS from top-level directory
cpupowerutils - cpufrequtils extended with quite some features -
* git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6:
smc91c92_cs.c: fix bogus compiler warning
orinoco_cs: be more careful when matching cards with ID 0x0156:0x0002
hostap_cs: support cards with "Version 01.02" as third product ID
pcmcia: add PCMCIA_DEVICE_MANF_CARD_PROD_ID3
pxa2xx pcmcia - stargate 2 use gpio array.
pcmcia: pxa2xx: remove empty socket_init / socket_resume functions.
drivers:pcmcia:soc_common: make socket_init and socket_suspend optional -
For invalid extents, find other pages in the same fsblock and write them out.
[pnfsblock: write_begin]
Signed-off-by: Fred Isaman
Signed-off-by: Benny Halevy
Signed-off-by: Benny Halevy
Signed-off-by: Peng Tao
Signed-off-by: Jim Rees
Signed-off-by: Trond Myklebust -
Signed-off-by: Peng Tao
Signed-off-by: Fred Isaman
Signed-off-by: Benny Halevy
Signed-off-by: Benny Halevy
Signed-off-by: Jim Rees
Signed-off-by: Trond Myklebust -
Note: When upper layer's read/write request cannot be fulfilled, the block
layout driver shouldn't silently mark the page as error. It should do
what can be done and leave the rest to the upper layer. To do so, we
should set rdata/wdata->res.count properly.When upper layer re-send the read/write request to finish the rest
part of the request, pgbase is the position where we should start at.[pnfsblock: bl_write_pagelist support functions]
[pnfsblock: bl_write_pagelist adjust for missing PG_USE_PNFS]
Signed-off-by: Fred Isaman
[pnfsblock: handle errors when read or write pagelist.]
Signed-off-by: Zhang Jingwang
[pnfs-block: use new write_pagelist api]
Signed-off-by: Benny Halevy
Signed-off-by: Benny Halevy
Signed-off-by: Jim Rees[SQUASHME: pnfsblock: mds_offset is set in the generic layer]
Signed-off-by: Boaz Harrosh
Signed-off-by: Benny Halevy[pnfsblock: mark IO error with NFS_LAYOUT_{RW|RO}_FAILED]
Signed-off-by: Peng Tao
[pnfsblock: SQUASHME: adjust to API change]
Signed-off-by: Fred Isaman
[pnfsblock: fixup blksize alignment in bl_setup_layoutcommit]
Signed-off-by: Benny Halevy
Signed-off-by: Benny Halevy
[pnfsblock: bl_write_pagelist adjust for missing PG_USE_PNFS]
Signed-off-by: Fred Isaman
[pnfsblock: handle errors when read or write pagelist.]
Signed-off-by: Zhang Jingwang
[pnfs-block: use new write_pagelist api]
Signed-off-by: Benny Halevy
Signed-off-by: Benny Halevy
Signed-off-by: Jim Rees
Signed-off-by: Trond Myklebust -
Note: When upper layer's read/write request cannot be fulfilled, the block
layout driver shouldn't silently mark the page as error. It should do
what can be done and leave the rest to the upper layer. To do so, we
should set rdata/wdata->res.count properly.When upper layer re-send the read/write request to finish the rest
part of the request, pgbase is the position where we should start at.[pnfsblock: mark IO error with NFS_LAYOUT_{RW|RO}_FAILED]
Signed-off-by: Peng Tao
[pnfsblock: read path error handling]
Signed-off-by: Fred Isaman
[pnfsblock: handle errors when read or write pagelist.]
Signed-off-by: Zhang Jingwang
[pnfs-block: use new read_pagelist api]
Signed-off-by: Benny Halevy
Signed-off-by: Benny Halevy
Signed-off-by: Jim Rees
Signed-off-by: Trond Myklebust -
In blocklayout driver. There are two things happening
while layoutcommit/cleanup.
1. the modified extents are encoded.
2. On cleanup the extents are put back on the layout rw
extents list, for reads.In the new system where actual xdr encoding is done in
encode_layoutcommit() directly into xdr buffer, these are
the new commit stages:1. On setup_layoutcommit, the range is adjusted as before
and a structure is allocated for communication with
bl_encode_layoutcommit && bl_cleanup_layoutcommit
(Generic layer provides a void-star to hang it on)2. bl_encode_layoutcommit is called to do the actual
encoding directly into xdr. The commit-extent-list is not
freed and is stored on above structure.
FIXME: The code is not yet converted to the new XDR cleanup3. On cleanup the commit-extent-list is put back by a call
to set_to_rw() as before, but with no need for XDR decoding
of the list as before. And the commit-extent-list is freed.
Finally allocated structure is freed.[rm inode and pnfs_layout_hdr args from cleanup_layoutcommit()]
Signed-off-by: Jim Rees
[pnfsblock: introduce bl_committing list]
Signed-off-by: Peng Tao
[pnfsblock: SQUASHME: adjust to API change]
Signed-off-by: Fred Isaman
[blocklayout: encode_layoutcommit implementation]
Signed-off-by: Boaz Harrosh
[pnfsblock: fix bug setting up layoutcommit.]
Signed-off-by: Tao Guo
[pnfsblock: cleanup_layoutcommit wants a status parameter]
Signed-off-by: Boaz Harrosh
Signed-off-by: Benny Halevy
Signed-off-by: Benny Halevy
Signed-off-by: Jim Rees
Signed-off-by: Trond Myklebust -
In blocklayout driver. There are two things happening
while layoutcommit/cleanup.
1. the modified extents are encoded.
2. On cleanup the extents are put back on the layout rw
extents list, for reads.In the new system where actual xdr encoding is done in
encode_layoutcommit() directly into xdr buffer, these are
the new commit stages:1. On setup_layoutcommit, the range is adjusted as before
and a structure is allocated for communication with
bl_encode_layoutcommit && bl_cleanup_layoutcommit
(Generic layer provides a void-star to hang it on)2. bl_encode_layoutcommit is called to do the actual
encoding directly into xdr. The commit-extent-list is not
freed and is stored on above structure.
FIXME: The code is not yet converted to the new XDR cleanup3. On cleanup the commit-extent-list is put back by a call
to set_to_rw() as before, but with no need for XDR decoding
of the list as before. And the commit-extent-list is freed.
Finally allocated structure is freed.[rm inode and pnfs_layout_hdr args from cleanup_layoutcommit()]
[pnfsblock: get rid of deprecated xdr macros]
Signed-off-by: Jim Rees
Signed-off-by: Peng Tao
Signed-off-by: Fred Isaman
[blocklayout: encode_layoutcommit implementation]
Signed-off-by: Boaz Harrosh
[pnfsblock: fix bug setting up layoutcommit.]
Signed-off-by: Tao Guo
[pnfsblock: prevent commit list corruption]
[pnfsblock: fix layoutcommit with an empty opaque]
Signed-off-by: Fred Isaman
Signed-off-by: Benny Halevy
Signed-off-by: Benny Halevy
Signed-off-by: Jim Rees
Signed-off-by: Trond Myklebust -
Signed-off-by: Fred Isaman
Signed-off-by: Benny Halevy
Signed-off-by: Benny Halevy
Signed-off-by: Jim Rees
Signed-off-by: Trond Myklebust -
Adds working implementations of various support functions
to handle INVAL extents, needed by writes, such as
bl_mark_sectors_init and bl_is_sector_init.[pnfsblock: fix 64-bit compiler warnings for extent manipulation]
Signed-off-by: Fred Isaman
Signed-off-by: Benny Halevy
Signed-off-by: Benny Halevy
[Implement release_inval_marks]
Signed-off-by: Zhang Jingwang
Signed-off-by: Jim Rees
Signed-off-by: Trond Myklebust -
Implement bl_find_get_extent(), one of the core extent manipulation
routines.[pnfsblock: Lookup list entry of layouts and tags in reverse order]
Signed-off-by: Zhang Jingwang
Signed-off-by: Fred Isaman
Signed-off-by: Benny Halevy
Signed-off-by: Jim Reespnfsblock: fix print format warnings for sector_t and size_t
gcc spews warnings about these on x86_64, e.g.:
fs/nfs/blocklayout/blocklayout.c:74: warning: format ‘%Lu’ expects type ‘long long unsigned int’, but argument 2 has type ‘sector_t’
fs/nfs/blocklayout/blocklayout.c:388: warning: format ‘%d’ expects type ‘int’, but argument 5 has type ‘size_t’Signed-off-by: Benny Halevy
Signed-off-by: Benny Halevy
Signed-off-by: Jim Rees
Signed-off-by: Trond Myklebust -
XDR decodes the block layout payload sent in LAYOUTGET result, storing
the result in an extent list.[pnfsblock: get rid of deprecated xdr macros]
Signed-off-by: Jim Rees
Signed-off-by: Fred Isaman
[pnfsblock: fix bug getting pnfs_layout_type in translate_devid().]
Signed-off-by: Tao Guo
Signed-off-by: Benny Halevy
Signed-off-by: Benny Halevy
Signed-off-by: Jim Rees
Signed-off-by: Trond Myklebust -
Call GETDEVICELIST during mount, then call and parse GETDEVICEINFO
for each device returned.[pnfsblock: get rid of deprecated xdr macros]
Signed-off-by: Jim Rees
[pnfsblock: fix pnfs_deviceid references]
Signed-off-by: Fred Isaman
[pnfsblock: fix print format warnings for sector_t and size_t]
[pnfs-block: #include ]
[pnfsblock: no PNFS_NFS_SERVER]
Signed-off-by: Benny Halevy
[pnfsblock: fix bug determining size of striped volume]
[pnfsblock: fix oops when using multiple devices]
Signed-off-by: Fred Isaman
Signed-off-by: Benny Halevy
Signed-off-by: Benny Halevy
[pnfsblock: get rid of vmap and deviceid->area structure]
Signed-off-by: Peng Tao
Signed-off-by: Jim Rees
Signed-off-by: Trond Myklebust -
Replace a stub, so that extents underlying the layouts are properly
added, merged, or ignored as necessary.Signed-off-by: Fred Isaman
[pnfsblock: delete the new node before put it]
Signed-off-by: Mingyang Guo
Signed-off-by: Benny Halevy
Signed-off-by: Peng Tao
Signed-off-by: Benny Halevy
Signed-off-by: Jim Rees
Signed-off-by: Trond Myklebust -
Signed-off-by: Fred Isaman
[pnfsblock: fix bug getting pnfs_layout_type in translate_devid().]
Signed-off-by: Tao Guo
Signed-off-by: Benny Halevy
Signed-off-by: Zhang Jingwang
Signed-off-by: Benny Halevy
Signed-off-by: Jim Rees
Signed-off-by: Trond Myklebust -
Signed-off-by: Jim Rees
Signed-off-by: Fred Isaman
Signed-off-by: Benny Halevy
Signed-off-by: Benny Halevy
[upcall bugfixes]
Signed-off-by: Peng Tao
Signed-off-by: Trond Myklebust -
Signed-off-by: Jim Rees
Signed-off-by: Fred Isaman
Signed-off-by: Benny Halevy
Signed-off-by: Benny Halevy
[upcall bugfixes]
Signed-off-by: Peng Tao
Signed-off-by: Trond Myklebust -
Adds structures and basic create/delete code for extents.
Signed-off-by: Fred Isaman
Signed-off-by: Benny Halevy
Signed-off-by: Zhang Jingwang
Signed-off-by: Benny Halevy
Signed-off-by: Jim Rees
Signed-off-by: Trond Myklebust -
[pnfsblock: use pnfs_generic_pg_init_read/write]
Signed-off-by: Peng Tao
Signed-off-by: Benny Halevy
Signed-off-by: Jim Rees
Signed-off-by: Trond Myklebust -
Define a configuration variable to enable/disable compilation of the
block driver code.Add the minimal structure for a pnfs block layout driver, and empty
list-heads that will hold the extent data[pnfsblock: make NFS_V4_1 select PNFS_BLOCK]
Signed-off-by: Peng Tao
Signed-off-by: Fred Isaman
Signed-off-by: Benny Halevy
[pnfs-block: fix CONFIG_PNFS_BLOCK dependencies]
Signed-off-by: Benny Halevy
Signed-off-by: Benny Halevy
[pnfsblock: SQUASHME: adjust to API change]
Signed-off-by: Fred Isaman
[pnfs: move pnfs_layout_type inline in nfs_inode]
Signed-off-by: Benny Halevy
[blocklayout: encode_layoutcommit implementation]
Signed-off-by: Boaz Harrosh
Signed-off-by: Benny Halevy
Signed-off-by: Benny Halevy
[pnfsblock: layout alloc and free]
Signed-off-by: Fred Isaman
[pnfs: move pnfs_layout_type inline in nfs_inode]
Signed-off-by: Benny Halevy
Signed-off-by: Benny Halevy
[pnfsblock: define module alias]
Signed-off-by: Peng Tao
[rm inode and pnfs_layout_hdr args from cleanup_layoutcommit()]
Signed-off-by: Jim Rees
Signed-off-by: Trond Myklebust -
This gives layout driver a chance to cleanup structures they put in at
encode_layoutcommit.Signed-off-by: Andy Adamson
[fixup layout header pointer for layoutcommit]
Signed-off-by: Benny Halevy
Signed-off-by: Benny Halevy
[rm inode and pnfs_layout_hdr args from cleanup_layoutcommit()]
Signed-off-by: Jim Rees
Signed-off-by: Trond Myklebust -
Block layout needs it to determine IO size.
Signed-off-by: Fred Isaman
Signed-off-by: Tao Guo
Signed-off-by: Benny Halevy
Signed-off-by: Benny Halevy
Signed-off-by: Jim Rees
Signed-off-by: Trond Myklebust -
To allow layout driver to issue getdevicelist at mount time, and clean up
at umount time.[fixup non NFS_V4_1 set_pnfs_layoutdriver definition]
[pnfs: pass mntfh down the init_pnfs path]
Signed-off-by: Benny Halevy
Signed-off-by: Benny Halevy
Signed-off-by: Jim Rees
Signed-off-by: Trond Myklebust -
The block driver uses GETDEVICELIST
Signed-off-by: Andy Adamson
[pass struct nfs_server * to getdevicelist]
[get machince creds for getdevicelist]
[fix getdevicelist decode sizing]
Signed-off-by: Benny Halevy
Signed-off-by: Benny Halevy
Signed-off-by: Jim Rees
Signed-off-by: Trond Myklebust -
Using NFS4_MAX_UINT64 will break current protocol.
[Needed in v3.0]
CC: Stable Tree
Signed-off-by: Peng Tao
Signed-off-by: Jim Rees
Signed-off-by: Trond Myklebust -
There can be multiple lseg per file, so layoutcommit should be
able to handle it.[Needed in v3.0]
CC: Stable Tree
Signed-off-by: Peng Tao
Signed-off-by: Boaz Harrosh
Signed-off-by: Jim Rees
Signed-off-by: Trond Myklebust -
No need to save it for every lseg.
No need to save it at every pnfs_set_layoutcommit.[Needed in v3.0]
CC: Stable Tree
Signed-off-by: Peng Tao
Signed-off-by: Boaz Harrosh
Signed-off-by: Jim Rees
Signed-off-by: Trond Myklebust -
No need to save it for every lseg.
[Needed in v3.0]
CC: Stable Tree
Signed-off-by: Peng Tao
Signed-off-by: Jim Rees
Signed-off-by: Trond Myklebust
31 Jul, 2011
4 commits
-
Use the nice enumerated constant.
Cc: KOSAKI Motohiro
Signed-off-by: Andrew Morton
Signed-off-by: Pekka Enberg -
This fixes a soft lockup on conditions
a) the flusher is working on a work by __bdi_start_writeback(), while
b) someone else calls writeback_inodes_sb*() or sync_inodes_sb(), which
grab sb->s_umount and enqueue a new work for the flusher to executeThe s_umount grabbed by (b) will fail the grab_super_passive() in (a).
Then if the inode is requeued, wb_writeback() will busy retry on it.
As a result, wb_writeback() loops for ever without releasing
wb->list_lock, which further blocks other tasks.Fix the busy loop by redirtying the inode. This may undesirably delay
the writeback of the inode, however most likely it will be picked up
soon by the queued work by writeback_inodes_sb*(), sync_inodes_sb() or
even writeback_inodes_wb().bug url: http://www.spinics.net/lists/linux-fsdevel/msg47292.html
Reported-by: Christoph Hellwig
Tested-by: Christoph Hellwig
Signed-off-by: Wu Fengguang -
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial:
sungem: fix compile failure caused by trivial #include consolidation -
* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/staging: (24 commits)
hwmon: (lm90) Refactor reading of config2 register
hwmon: (lm90) Make SA56004 detection more robust
hwmon: (lm90) Simplify handling of extended local temp register
hwmon: (pmbus) Add client driver for LM25066, LM5064, and LM5066
hwmon: (max34440) Add support for peak attributes
hwmon: (max8688) Add support for peak attributes
hwmon: (max16064) Add support for peak attributes
hwmon: (adm1275) Add support for peak attributes
hwmon: (pmbus) Add support for peak attributes
hwmon: Add new attributes to sysfs ABI
hwmon: (pmbus) Strengthen check for status register existence
hwmon: (pmbus) Add support for virtual pages
hwmon: (pmbus) Support reading and writing of word registers in device specific code
hwmon: (pmbus) Increase attribute name size
hwmon: (pmbus) Add ADP4000, NCP4200 and NCP4208 to list of supported devices
hwmon: (pmbus) Add support for VID output voltage mode
hwmon: (pmbus) Move PMBus drivers to drivers/hwmon/pmbus
hwmon: (coretemp) Add core/pkg threshold support to Coretemp
hwmon: (lm95241) Add support for LM95231
hwmon: LM95245 driver
...