tree: git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git dev
head: 9a4c8019471386c6fb039ae9e30f5216b6b55a9e
commit: 67cf5b09a46f72e048501b84996f2f77bc42e947 [37/63] ext4: add the basic function for inline data support
config: make ARCH=sparc allyesconfig
All error/warnings:
fs/ext4/inline.c: In function 'ext4_create_inline_data':
fs/ext4/inline.c:268:19: error: 'empty_zero_page' undeclared (first use in this function)
fs/ext4/inline.c:268:19: note: each undeclared identifier is reported only once for each function it appears in
fs/ext4/inline.c: At top level:
fs/ext4/inline.c:164:12: warning: 'ext4_read_inline_data' defined but not used [-Wunused-function]
vim +268 +/empty_zero_page fs/ext4/inline.c
67cf5b09 Tao Ma 2012-12-10 262
67cf5b09 Tao Ma 2012-12-10 263 error = ext4_journal_get_write_access(handle, is.iloc.bh);
67cf5b09 Tao Ma 2012-12-10 264 if (error)
67cf5b09 Tao Ma 2012-12-10 265 goto out;
67cf5b09 Tao Ma 2012-12-10 266
67cf5b09 Tao Ma 2012-12-10 267 if (len > EXT4_MIN_INLINE_DATA_SIZE) {
67cf5b09 Tao Ma 2012-12-10 @268 value = (void *)empty_zero_page;
67cf5b09 Tao Ma 2012-12-10 269 len -= EXT4_MIN_INLINE_DATA_SIZE;
67cf5b09 Tao Ma 2012-12-10 270 } else {
67cf5b09 Tao Ma 2012-12-10 271 value = "";
---
0-DAY kernel build testing backend Open Source Technology Center
Fengguang Wu, Yuanhan Liu Intel Corporation
On 12/11/2012 06:02 AM, kbuild test robot wrote:
> tree: git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git dev
> head: 9a4c8019471386c6fb039ae9e30f5216b6b55a9e
> commit: 67cf5b09a46f72e048501b84996f2f77bc42e947 [37/63] ext4: add the basic function for inline data support
> config: make ARCH=sparc allyesconfig
>
> All error/warnings:
>
> fs/ext4/inline.c: In function 'ext4_create_inline_data':
> fs/ext4/inline.c:268:19: error: 'empty_zero_page' undeclared (first use in this function)
> fs/ext4/inline.c:268:19: note: each undeclared identifier is reported only once for each function it appears in
> fs/ext4/inline.c: At top level:
> fs/ext4/inline.c:164:12: warning: 'ext4_read_inline_data' defined but not used [-Wunused-function]
uh, in sparc, we don't have empty_zero_page? I just want to create an
inline data file without allocating a buffer with the specified length.
So maybe I have to do the kzalloc thing then. :(
Thanks
Tao
>
> vim +268 +/empty_zero_page fs/ext4/inline.c
>
> 67cf5b09 Tao Ma 2012-12-10 262
> 67cf5b09 Tao Ma 2012-12-10 263 error = ext4_journal_get_write_access(handle, is.iloc.bh);
> 67cf5b09 Tao Ma 2012-12-10 264 if (error)
> 67cf5b09 Tao Ma 2012-12-10 265 goto out;
> 67cf5b09 Tao Ma 2012-12-10 266
> 67cf5b09 Tao Ma 2012-12-10 267 if (len > EXT4_MIN_INLINE_DATA_SIZE) {
> 67cf5b09 Tao Ma 2012-12-10 @268 value = (void *)empty_zero_page;
> 67cf5b09 Tao Ma 2012-12-10 269 len -= EXT4_MIN_INLINE_DATA_SIZE;
> 67cf5b09 Tao Ma 2012-12-10 270 } else {
> 67cf5b09 Tao Ma 2012-12-10 271 value = "";
>
> ---
> 0-DAY kernel build testing backend Open Source Technology Center
> Fengguang Wu, Yuanhan Liu Intel Corporation
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
On Tue, Dec 11, 2012 at 10:25:37AM +0800, Tao Ma wrote:
> uh, in sparc, we don't have empty_zero_page? I just want to create an
> inline data file without allocating a buffer with the specified length.
> So maybe I have to do the kzalloc thing then. :(
Yeah, sparc64 apparently doesn't have empty_zero_page. All
architectures have ZERO_PAGE(0), which is what the DIO code uses, but
you can't count on it being mapped.
What we could do instead is pass in a value of "(void *) -1", and then
in ext4_xattr_set_entry(), if i->value is -1, use memset to zero out
the value instead of memcpy. This will be safe for all architectures,
since we already use casts of negative values for ERR_PTR.
In fact, we could just use "i.value = ERR_PTR(-1)" and
"IS_ERR_VALUE(i->value)", but it would be clearer to explicitly define
EXT4_ZERO_XATTR_VALUE to be "((void *) -1)", and use that to indicate
that ext4_xattr_set_entry() should zero out the page in question.
- Ted
On 12/11/2012 01:12 PM, Theodore Ts'o wrote:
> On Tue, Dec 11, 2012 at 10:25:37AM +0800, Tao Ma wrote:
>> uh, in sparc, we don't have empty_zero_page? I just want to create an
>> inline data file without allocating a buffer with the specified length.
>> So maybe I have to do the kzalloc thing then. :(
>
> Yeah, sparc64 apparently doesn't have empty_zero_page. All
> architectures have ZERO_PAGE(0), which is what the DIO code uses, but
> you can't count on it being mapped.
>
> What we could do instead is pass in a value of "(void *) -1", and then
> in ext4_xattr_set_entry(), if i->value is -1, use memset to zero out
> the value instead of memcpy. This will be safe for all architectures,
> since we already use casts of negative values for ERR_PTR.
>
> In fact, we could just use "i.value = ERR_PTR(-1)" and
> "IS_ERR_VALUE(i->value)", but it would be clearer to explicitly define
> EXT4_ZERO_XATTR_VALUE to be "((void *) -1)", and use that to indicate
> that ext4_xattr_set_entry() should zero out the page in question.
yeah, that should saves us a lot in case of inline data creation and
updating. I will change it. Thanks for the good advice.
Thanks
Tao