bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tail + inotify over nfs


From: Jim Meyering
Subject: Re: tail + inotify over nfs
Date: Sat, 26 Dec 2009 10:42:27 +0100

Pádraig Brady wrote:

> On 24/12/09 11:51, Jim Meyering wrote:
>> Pádraig Brady wrote:
>>> On 23/12/09 21:19, Jim Meyering wrote:
>>>> Here's a bigger patch (superset of the above) that also makes it so
>>>> fremote can be used without those annoyingly unreadable in-function 
>>>> #ifdefs.
>>>> It moves the declaration of fremote "up" to precede the first use
>>>> and ensures that it's defined to "false" in the !HAVE_INOTIFY case.
>>>> That makes it so the two uses work properly when !HAVE_INOTIFY.
>>>
>>> Looks good.
>>>
>>> Feel free to push.
>>
>> I added the log and went to do that,
>> but realized you hadn't pushed yours yet.
>
> I've pushed now.
> I was going to push yours but noticed that
> you'll need to move File_spec.remote outside
> of #if HAVE_INOTIFY.

Thanks.  Good catch.
I've corrected that and pushed.

Along the way, I noticed some holes in that struct, so did this:

>From 8506d9adb6958b85a33edcc099a08426e5e8033a Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Fri, 25 Dec 2009 12:08:51 +0100
Subject: [PATCH] tail: shrink internal struct by 8 bytes

* tail.c (struct File_spec): Rearrange struct members to decrease
size by 8 bytes to 76,96 on i686,x86_64 respectively.
---
 src/tail.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/tail.c b/src/tail.c
index 4ef8d86..89f37f6 100644
--- a/src/tail.c
+++ b/src/tail.c
@@ -111,9 +111,6 @@ struct File_spec
   /* The actual file name, or "-" for stdin.  */
   char *name;

-  /* File descriptor on which the file is open; -1 if it's not open.  */
-  int fd;
-
   /* Attributes of the file the last time we checked.  */
   off_t size;
   struct timespec mtime;
@@ -121,24 +118,27 @@ struct File_spec
   ino_t ino;
   mode_t mode;

-  /* 1 if O_NONBLOCK is clear, 0 if set, -1 if not known.  */
-  int blocking;
-
   /* The specified name initially referred to a directory or some other
      type for which tail isn't meaningful.  Unlike for a permission problem
      (tailable, below) once this is set, the name is not checked ever again.  
*/
   bool ignore;

-  /* See description of DEFAULT_MAX_N_... below.  */
-  uintmax_t n_unchanged_stats;
+  /* See the description of fremote.  */
+  bool remote;

   /* A file is tailable if it exists, is readable, and is of type
      IS_TAILABLE_FILE_TYPE.  */
   bool tailable;

+  /* File descriptor on which the file is open; -1 if it's not open.  */
+  int fd;
+
   /* The value of errno seen last time we checked this file.  */
   int errnum;

+  /* 1 if O_NONBLOCK is clear, 0 if set, -1 if not known.  */
+  int blocking;
+
 #if HAVE_INOTIFY
   /* The watch descriptor used by inotify.  */
   int wd;
@@ -151,8 +151,8 @@ struct File_spec
   size_t basename_start;
 #endif

-  /* See the description of fremote.  */
-  bool remote;
+  /* See description of DEFAULT_MAX_N_... below.  */
+  uintmax_t n_unchanged_stats;
 };

 #if HAVE_INOTIFY
--
1.6.6.287.gff4d1


>From a0d5d53a300aadaf39361ace10e68c69b0223cd3 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Fri, 25 Dec 2009 12:32:12 +0100
Subject: [PATCH 2/2] build: update gnulib submodule to latest

---
 gnulib |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gnulib b/gnulib
index 9a669cf..4b93a25 160000
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit 9a669cf64253a2b2149d7f7cc5e0664c1bc7dda9
+Subproject commit 4b93a2579fb567b9fbbeb24439770d814dac95cd
--
1.6.6.287.gff4d1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]