projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a72132c
)
brd: return -ENOSPC rather than -ENOMEM on page allocation failure
author
Matthew Wilcox
<
[email protected]
>
Wed, 4 Jun 2014 23:07:50 +0000
(16:07 -0700)
committer
Linus Torvalds
<
[email protected]
>
Wed, 4 Jun 2014 23:54:02 +0000
(16:54 -0700)
brd is effectively a thinly provisioned device. Thinly provisioned
devices return -ENOSPC when they can't write a new block. -ENOMEM is an
implementation detail that callers shouldn't know.
Signed-off-by: Matthew Wilcox <
[email protected]
>
Acked-by: Dave Chinner <
[email protected]
>
Cc: Dheeraj Reddy <
[email protected]
>
Cc: Hugh Dickins <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
drivers/block/brd.c
patch
|
blob
|
history
diff --git
a/drivers/block/brd.c
b/drivers/block/brd.c
index 807d3d5d2fe5da383d030e9b4743e1c24d760c99..c7d138eca731b638c324eaf30ae60007625c0f80 100644
(file)
--- a/
drivers/block/brd.c
+++ b/
drivers/block/brd.c
@@
-200,11
+200,11
@@
static int copy_to_brd_setup(struct brd_device *brd, sector_t sector, size_t n)
copy = min_t(size_t, n, PAGE_SIZE - offset);
if (!brd_insert_page(brd, sector))
- return -ENO
MEM
;
+ return -ENO
SPC
;
if (copy < n) {
sector += copy >> SECTOR_SHIFT;
if (!brd_insert_page(brd, sector))
- return -ENO
MEM
;
+ return -ENO
SPC
;
}
return 0;
}
@@
-384,7
+384,7
@@
static int brd_direct_access(struct block_device *bdev, sector_t sector,
return -ERANGE;
page = brd_insert_page(brd, sector);
if (!page)
- return -ENO
MEM
;
+ return -ENO
SPC
;
*kaddr = page_address(page);
*pfn = page_to_pfn(page);