From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave Hansen Subject: Re: [RFC v14-rc][PATCH 14/23] A new file type (CR_FD_OBJREF) for a file descriptor already setup Date: Fri, 20 Mar 2009 13:11:28 -0700 Message-ID: <1237579888.8286.244.camel@nimitz> References: <1237574868-3371-1-git-send-email-orenl@cs.columbia.edu> <1237574868-3371-15-git-send-email-orenl@cs.columbia.edu> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1237574868-3371-15-git-send-email-orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Oren Laadan Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org List-Id: containers.vger.kernel.org On Fri, 2009-03-20 at 14:47 -0400, Oren Laadan wrote: > > > +/* cr_write_fd_file - for regular files, directories, symbolic links > */ > +static int cr_write_fd_file(struct cr_ctx *ctx, struct file *file) > +{ > + return cr_write_fname(ctx, &file->f_path, &ctx->fs_mnt); > +} > + > +/* cr_inode_to_fdtype - determine the fd type given an inode */ > +static inline enum fd_type cr_inode_to_fdtype(struct inode *inode) > +{ > + switch (inode->i_mode & S_IFMT) { > + case S_IFREG: > + return CR_FD_FILE; > + case S_IFDIR: > + return CR_FD_DIR; > + } > + /* file type unsupported */ > + return -EBADF; > +} These are cleanups and abstractions of a previous patch. Please either put them in that patch or separate them from the CR_FD_OBJREF patch. They don't belong together. -- Dave