mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Evgeniy Dushistov <dushistov@mail.ru>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [RFC] [PATCH 2/3]: ufs: track i_size
Date: Mon, 26 Jun 2006 11:54:49 -0700	[thread overview]
Message-ID: <20060626115449.d0c674a4.akpm@osdl.org> (raw)
In-Reply-To: <20060626134836.GA8400@rain.homenetwork>

On Mon, 26 Jun 2006 17:48:36 +0400
Evgeniy Dushistov <dushistov@mail.ru> wrote:

> To make possible proper work of `ufs_truncate'(see the next patch),
> I need to know old size of file in` ufs_truncate',
> but for some unknown for me reason VFS layer doesn't tell
> old size to file system, or at least I don't find way to get
> this information. 
> So I have to add per each inode `loff_t' field and update it
> in
> - alloc inode
> - read inode
> - commit write
> - truncate(see the next patch)
> is this right way to know "old size" in truncate method?

You can get this info by implementing inode_operations.setattr().  See the
callsite in fs/attr.c:notify_change().  You'd do something like:

ufs_setattr()
{
	loff_t old_i_size = inode->i_size;

	/* Stuff copied from notify_change(): */
	inode_change_ok()
	security_inode_setattr()
	inode_setattr()

	new_i_size = inode->i_size;
	....
}

      reply	other threads:[~2006-06-26 18:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-26 13:48 Evgeniy Dushistov
2006-06-26 18:54 ` Andrew Morton [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060626115449.d0c674a4.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=dushistov@mail.ru \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®