Message ID | c24fc95fa184fdd799d9d3d32b3227f790ba772f.1712126039.git.sweettea-kernel@dorminy.me (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | fiemap extension for more physical information | expand |
On Apr 3, 2024, at 1:22 AM, Sweet Tea Dorminy <sweettea-kernel@dorminy.me> wrote: > > Signed-off-by: Sweet Tea Dorminy <sweettea-kernel@dorminy.me> With the compat macro in the first patch in the series, IMHO this one should be merged into the next patch that actually sets the phys_len, since passing "0" for the phys_len isn't super useful by itself IMHO. Cheers, Andreas > --- > fs/f2fs/data.c | 6 +++--- > fs/f2fs/inline.c | 2 +- > include/trace/events/f2fs.h | 10 +++++++--- > 3 files changed, 11 insertions(+), 7 deletions(-) > > diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c > index 87f8d828e038..34af1673461b 100644 > --- a/fs/f2fs/data.c > +++ b/fs/f2fs/data.c > @@ -1836,7 +1836,7 @@ static int f2fs_xattr_fiemap(struct inode *inode, > > err = fiemap_fill_next_extent( > fieinfo, 0, phys, len, 0, flags); > - trace_f2fs_fiemap(inode, 0, phys, len, flags, err); > + trace_f2fs_fiemap(inode, 0, phys, len, 0, flags, err); > if (err) > return err; > } > @@ -1863,7 +1863,7 @@ static int f2fs_xattr_fiemap(struct inode *inode, > if (phys) { > err = fiemap_fill_next_extent( > fieinfo, 0, phys, len, 0, flags); > - trace_f2fs_fiemap(inode, 0, phys, len, flags, err); > + trace_f2fs_fiemap(inode, 0, phys, len, 0, flags, err); > } > > return (err < 0 ? err : 0); > @@ -1982,7 +1982,7 @@ int f2fs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, > > ret = fiemap_fill_next_extent(fieinfo, logical, > phys, size, 0, flags); > - trace_f2fs_fiemap(inode, logical, phys, size, flags, ret); > + trace_f2fs_fiemap(inode, logical, phys, size, 0, flags, ret); > if (ret) > goto out; > size = 0; > diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c > index 49d2f87fe048..235b0d72f6fc 100644 > --- a/fs/f2fs/inline.c > +++ b/fs/f2fs/inline.c > @@ -808,7 +808,7 @@ int f2fs_inline_data_fiemap(struct inode *inode, > (char *)F2FS_INODE(ipage); > err = fiemap_fill_next_extent( > fieinfo, start, byteaddr, ilen, 0, flags); > - trace_f2fs_fiemap(inode, start, byteaddr, ilen, flags, err); > + trace_f2fs_fiemap(inode, start, byteaddr, ilen, 0, flags, err); > out: > f2fs_put_page(ipage, 1); > return err; > diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h > index 7ed0fc430dc6..63706eb3a5db 100644 > --- a/include/trace/events/f2fs.h > +++ b/include/trace/events/f2fs.h > @@ -2276,9 +2276,10 @@ TRACE_EVENT(f2fs_bmap, > TRACE_EVENT(f2fs_fiemap, > > TP_PROTO(struct inode *inode, sector_t lblock, sector_t pblock, > - unsigned long long len, unsigned int flags, int ret), > + unsigned long long len, unsigned long long phys_len, > + unsigned int flags, int ret), > > - TP_ARGS(inode, lblock, pblock, len, flags, ret), > + TP_ARGS(inode, lblock, pblock, len, phys_len, flags, ret), > > TP_STRUCT__entry( > __field(dev_t, dev) > @@ -2286,6 +2287,7 @@ TRACE_EVENT(f2fs_fiemap, > __field(sector_t, lblock) > __field(sector_t, pblock) > __field(unsigned long long, len) > + __field(unsigned long long, phys_len) > __field(unsigned int, flags) > __field(int, ret) > ), > @@ -2296,16 +2298,18 @@ TRACE_EVENT(f2fs_fiemap, > __entry->lblock = lblock; > __entry->pblock = pblock; > __entry->len = len; > + __entry->phys_len = phys_len; > __entry->flags = flags; > __entry->ret = ret; > ), > > TP_printk("dev = (%d,%d), ino = %lu, lblock:%lld, pblock:%lld, " > - "len:%llu, flags:%u, ret:%d", > + "len:%llu, plen:%llu, flags:%u, ret:%d", > show_dev_ino(__entry), > (unsigned long long)__entry->lblock, > (unsigned long long)__entry->pblock, > __entry->len, > + __entry->phys_len, > __entry->flags, > __entry->ret) > ); > -- > 2.43.0 > > Cheers, Andreas
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 87f8d828e038..34af1673461b 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -1836,7 +1836,7 @@ static int f2fs_xattr_fiemap(struct inode *inode, err = fiemap_fill_next_extent( fieinfo, 0, phys, len, 0, flags); - trace_f2fs_fiemap(inode, 0, phys, len, flags, err); + trace_f2fs_fiemap(inode, 0, phys, len, 0, flags, err); if (err) return err; } @@ -1863,7 +1863,7 @@ static int f2fs_xattr_fiemap(struct inode *inode, if (phys) { err = fiemap_fill_next_extent( fieinfo, 0, phys, len, 0, flags); - trace_f2fs_fiemap(inode, 0, phys, len, flags, err); + trace_f2fs_fiemap(inode, 0, phys, len, 0, flags, err); } return (err < 0 ? err : 0); @@ -1982,7 +1982,7 @@ int f2fs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, ret = fiemap_fill_next_extent(fieinfo, logical, phys, size, 0, flags); - trace_f2fs_fiemap(inode, logical, phys, size, flags, ret); + trace_f2fs_fiemap(inode, logical, phys, size, 0, flags, ret); if (ret) goto out; size = 0; diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c index 49d2f87fe048..235b0d72f6fc 100644 --- a/fs/f2fs/inline.c +++ b/fs/f2fs/inline.c @@ -808,7 +808,7 @@ int f2fs_inline_data_fiemap(struct inode *inode, (char *)F2FS_INODE(ipage); err = fiemap_fill_next_extent( fieinfo, start, byteaddr, ilen, 0, flags); - trace_f2fs_fiemap(inode, start, byteaddr, ilen, flags, err); + trace_f2fs_fiemap(inode, start, byteaddr, ilen, 0, flags, err); out: f2fs_put_page(ipage, 1); return err; diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h index 7ed0fc430dc6..63706eb3a5db 100644 --- a/include/trace/events/f2fs.h +++ b/include/trace/events/f2fs.h @@ -2276,9 +2276,10 @@ TRACE_EVENT(f2fs_bmap, TRACE_EVENT(f2fs_fiemap, TP_PROTO(struct inode *inode, sector_t lblock, sector_t pblock, - unsigned long long len, unsigned int flags, int ret), + unsigned long long len, unsigned long long phys_len, + unsigned int flags, int ret), - TP_ARGS(inode, lblock, pblock, len, flags, ret), + TP_ARGS(inode, lblock, pblock, len, phys_len, flags, ret), TP_STRUCT__entry( __field(dev_t, dev) @@ -2286,6 +2287,7 @@ TRACE_EVENT(f2fs_fiemap, __field(sector_t, lblock) __field(sector_t, pblock) __field(unsigned long long, len) + __field(unsigned long long, phys_len) __field(unsigned int, flags) __field(int, ret) ), @@ -2296,16 +2298,18 @@ TRACE_EVENT(f2fs_fiemap, __entry->lblock = lblock; __entry->pblock = pblock; __entry->len = len; + __entry->phys_len = phys_len; __entry->flags = flags; __entry->ret = ret; ), TP_printk("dev = (%d,%d), ino = %lu, lblock:%lld, pblock:%lld, " - "len:%llu, flags:%u, ret:%d", + "len:%llu, plen:%llu, flags:%u, ret:%d", show_dev_ino(__entry), (unsigned long long)__entry->lblock, (unsigned long long)__entry->pblock, __entry->len, + __entry->phys_len, __entry->flags, __entry->ret) );
Signed-off-by: Sweet Tea Dorminy <sweettea-kernel@dorminy.me> --- fs/f2fs/data.c | 6 +++--- fs/f2fs/inline.c | 2 +- include/trace/events/f2fs.h | 10 +++++++--- 3 files changed, 11 insertions(+), 7 deletions(-)