lkml.org 
[lkml]   [2007]   [Jul]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 6/7] sysfs: make sysfs_add_one() automatically check for duplicate entry
On Tue, 31 Jul 2007 19:15:08 +0900,
Tejun Heo <htejun@gmail.com> wrote:

> Make sysfs_add_one() check for duplicate entry and return -EEXIST if
> such entry exists. This simplifies node addition code a bit.
>
> This patch doesn't introduce any noticeable behavior change.
>
> Signed-off-by: Tejun Heo <htejun@gmail.com>
> ---
> fs/sysfs/dir.c | 25 ++++++++++++++++---------
> fs/sysfs/file.c | 12 +++++-------
> fs/sysfs/symlink.c | 9 +++------
> fs/sysfs/sysfs.h | 2 +-
> 4 files changed, 25 insertions(+), 23 deletions(-)
>
> diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
> index 8ce3ffb..69e57be 100644
> --- a/fs/sysfs/dir.c
> +++ b/fs/sysfs/dir.c
> @@ -491,9 +491,15 @@ void sysfs_addrm_start(struct sysfs_addrm_cxt *acxt,
> *
> * LOCKING:
> * Determined by sysfs_addrm_start().
> + *
> + * RETURNS:
> + * 0 on success, -errno on failure.

The only possible failure is -EEXIST, so I'd state that explicitly,
especially since you rely on that fact below.

Otherwise
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
-
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/

\
 
 \ /
  Last update: 2007-07-31 15:29    [W:0.183 / U:0.356 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site