xfs
[Top] [All Lists]

Re: quick question about filename length

To: Chris Walker <christopher.walker@xxxxxxxxx>
Subject: Re: quick question about filename length
From: Eric Sandeen <sandeen@xxxxxxxxxxx>
Date: Sat, 16 May 2009 12:04:40 -0500
Cc: xfs@xxxxxxxxxxx
In-reply-to: <554e24be0905160915l49ff901bn41e4332349c555bc@xxxxxxxxxxxxxx>
References: <554e24be0905160915l49ff901bn41e4332349c555bc@xxxxxxxxxxxxxx>
User-agent: Thunderbird 2.0.0.21 (Macintosh/20090302)
Chris Walker wrote:
> Hello,
> 
> I see that
> #define MAXNAMELEN  256
> 
> Is this the maximum length of the filename with full path?  Or is this
> just the name of the file?
> 
> Many thanks!
> Chris

/*
 * MAXNAMELEN is the length (including the terminating null) of
 * the longest permissible file (component) name.
 */
#define MAXNAMELEN      256

"component" means path component.  So just the name of the file or dir
in the path.

See also how it's used in xfs_vn_lookup() for example:

        if (dentry->d_name.len >= MAXNAMELEN)
                return ERR_PTR(-ENAMETOOLONG);

a dentry is one component of the path, not the entire path.

-Eric

<Prev in Thread] Current Thread [Next in Thread>