Lines Matching refs:pos
23 static int romfs_mtd_read(struct super_block *sb, unsigned long pos, in romfs_mtd_read() argument
29 ret = ROMFS_MTD_READ(sb, pos, buflen, &rlen, buf); in romfs_mtd_read()
37 unsigned long pos, size_t maxlen) in romfs_mtd_strnlen() argument
48 ret = ROMFS_MTD_READ(sb, pos, segment, &len, buf); in romfs_mtd_strnlen()
55 pos += len; in romfs_mtd_strnlen()
66 static int romfs_mtd_strcmp(struct super_block *sb, unsigned long pos, in romfs_mtd_strcmp() argument
79 ret = ROMFS_MTD_READ(sb, pos, segment, &len, buf); in romfs_mtd_strcmp()
87 pos += len; in romfs_mtd_strcmp()
103 static int romfs_blk_read(struct super_block *sb, unsigned long pos, in romfs_blk_read() argument
112 offset = pos & (ROMBSIZE - 1); in romfs_blk_read()
114 bh = sb_bread(sb, pos >> ROMBSBITS); in romfs_blk_read()
121 pos += segment; in romfs_blk_read()
131 unsigned long pos, size_t limit) in romfs_blk_strnlen() argument
141 offset = pos & (ROMBSIZE - 1); in romfs_blk_strnlen()
143 bh = sb_bread(sb, pos >> ROMBSBITS); in romfs_blk_strnlen()
152 pos += segment; in romfs_blk_strnlen()
163 static int romfs_blk_strcmp(struct super_block *sb, unsigned long pos, in romfs_blk_strcmp() argument
173 offset = pos & (ROMBSIZE - 1); in romfs_blk_strcmp()
175 bh = sb_bread(sb, pos >> ROMBSBITS); in romfs_blk_strcmp()
181 pos += segment; in romfs_blk_strcmp()
197 BUG_ON((pos & (ROMBSIZE - 1)) != 0); in romfs_blk_strcmp()
198 bh = sb_bread(sb, pos >> ROMBSBITS); in romfs_blk_strcmp()
214 int romfs_dev_read(struct super_block *sb, unsigned long pos, in romfs_dev_read() argument
220 if (pos >= limit || buflen > limit - pos) in romfs_dev_read()
225 return romfs_mtd_read(sb, pos, buf, buflen); in romfs_dev_read()
229 return romfs_blk_read(sb, pos, buf, buflen); in romfs_dev_read()
238 unsigned long pos, size_t maxlen) in romfs_dev_strnlen() argument
243 if (pos >= limit) in romfs_dev_strnlen()
245 if (maxlen > limit - pos) in romfs_dev_strnlen()
246 maxlen = limit - pos; in romfs_dev_strnlen()
250 return romfs_mtd_strnlen(sb, pos, maxlen); in romfs_dev_strnlen()
254 return romfs_blk_strnlen(sb, pos, maxlen); in romfs_dev_strnlen()
265 int romfs_dev_strcmp(struct super_block *sb, unsigned long pos, in romfs_dev_strcmp() argument
271 if (pos >= limit) in romfs_dev_strcmp()
275 if (size + 1 > limit - pos) in romfs_dev_strcmp()
280 return romfs_mtd_strcmp(sb, pos, str, size); in romfs_dev_strcmp()
284 return romfs_blk_strcmp(sb, pos, str, size); in romfs_dev_strcmp()