Re: [PATCH 1/2 v2] fs: add SEEK_HOLE and SEEK_DATA flags

2011-05-05 Thread Marco Stornelli
Il 05/05/2011 21:01, Josef Bacik ha scritto: On 05/05/2011 02:54 PM, Marco Stornelli wrote: Il 04/05/2011 19:58, Josef Bacik ha scritto: + if (offset= i_size_read(inode)) { + mutex_unlock(inode-i_mutex); + return -ENXIO; + } + offset = i_size_read(inode); + break; Here maybe it's possible to

Re: [PATCH 1/2 v2] fs: add SEEK_HOLE and SEEK_DATA flags

2011-05-05 Thread Marco Stornelli
Il 04/05/2011 19:58, Josef Bacik ha scritto: + if (offset= i_size_read(inode)) { + mutex_unlock(inode-i_mutex); + return -ENXIO; + } + offset = i_size_read(inode); + break; I can add that

Re: [PATCH 1/2 v2] fs: add SEEK_HOLE and SEEK_DATA flags

2011-05-05 Thread Josef Bacik
On 05/05/2011 03:19 PM, Marco Stornelli wrote: Il 04/05/2011 19:58, Josef Bacik ha scritto: + if (offset= i_size_read(inode)) { + mutex_unlock(inode-i_mutex); + return -ENXIO; + } + offset = i_size_read(inode); + break; I can add that generic_file_llseek_unlocked means *unlocked* so you

[PATCH 1/2 v2] fs: add SEEK_HOLE and SEEK_DATA flags

2011-05-04 Thread Josef Bacik
This just gets us ready to support the SEEK_HOLE and SEEK_DATA flags. Turns out using fiemap in things like cp cause more problems than it solves, so lets try and give userspace an interface that doesn't suck. So we have -SEEK_HOLE: this moves the file pos to the nearest hole in the file from

Re: [PATCH 1/2 v2] fs: add SEEK_HOLE and SEEK_DATA flags

2011-05-04 Thread Valdis . Kletnieks
On Wed, 04 May 2011 13:58:39 EDT, Josef Bacik said: -SEEK_HOLE: this moves the file pos to the nearest hole in the file from the given position. Nearest, or next? Solaris defines it as next, for a good reason - otherwise you can get stuck in a case where the nearest hole is back towards the

Re: [PATCH 1/2 v2] fs: add SEEK_HOLE and SEEK_DATA flags

2011-05-04 Thread Valdis . Kletnieks
On Wed, 04 May 2011 15:10:20 EDT, Josef Bacik said: Yeah sorry the log says nearest but the code says next, if you look at it thats how it works. Thanks, Oh good - the changelog is usually easier to fix than the code is. :) Probably want to fix the changelog before it gets committed, as

Re: [PATCH 1/2 v2] fs: add SEEK_HOLE and SEEK_DATA flags

2011-05-04 Thread Josef Bacik
On 05/04/2011 03:20 PM, valdis.kletni...@vt.edu wrote: On Wed, 04 May 2011 15:10:20 EDT, Josef Bacik said: Yeah sorry the log says nearest but the code says next, if you look at it thats how it works. Thanks, Oh good - the changelog is usually easier to fix than the code is. :) Probably

Re: [PATCH 1/2 v2] fs: add SEEK_HOLE and SEEK_DATA flags

2011-05-04 Thread Valdis . Kletnieks
On Wed, 04 May 2011 13:58:39 EDT, Josef Bacik said: +#define SEEK_HOLE3 /* seek to the closest hole */ +#define SEEK_DATA4 /* seek to the closest data */ Comments here need nearest/next fixing as well - otherwise the ext[34] crew may actually implement the commented

Re: [PATCH 1/2 v2] fs: add SEEK_HOLE and SEEK_DATA flags

2011-05-04 Thread Josef Bacik
On 05/04/2011 03:31 PM, valdis.kletni...@vt.edu wrote: On Wed, 04 May 2011 13:58:39 EDT, Josef Bacik said: +#define SEEK_HOLE 3 /* seek to the closest hole */ +#define SEEK_DATA 4 /* seek to the closest data */ Comments here need nearest/next fixing as well - otherwise

Re: [PATCH 1/2 v2] fs: add SEEK_HOLE and SEEK_DATA flags

2011-05-04 Thread Dave Kleikamp
On 05/04/2011 02:10 PM, Josef Bacik wrote: On 05/04/2011 03:04 PM, valdis.kletni...@vt.edu wrote: On Wed, 04 May 2011 13:58:39 EDT, Josef Bacik said: -SEEK_HOLE: this moves the file pos to the nearest hole in the file from the given position. Nearest, or next? Solaris defines it as next,

Re: [PATCH 1/2 v2] fs: add SEEK_HOLE and SEEK_DATA flags

2011-05-04 Thread Dave Kleikamp
On 05/04/2011 04:54 PM, Dave Kleikamp wrote: The comments in fs.h say closest. You may want to change them to next as well. Sorry. Missed some of the replies before I responded. Already addressed. Shaggy -- To unsubscribe from this list: send the line unsubscribe linux-btrfs in the body of