1. 11 Aug, 2023 1 commit
  2. 09 Aug, 2023 4 commits
    • Jeff Layton's avatar
      btrfs: have it use inode_update_timestamps · bb7cc0a6
      Jeff Layton authored
      In later patches, we're going to drop the "now" argument from the
      update_time operation. Have btrfs_update_time use the new
      inode_update_timestamps helper to fetch a new timestamp and update it
      properly.
      Signed-off-by: default avatarJeff Layton <jlayton@kernel.org>
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      Message-Id: <20230807-mgctime-v7-4-d1dec143a704@kernel.org>
      Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
      bb7cc0a6
    • Jeff Layton's avatar
      fs: drop the timespec64 arg from generic_update_time · 541d4c79
      Jeff Layton authored
      In future patches we're going to change how the ctime is updated
      to keep track of when it has been queried. The way that the update_time
      operation works (and a lot of its callers) make this difficult, since
      they grab a timestamp early and then pass it down to eventually be
      copied into the inode.
      
      All of the existing update_time callers pass in the result of
      current_time() in some fashion. Drop the "time" parameter from
      generic_update_time, and rework it to fetch its own timestamp.
      
      This change means that an update_time could fetch a different timestamp
      than was seen in inode_needs_update_time. update_time is only ever
      called with one of two flag combinations: Either S_ATIME is set, or
      S_MTIME|S_CTIME|S_VERSION are set.
      
      With this change we now treat the flags argument as an indicator that
      some value needed to be updated when last checked, rather than an
      indication to update specific timestamps.
      
      Rework the logic for updating the timestamps and put it in a new
      inode_update_timestamps helper that other update_time routines can use.
      S_ATIME is as treated as we always have, but if any of the other three
      are set, then we attempt to update all three.
      
      Also, some callers of generic_update_time need to know what timestamps
      were actually updated. Change it to return an S_* flag mask to indicate
      that and rework the callers to expect it.
      Signed-off-by: default avatarJeff Layton <jlayton@kernel.org>
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      Message-Id: <20230807-mgctime-v7-3-d1dec143a704@kernel.org>
      Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
      541d4c79
    • Jeff Layton's avatar
      fs: pass the request_mask to generic_fillattr · 0d72b928
      Jeff Layton authored
      generic_fillattr just fills in the entire stat struct indiscriminately
      today, copying data from the inode. There is at least one attribute
      (STATX_CHANGE_COOKIE) that can have side effects when it is reported,
      and we're looking at adding more with the addition of multigrain
      timestamps.
      
      Add a request_mask argument to generic_fillattr and have most callers
      just pass in the value that is passed to getattr. Have other callers
      (e.g. ksmbd) just pass in STATX_BASIC_STATS. Also move the setting of
      STATX_CHANGE_COOKIE into generic_fillattr.
      Acked-by: default avatarJoseph Qi <joseph.qi@linux.alibaba.com>
      Reviewed-by: default avatarXiubo Li <xiubli@redhat.com>
      Reviewed-by: default avatar"Paulo Alcantara (SUSE)" <pc@manguebit.com>
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarJeff Layton <jlayton@kernel.org>
      Message-Id: <20230807-mgctime-v7-2-d1dec143a704@kernel.org>
      Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
      0d72b928
    • Jeff Layton's avatar
      fs: remove silly warning from current_time · b3030e4f
      Jeff Layton authored
      An inode with no superblock? Unpossible!
      Signed-off-by: default avatarJeff Layton <jlayton@kernel.org>
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      Message-Id: <20230807-mgctime-v7-1-d1dec143a704@kernel.org>
      Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
      b3030e4f
  3. 24 Jul, 2023 35 commits