mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Jan Engelhardt <jengelh@linux01.gwdg.de>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: Assuming NULL
Date: Sat, 11 Jun 2005 18:30:35 +0100	[thread overview]
Message-ID: <20050611173035.GA1847@infradead.org> (raw)
In-Reply-To: <Pine.LNX.4.61.0506111823440.19223@yvahk01.tjqt.qr>

On Sat, Jun 11, 2005 at 06:24:22PM +0200, Jan Engelhardt wrote:
> Hi developers,
> 
> 
> 
> some places in fs/*.c have conditions like
> 
> (namei.c, 238, in "int permission()"):
>         if(inode->i_op && inode->i_op->permission)
> 
> Others just have
> (namei.c, 813, in "int fastcall link_path_walk()"):
>         if(!inode->i_op->lookup)
> 
> My question is: Which one is right wrt the case "i_op ==/!= NULL"?
> There are two ways:
> 
> - the kernel assumes i_op (and similar) is always non-NULL
>   => then we can remove a lot of checks, like the first example above

i_op must not be NULL .alloc_inode() intitializes it to &empty_iops,
and setting it to NULL would be a bug.


      parent reply	other threads:[~2005-06-11 17:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-11 16:24 Jan Engelhardt
2005-06-11 16:49 ` Måns Rullgård
2005-06-11 17:17   ` Jan Engelhardt
2005-06-11 17:24 ` Willy Tarreau
2005-06-11 17:30 ` Christoph Hellwig [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=20050611173035.GA1847@infradead.org \
    --to=hch@infradead.org \
    --cc=jengelh@linux01.gwdg.de \
    --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®