summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--inotail.c3
-rw-r--r--inotail.h2
2 files changed, 4 insertions, 1 deletions
diff --git a/inotail.c b/inotail.c
index 441db98..53101a8 100644
--- a/inotail.c
+++ b/inotail.c
@@ -565,7 +565,8 @@ static int tail_file(struct file_struct *f, unsigned long n_units, mode_t mode,
}
f->size = finfo.st_size;
- f->blksize = finfo.st_blksize; /* TODO: Can this value be 0? */
+ if (likely(finfo.st_blksize > 0))
+ f->blksize = finfo.st_blksize;
if (mode == M_LINES)
offset = lines_to_offset(f, n_units);
diff --git a/inotail.h b/inotail.h
index c733943..d483e02 100644
--- a/inotail.h
+++ b/inotail.h
@@ -38,8 +38,10 @@ struct file_struct {
#define is_digit(c) ((c) >= '0' && (c) <= '9')
#ifdef __GNUC__
+# define likely(x) __builtin_expect(!!(x), 1)
# define unlikely(x) __builtin_expect(!!(x), 0)
#else
+# define likely(x) (x)
# define unlikely(x) (x)
#endif /* __GNUC__ */
nt from journal_endJeff Mahoney1-2/+1 2014-05-06reiserfs: cleanup, reformat comments to normal kernel styleJeff Mahoney1-343/+469 2014-05-06reiserfs: cleanup, rename key and item accessors to more friendly namesJeff Mahoney1-22/+22 2013-08-08reiserfs: locking, release lock around quota operationsJeff Mahoney1-5/+23 2013-08-08reiserfs: locking, handle nested locks properlyJeff Mahoney1-25/+21 2012-11-19reiserfs: Move quota calls out of write lockJan Kara1-0/+4 2012-03-21Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/vir...Linus Torvalds1-1/+1 2012-03-20move private bits of reiserfs_fs.h to fs/reiserfs/reiserfs.hAl Viro1-1/+1 2012-03-20reiserfs: remove the second argument of k[un]map_atomic()Cong Wang1-2/+2