From: Jan Kara <jack@suse.cz>
To: Marcin Slusarz <marcin.slusarz@gmail.com>
Cc: linux-kernel@vger.kernel.org,
Ben Fennema <bfennema@falcon.csc.calpoly.edu>,
akpm@linux-foundation.org
Subject: Re: [PATCH 1/6] udf: remove wrong prototype of udf_readdir
Date: Mon, 17 Dec 2007 17:04:44 +0100 [thread overview]
Message-ID: <20071217160444.GD6979@atrey.karlin.mff.cuni.cz> (raw)
In-Reply-To: <20071216020630.GB26986@joi>
> sparse generated:
> fs/udf/dir.c:78:5: warning: symbol 'udf_readdir' was not declared. Should it be static?
> there are 2 different prototypes of udf_readdir - remove them and move
> code around to make it still compile
> Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Acked-by: Jan Kara <jack@suse.cz>
> CC: Ben Fennema <bfennema@falcon.csc.calpoly.edu>
> ---
> fs/udf/dir.c | 118 +++++++++++++++++++++++++++------------------------------
> 1 files changed, 56 insertions(+), 62 deletions(-)
>
> diff --git a/fs/udf/dir.c b/fs/udf/dir.c
> index 9e3b9f9..174d2fc 100644
> --- a/fs/udf/dir.c
> +++ b/fs/udf/dir.c
> @@ -36,68 +36,8 @@
> #include "udf_i.h"
> #include "udf_sb.h"
>
> -/* Prototypes for file operations */
> -static int udf_readdir(struct file *, void *, filldir_t);
> -static int do_udf_readdir(struct inode *, struct file *, filldir_t, void *);
> -
> -/* readdir and lookup functions */
> -
> -const struct file_operations udf_dir_operations = {
> - .read = generic_read_dir,
> - .readdir = udf_readdir,
> - .ioctl = udf_ioctl,
> - .fsync = udf_fsync_file,
> -};
> -
> -/*
> - * udf_readdir
> - *
> - * PURPOSE
> - * Read a directory entry.
> - *
> - * DESCRIPTION
> - * Optional - sys_getdents() will return -ENOTDIR if this routine is not
> - * available.
> - *
> - * Refer to sys_getdents() in fs/readdir.c
> - * sys_getdents() -> .
> - *
> - * PRE-CONDITIONS
> - * filp Pointer to directory file.
> - * buf Pointer to directory entry buffer.
> - * filldir Pointer to filldir function.
> - *
> - * POST-CONDITIONS
> - * <return> >=0 on success.
> - *
> - * HISTORY
> - * July 1, 1997 - Andrew E. Mileski
> - * Written, tested, and released.
> - */
> -
> -int udf_readdir(struct file *filp, void *dirent, filldir_t filldir)
> -{
> - struct inode *dir = filp->f_path.dentry->d_inode;
> - int result;
> -
> - lock_kernel();
> -
> - if (filp->f_pos == 0) {
> - if (filldir(dirent, ".", 1, filp->f_pos, dir->i_ino, DT_DIR) < 0) {
> - unlock_kernel();
> - return 0;
> - }
> - filp->f_pos++;
> - }
> -
> - result = do_udf_readdir(dir, filp, filldir, dirent);
> - unlock_kernel();
> - return result;
> -}
> -
> -static int
> -do_udf_readdir(struct inode *dir, struct file *filp, filldir_t filldir,
> - void *dirent)
> +static int do_udf_readdir(struct inode *dir, struct file *filp,
> + filldir_t filldir, void *dirent)
> {
> struct udf_fileident_bh fibh;
> struct fileIdentDesc *fi = NULL;
> @@ -244,3 +184,57 @@ do_udf_readdir(struct inode *dir, struct file *filp, filldir_t filldir,
>
> return 0;
> }
> +
> +/*
> + * udf_readdir
> + *
> + * PURPOSE
> + * Read a directory entry.
> + *
> + * DESCRIPTION
> + * Optional - sys_getdents() will return -ENOTDIR if this routine is not
> + * available.
> + *
> + * Refer to sys_getdents() in fs/readdir.c
> + * sys_getdents() -> .
> + *
> + * PRE-CONDITIONS
> + * filp Pointer to directory file.
> + * buf Pointer to directory entry buffer.
> + * filldir Pointer to filldir function.
> + *
> + * POST-CONDITIONS
> + * <return> >=0 on success.
> + *
> + * HISTORY
> + * July 1, 1997 - Andrew E. Mileski
> + * Written, tested, and released.
> + */
> +
> +static int udf_readdir(struct file *filp, void *dirent, filldir_t filldir)
> +{
> + struct inode *dir = filp->f_path.dentry->d_inode;
> + int result;
> +
> + lock_kernel();
> +
> + if (filp->f_pos == 0) {
> + if (filldir(dirent, ".", 1, filp->f_pos, dir->i_ino, DT_DIR) < 0) {
> + unlock_kernel();
> + return 0;
> + }
> + filp->f_pos++;
> + }
> +
> + result = do_udf_readdir(dir, filp, filldir, dirent);
> + unlock_kernel();
> + return result;
> +}
> +
> +/* readdir and lookup functions */
> +const struct file_operations udf_dir_operations = {
> + .read = generic_read_dir,
> + .readdir = udf_readdir,
> + .ioctl = udf_ioctl,
> + .fsync = udf_fsync_file,
> +};
> --
> 1.5.3.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
--
Jan Kara <jack@suse.cz>
SuSE CR Labs
prev parent reply other threads:[~2007-12-17 16:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-16 2:06 [PATCH 1/6] udf: remove wrong prototype of udf_readdir Marcin Slusarz
2007-12-17 16:04 ` Jan Kara [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=20071217160444.GD6979@atrey.karlin.mff.cuni.cz \
--to=jack@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=bfennema@falcon.csc.calpoly.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=marcin.slusarz@gmail.com \
/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